|
@@ -1487,24 +1487,14 @@
|
|
|
|
|
|
|
|
|
<select id="getCapacityByDefend" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
- select * from(
|
|
|
+ select distinct * 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"
|
|
|
+ oo.ORDER_NUMBER "orderNumber",
|
|
|
+ ter.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
|
|
|
+ rg1.GATEPOST_NAME "gatepostName1",
|
|
|
+ tlfr.RESULT_OUT_GATE_TIME "resultOutGateTime",
|
|
|
+ rg2.GATEPOST_NAME "gatepostName2",
|
|
|
+ rm.material_name "materialName"
|
|
|
from OMSTRUCK_ORDER oo
|
|
|
left join OMSTRUCK_ORDER_MATERIAL oom
|
|
|
on oom.ORDER_ID = oo.ORDER_ID
|
|
@@ -1514,32 +1504,28 @@
|
|
|
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
|
|
|
+ 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
|
|
|
+ <where>
|
|
|
+ <if test="oneDate != null">
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = tlfr.RESULT_OUT_GATE_TIME
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null" >
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') < = tlfr.RESULT_OUT_GATE_TIME
|
|
|
</if>
|
|
|
+ <if test="endDate != null" >
|
|
|
+ and to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss') >= tlfr.RESULT_OUT_GATE_TIME
|
|
|
+ </if>
|
|
|
+ <if test="con != null">
|
|
|
+ and (instr(rc.CAPACITY_NUMBER, #{con}) > 0 or instr(rg1.GATEPOST_NAME, #{con}) > 0 or instr(rg2.GATEPOST_NAME, #{con}) > 0 )
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
order by ter.RESULT_ENTRY_GATE_TIME desc
|
|
|
)
|
|
|
<where>
|