|
@@ -459,7 +459,129 @@
|
|
left join amstruck_inward_requirement air on arp.requirement_plan_id = air.requirement_id
|
|
left join amstruck_inward_requirement air on arp.requirement_plan_id = air.requirement_id
|
|
where oo.order_type = 11 and air.requirement_type = '包月'
|
|
where oo.order_type = 11 and air.requirement_type = '包月'
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+ <select id="getAllReverseResult" resultType="java.util.Map">
|
|
|
|
+ SELECT * FROM (
|
|
|
|
+ SELECT
|
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
|
+ CONCAT(CONCAT(RM.MATERIAL_MODEL, '('), CONCAT(MATERIAL_SPECIFICATION, ')')) "materialMC",
|
|
|
|
+ OOM.ORDER_MATERIAL_NUMBER "materialNumber",
|
|
|
|
+ SUM(RMS.MATERIAL_THEORETICAL_WEIGHT)/1000 || '吨' "weight",
|
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
|
+ RW1.WAREHOUSE_NAME "loadName",
|
|
|
|
+ RW.WAREHOUSE_NAME "unloadName",
|
|
|
|
+ TLR.RESULT_LOAD_START_TIME "loadStartTime",
|
|
|
|
+ TLR.RESULT_LOAD_END_TIME "loadEndTime",
|
|
|
|
+ TUR.RESULT_START_TIME "unloadStartTime",
|
|
|
|
+ TUR.RESULT_END_TIME"unloadEndTime"
|
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON OO.ORDER_ID=TTR.ORDER_ID
|
|
|
|
+ LEFT JOIN TMSTRUCK_LOAD_RESULT TLR ON TLR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
|
|
|
|
+ LEFT JOIN TMSTRUCK_UNLOAD_RESULT TUR ON TUR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
|
|
|
|
+ LEFT JOIN WMSP_OUTBOUND_RESULT WOR ON WOR.BILL_LADING_ID=OO.ORDER_ID
|
|
|
|
+ LEFT JOIN WMSP_OUTBOUND_SCAN_RESULT WOSR ON WOSR.OUTBOUND_RESULT_ID=WOR.RESULT_ID
|
|
|
|
+ LEFT JOIN WMSP_INBOUND_SCAN_RESULT WISR ON WOSR.INBOUND_RESULT_ID=WISR.INBOUND_RESULT_ID
|
|
|
|
+ LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID=WISR.MATERIAL_ID
|
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OOM.ORDER_ID=OO.ORDER_ID
|
|
|
|
+ LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID=RMS.MATERIAL_ID
|
|
|
|
+ LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID=OO.CAPACITY_ID
|
|
|
|
+ LEFT JOIN AMSTRUCK_INWARD_PLAN AIP ON OO.ORDER_PLAN_ID = AIP.PLAN_ID
|
|
|
|
+ LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP ON ARP.PLAN_ID = AIP.PLAN_ID
|
|
|
|
+ LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
|
|
|
|
+ LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
|
|
|
|
+ LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
|
|
|
|
+ LEFT JOIN RMS_WAREHOUSE RW ON RW.WAREHOUSE_ID = ARM.REQUIREMENT_UNLOAD_UNIT_ID
|
|
|
|
+ LEFT JOIN RMS_WAREHOUSE RW1 ON RW1.WAREHOUSE_ID = ARM.REQUIREMENT_PLATFORM_ID
|
|
|
|
+ WHERE OO.ORDER_TYPE=25 AND OO.ORDER_STATUS=2
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TUR.RESULT_END_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TUR.RESULT_END_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TUR.RESULT_END_TIME
|
|
|
|
+ </if>
|
|
|
|
+ GROUP BY OO.ORDER_NUMBER,RC.CAPACITY_NUMBER,OOM.ORDER_MATERIAL_NUMBER,RM.MATERIAL_NAME,RM.MATERIAL_MODEL,MATERIAL_SPECIFICATION,RW1.WAREHOUSE_NAME,RW.WAREHOUSE_NAME,RS.SHIPPER_NAME,TLR.RESULT_LOAD_START_TIME,
|
|
|
|
+ TLR.RESULT_LOAD_END_TIME,TUR.RESULT_START_TIME,TUR.RESULT_END_TIME
|
|
|
|
+ ORDER BY TUR.RESULT_END_TIME DESC
|
|
|
|
+ )
|
|
|
|
+ <where>
|
|
|
|
+ <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="materialName != null">
|
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialMC != null">
|
|
|
|
+ <foreach collection="materialMC" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialMC" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialNumber != null">
|
|
|
|
+ <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialNumber" = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="weight != null">
|
|
|
|
+ <foreach collection="weight" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "weight" = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shipperName != null">
|
|
|
|
+ <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "shipperName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="loadName != null">
|
|
|
|
+ <foreach collection="loadName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "loadName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="unloadName != null">
|
|
|
|
+ <foreach collection="unloadName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "unloadName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="loadStartTime != null">
|
|
|
|
+ <foreach collection="loadStartTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "loadStartTime" = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="unloadStartTime != null">
|
|
|
|
+ <foreach collection="unloadStartTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "unloadStartTime" = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="loadEndTime != null">
|
|
|
|
+ <foreach collection="loadEndTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "loadEndTime" = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="unloadEndTime != null">
|
|
|
|
+ <foreach collection="unloadEndTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "unloadEndTime" = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ <include refid="orderBy"></include>
|
|
|
|
+ </select>
|
|
<sql id="orderBy">
|
|
<sql id="orderBy">
|
|
<if test="orderField != null and orderField != ''">
|
|
<if test="orderField != null and orderField != ''">
|
|
order by "${orderField}"
|
|
order by "${orderField}"
|