|
@@ -1648,7 +1648,8 @@
|
|
|
left join RMS_MATERIAL RM
|
|
|
on RM.MATERIAL_ID = ASM.MATERIAL_ID
|
|
|
where a_s_order.SALE_ORDER_STATUS in (2,4)
|
|
|
- and a_s_order.CLOSE_STATUS is not null) SSSR
|
|
|
+ and a_s_order.CLOSE_STATUS is not null
|
|
|
+ and a_s_order.DELETED = 0) SSSR
|
|
|
<if test="con != null" >
|
|
|
where SSSR."consigneeCompanyName" LIKE #{con}
|
|
|
</if>
|
|
@@ -1764,93 +1765,94 @@
|
|
|
left join RMS_CONSIGNEE r_consignee
|
|
|
on a_s_order.RECEIVE_ID=r_consignee.CONSIGNEE_ID
|
|
|
where a_s_order.SALE_ORDER_STATUS in (2,4)
|
|
|
- and a_s_order.CLOSE_STATUS is null) SSSR
|
|
|
- <if test="con != null" >
|
|
|
+ and a_s_order.CLOSE_STATUS is null
|
|
|
+ and a_s_order.DELETED = 0) SSSR
|
|
|
+ <if test="con != null">
|
|
|
where SSSR."consigneeCompanyName" LIKE #{con}
|
|
|
</if>
|
|
|
- <if test="con != null" >
|
|
|
+ <if test="con != null">
|
|
|
or SSSR."saleNumber" LIKE #{con}
|
|
|
</if>
|
|
|
- <!-- <where>-->
|
|
|
- <!-- <if test="saleNumber != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleNumber" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="shipperName != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "shipperName" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="consigneeCompanyName != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "consigneeCompanyName" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="consigneeWarrantyAmount != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="consigneeWarrantyAmount" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "consigneeWarrantyAmount" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="consigneeWarrantyWeight != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="consigneeWarrantyWeight" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "consigneeWarrantyWeight" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="saleOrderIsselfMention != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleOrderIsselfMention" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleOrderIsselfMention" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="saleAccountBalance != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleAccountBalance" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleAccountBalance" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="saleCurrentOrderAmount != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleCurrentOrderAmount" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleCurrentOrderAmount" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="saleHistoricalOrderAmout != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleHistoricalOrderAmout" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleHistoricalOrderAmout" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="saleOrderReceiveCustomer != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleOrderReceiveCustomer" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleOrderReceiveCustomer" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="saleUnitPrice != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleUnitPrice" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleUnitPrice" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="saleOrderTax != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleOrderTax" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleOrderTax" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- <if test="saleRemark != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleRemark" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </if>-->
|
|
|
- <!-- </where>-->
|
|
|
+<!-- <where>-->
|
|
|
+<!-- <if test="saleNumber != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleNumber" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="shipperName != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "shipperName" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="consigneeCompanyName != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "consigneeCompanyName" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="consigneeWarrantyAmount != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="consigneeWarrantyAmount" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "consigneeWarrantyAmount" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="consigneeWarrantyWeight != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="consigneeWarrantyWeight" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "consigneeWarrantyWeight" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="saleOrderIsselfMention != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleOrderIsselfMention" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleOrderIsselfMention" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="saleAccountBalance != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleAccountBalance" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleAccountBalance" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="saleCurrentOrderAmount != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleCurrentOrderAmount" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleCurrentOrderAmount" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="saleHistoricalOrderAmout != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleHistoricalOrderAmout" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleHistoricalOrderAmout" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="saleOrderReceiveCustomer != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleOrderReceiveCustomer" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleOrderReceiveCustomer" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="saleUnitPrice != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleUnitPrice" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleUnitPrice" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="saleOrderTax != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleOrderTax" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleOrderTax" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="saleRemark != null">-->
|
|
|
+<!-- and-->
|
|
|
+<!-- <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">-->
|
|
|
+<!-- "saleRemark" like '%${item}%'-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </where>-->
|
|
|
<include refid="orderBy"></include>
|
|
|
</select>
|
|
|
|
|
@@ -2036,4 +2038,19 @@
|
|
|
AND RM.MATERIAL_NAME LIKE #{con}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getNetWeight" parameterType="DECIMAL" resultType="DECIMAL">
|
|
|
+ SELECT SUM(twr.RESULT_NET_WEIGHT)
|
|
|
+ FROM AMS_SALE_ORDER_MATERIAL asom
|
|
|
+ left join OMSTRUCK_ORDER oo on oo.ORDER_PLAN_ID = asom.SALE_ORDER_MATERIAL_ID
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT ttr on ttr.ORDER_ID = oo.ORDER_ID
|
|
|
+ left join TMSTRUCK_WEIGHT_RESULT twr on twr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
+ where asom.sale_order_id = #{saleOrderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCarNum" parameterType="DECIMAL" resultType="DECIMAL">
|
|
|
+ SELECT COUNT(ASOM.SALE_ORDER_MATERIAL_ID)
|
|
|
+ FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ WHERE ASOM.SALE_ORDER_ID = #{saleOrderId}
|
|
|
+ </select>
|
|
|
</mapper>
|