|
@@ -1490,4 +1490,167 @@
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="getCapacityByDefend" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
|
+ select * from(
|
|
|
|
+ select rc.CAPACITY_NUMBER "capacityNumber",
|
|
|
|
+ oo.ORDER_NUMBER "orderNumber",
|
|
|
|
+ twr.RESULT_GROSS_WEIGHT "resultGrossWeight",
|
|
|
|
+ twr.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
|
|
|
|
+ rtc1.TRUCK_CALCULATE_NUMBER "truckCalculateNumber1",
|
|
|
|
+ twr.RESULT_TARE_WEIGHT "resultTareWeight",
|
|
|
|
+ twr.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
|
|
|
|
+ rtc2.TRUCK_CALCULATE_NUMBER "truckCalculateNumber2",
|
|
|
|
+ twr.RESULT_NET_WEIGHT "resultNetWeight",
|
|
|
|
+ ter.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
|
|
|
|
+ rg1.GATEPOST_NAME "gatepostName1",
|
|
|
|
+ tlfr.RESULT_OUT_GATE_TIME "resultOutGateTime",
|
|
|
|
+ rg2.GATEPOST_NAME "gatepostName2",
|
|
|
|
+ tlr.RESULT_LOAD_END_TIME "resultLoadEndTime",
|
|
|
|
+ rw1.WAREHOUSE_NAME "warehouseName1",
|
|
|
|
+ tur.RESULT_END_TIME "resultEndTime",
|
|
|
|
+ rw2.WAREHOUSE_NAME "warehouseName2"
|
|
|
|
+ from OMSTRUCK_ORDER oo
|
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL oom
|
|
|
|
+ on oom.ORDER_ID = oo.ORDER_ID
|
|
|
|
+ left join RMS_MATERIAL rm
|
|
|
|
+ on rm.MATERIAL_ID = oom.MATERIAL_ID
|
|
|
|
+ left join RMS_CAPACITY rc
|
|
|
|
+ on rc.CAPACITY_ID = oo.CAPACITY_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
|
|
|
|
+ left join RMS_TRUCK_CALCULATE rtc1
|
|
|
|
+ on twr.RESULT_GROSS_PLACE_ID = rtc1.TRUCK_CALCULATE_ID
|
|
|
|
+ left join RMS_TRUCK_CALCULATE rtc2
|
|
|
|
+ on twr.RESULT_GROSS_PLACE_ID = rtc2.TRUCK_CALCULATE_ID
|
|
|
|
+ left join TMSTRUCK_ENFACTORY_RESULT ter
|
|
|
|
+ on ter.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
|
+ left join RMS_GATEPOST rg1
|
|
|
|
+ on rg1.GATEPOST_ID = ter.GATEPOST_ID
|
|
|
|
+ left join TMSTRUCK_LEAVE_FACTORY_RESULT tlfr
|
|
|
|
+ on tlfr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
|
+ left join RMS_GATEPOST rg2
|
|
|
|
+ on rg2.GATEPOST_ID = tlfr.GATEPOST_ID
|
|
|
|
+ left join TMSTRUCK_LOAD_RESULT tlr
|
|
|
|
+ on tlr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
|
+ left join RMS_WAREHOUSE rw1
|
|
|
|
+ on tlr.LOADING_ID = rw1.WAREHOUSE_ID
|
|
|
|
+ left join TMSTRUCK_UNLOAD_RESULT tur
|
|
|
|
+ on tur.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
|
+ left join RMS_WAREHOUSE rw2
|
|
|
|
+ on tur.RESULT_UNLOAD_PLACE_ID = rw2.WAREHOUSE_ID
|
|
|
|
+ where trunc(ter.RESULT_ENTRY_GATE_TIME) = trunc(sysdate)
|
|
|
|
+ <if test="con!=null">
|
|
|
|
+ and instr(rc.CAPACITY_NUMBER , #{con})>0
|
|
|
|
+ </if>
|
|
|
|
+ order by ter.RESULT_ENTRY_GATE_TIME desc
|
|
|
|
+ )
|
|
|
|
+ <where>
|
|
|
|
+ <if test=" capacityNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderNumber != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "orderNumber" 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=" resultGrossWeightTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultGrossWeightTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="truckCalculateNumber1 != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="truckCalculateNumber1" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "truckCalculateNumber1" 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=" resultTareWeightTime != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultTareWeightTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="truckCalculateNumber2 != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="truckCalculateNumber2" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "truckCalculateNumber2" 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=" resultEntryGateTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultEntryGateTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test=" gatepostName1!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="gatepostName1" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "gatepostName1" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test=" resultOutGateTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultOutGateTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test=" gatepostName2 != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="gatepostName2" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "gatepostName2" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test=" resultLoadEndTime != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultLoadEndTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test=" warehouseName1 != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="warehouseName1" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "warehouseName1" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test=" resultEndTime != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultEndTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test=" warehouseName2 != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="warehouseName2" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "warehouseName2" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|