|
@@ -1637,4 +1637,130 @@
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getInwardReportForAssemble" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
|
+ select * from (
|
|
|
|
+ select
|
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
|
+ RW1.WAREHOUSE_NAME "unloadName",
|
|
|
|
+ RW2.WAREHOUSE_NAME "loadName",
|
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
|
+ RTC2.TRUCK_CALCULATE_NUMBER "grossNumber",
|
|
|
|
+ RTC1.TRUCK_CALCULATE_NUMBER "tareNumber",
|
|
|
|
+ TWR.RESULT_NET_WEIGHT "resultNetWeight",
|
|
|
|
+ TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
|
|
|
|
+ TWR.RESULT_TARE_WEIGHT "resultTareWeight",
|
|
|
|
+ TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
|
|
|
|
+ TWR.RESULT_GROSS_WEIGHT "resultGrossWeight"
|
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
|
+ left join TMSTRUCK_WEIGHT_RESULT TWR on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
|
|
|
|
+ left join RMS_CAPACITY RC on OO.CAPACITY_ID = RC.CAPACITY_ID
|
|
|
|
+ left join RMS_TRUCK_CALCULATE RTC1 on RTC1.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
|
|
|
|
+ left join RMS_TRUCK_CALCULATE RTC2 on RTC2.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
|
|
|
|
+ left join AMSTRUCK_INWARD_PLAN AIP on AIP.PLAN_ID = OO.ORDER_PLAN_ID
|
|
|
|
+ left join AMSTRUCK_REQUIREMENT_PLAN ARP on AIP.PLAN_ID = ARP.PLAN_ID
|
|
|
|
+ left join AMSTRUCK_INWARD_REQUIREMENT AIR on AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
|
|
|
|
+ left join AMS_PURCHASE_ORDER APO ON APO.PURCHASE_ORDER_ID=AIR.PURCHASE_ORDER_ID
|
|
|
|
+ left join RMS_SHIPPER RS on AIR.REQUIREMENT_SHIPPER_ID = RS.SHIPPER_ID
|
|
|
|
+ left join AMSTRUCK_REQUIREMENT_MATERIAL ARM on AIR.REQUIREMENT_ID = ARM.REQUIREMENT_ID
|
|
|
|
+ left join RMS_MATERIAL RM on ARM.MATERIAL_ID = RM.MATERIAL_ID
|
|
|
|
+ left join RMS_WAREHOUSE RW1 on ARM.REQUIREMENT_UNLOAD_UNIT_ID = RW1.WAREHOUSE_ID
|
|
|
|
+ left join RMS_WAREHOUSE RW2 on ARM.REQUIREMENT_PLATFORM_ID = RW2.WAREHOUSE_ID
|
|
|
|
+ where OO.ORDER_TYPE in (15,16) and TWR.RESULT_NET_WEIGHT >= 0
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_TARE_WEIGHT_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_TARE_WEIGHT_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_TARE_WEIGHT_TIME
|
|
|
|
+ </if>
|
|
|
|
+ )
|
|
|
|
+ <if test=" orderNumber != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test=" capacityNumber != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "capacityNumber" 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="unloadName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="unloadName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "unloadName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="loadName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="loadName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "loadName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="grossNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="grossNumber" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "grossNumber" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tareNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="tareNumber" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "tareNumber" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultNetWeight!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultNetWeight" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultTareWeightTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultTareWeightTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultTareWeight!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultTareWeight" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultGrossWeightTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultGrossWeightTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultGrossWeight!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultGrossWeight" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="purchaseOrderNo!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "purchaseOrderNo" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|