|
@@ -384,7 +384,7 @@
|
|
|
on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
|
|
|
left join RMS_SUPPLIER RS
|
|
|
on RS.SUPPLIER_ID = ASO.SHIPPER_ID
|
|
|
- join TMSTRUCK_LOAD_RESULT TLR
|
|
|
+ left join TMSTRUCK_LOAD_RESULT TLR
|
|
|
on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
and TLR.MATERIAL_ID = TWR.MATERIAL_ID
|
|
|
left join RMS_WAREHOUSE RW
|
|
@@ -393,17 +393,17 @@
|
|
|
on TWR.RESULT_GROSS_PLACE_ID = RTCMAO.TRUCK_CALCULATE_ID
|
|
|
left join RMS_TRUCK_CALCULATE RTCPI
|
|
|
on TWR.RESULT_TARE_PLACE_ID = RTCPI.TRUCK_CALCULATE_ID
|
|
|
- join TMSTRUCK_ENFACTORY_RESULT TER
|
|
|
+ left join TMSTRUCK_ENFACTORY_RESULT TER
|
|
|
on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
left join RMS_GATEPOST RGEN
|
|
|
on RGEN.GATEPOST_ID = TER.GATEPOST_ID
|
|
|
- join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
|
|
|
+ left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
|
|
|
on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
left join RMS_GATEPOST RGOUT
|
|
|
on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
|
|
|
- join RMS_CAPACITY RC
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
- join RMS_MATERIAL RM
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
on RM.MATERIAL_ID = TWR.MATERIAL_ID
|
|
|
left join TMSTRUCK_ARRIVAL_RESULT TAR
|
|
|
on TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
@@ -411,16 +411,24 @@
|
|
|
on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
|
|
|
WHERE OO.ORDER_TYPE = #{orderTypee}
|
|
|
AND ASO.SHIPPER_ID = #{shipperId}
|
|
|
+ AND OO.ORDER_STATUS IN (2,5)
|
|
|
<if test="carrierSsoId != null">
|
|
|
and RC2.CARRIER_SSO_ID = #{carrierSsoId}
|
|
|
</if>
|
|
|
<if test="receivName != null">
|
|
|
and RCON.CONSIGNEE_COMPANY_NAME like #{receivName}
|
|
|
</if>
|
|
|
- <if test="oneDate != null">
|
|
|
+ <if test="oneDate != null and orderTypee == 1">
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and orderTypee == 1">
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
|
|
|
+ </if>
|
|
|
+ <if test="oneDate != null and orderTypee != 1">
|
|
|
and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
|
</if>
|
|
|
- <if test="startDate != null">
|
|
|
+ <if test="startDate != null and orderTypee != 1">
|
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
|
</if>
|
|
@@ -1313,223 +1321,91 @@
|
|
|
"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>
|
|
|
<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>
|
|
|
+ select *
|
|
|
+ from (select DISTINCT oo.order_id "orderId",
|
|
|
+ rm.material_name "materialName",
|
|
|
+ rc.capacity_number "capacityNumber",
|
|
|
+ rs.supplier_name "sendName",
|
|
|
+ oo.order_number "orderNumber",
|
|
|
+ rce.consignee_company_name "reciveName",
|
|
|
+ ttr.result_total_id "totalResultId",
|
|
|
+ twr.result_gross_weight "grossWeight",
|
|
|
+ twr.result_gross_weight_time "grossweightTime",
|
|
|
+ twr.result_tare_weight "tareWeight",
|
|
|
+ twr.result_tare_weight_time "tareWeightTime",
|
|
|
+ twr.result_net_weight "resultNetWeight",
|
|
|
+ RC.CARRIER_NAME "carrierName",
|
|
|
+ RL.LINE_NAME "lineName",
|
|
|
+ db.RESULT_FOREIGN_SHIP_NAME "shipName",
|
|
|
+ rw2.WAREHOUSE_NAME "warehouseName"
|
|
|
+ from omstruck_order oo
|
|
|
+ left join omstruck_order_material oom
|
|
|
+ on oom.order_id = oo.order_id
|
|
|
+ LEFT JOIN RMS_LINE RL
|
|
|
+ ON RL.LINE_ID=OO.LINE_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 amstruck_inward_plan aip
|
|
|
+ on aip.plan_id = oo.order_plan_id
|
|
|
+ left join amstruck_requirement_plan arp
|
|
|
+ on arp.plan_id = aip.plan_id
|
|
|
+ left join RMS_CARRIER rc
|
|
|
+ on AIP.CARRIER_ID=rc.CARRIER_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 DIL_BATCH DB
|
|
|
+ on db.BATCH_ID = apo.BATCH_ID
|
|
|
+ left join rms_supplier rs
|
|
|
+ on rs.supplier_id = apo.supplier_unit_id
|
|
|
+ left join rms_consignee rce
|
|
|
+ on rce.consignee_id = apo.receive_unit_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 rtc1.truck_calculate_id = twr.result_tare_place_id
|
|
|
+ left join tmstruck_load_result tlr
|
|
|
+ on tlr.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_warehouse rw
|
|
|
+ on rw.warehouse_id = tlr.loading_id
|
|
|
+ left join rms_truck_calculate rtc2
|
|
|
+ on rtc2.truck_calculate_id = twr.result_gross_place_id
|
|
|
+ left join tmstruck_unload_result tur
|
|
|
+ on tur.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_warehouse rw2
|
|
|
+ on rw2.warehouse_id = tur.result_unload_place_id
|
|
|
+ LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT TLFR1
|
|
|
+ ON TLFR1.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ where
|
|
|
+ twr.result_net_weight IS NOT NULL
|
|
|
+ AND oo.ORDER_TYPE in (15,16)
|
|
|
+ <if test="orgCode!=null">
|
|
|
+ and oo.OPTIONER_CODE = #{orgCode}
|
|
|
</if>
|
|
|
- <if test="resultTareWeight!= null">
|
|
|
- and
|
|
|
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
|
|
|
- "resultTareWeight" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ <if test="orderTypee !=null">
|
|
|
+ and oo.ORDER_TYPE = #{orderTypee}
|
|
|
</if>
|
|
|
- <if test="resultGrossWeightTime!= null">
|
|
|
- and
|
|
|
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
|
|
|
- "resultGrossWeightTime" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ <if test="index!=null">
|
|
|
+ and ( (instr(rs.supplier_name, #{index}) > 0) or (instr(rm.material_name , #{index}) > 0)
|
|
|
+ or (instr(rc.capacity_number , #{index}) > 0) or (instr(rce.consignee_company_name , #{index}) > 0)
|
|
|
+ or (instr( RC.CARRIER_NAME , #{index}) > 0) or (instr(RL.LINE_NAME , #{index}) > 0))
|
|
|
</if>
|
|
|
- <if test="resultGrossWeight!= null">
|
|
|
- and
|
|
|
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
|
|
|
- "resultGrossWeight" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ <if test="oneDate != null">
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TWR.RESULT_TARE_WEIGHT_TIME
|
|
|
</if>
|
|
|
- <if test="purchaseOrderNo!= null">
|
|
|
- and
|
|
|
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
|
|
|
- "purchaseOrderNo" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ <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>
|
|
|
+ )
|
|
|
</select>
|
|
|
<select id="getCapacityRemark" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
select OO.ORDER_TYPE,
|
|
@@ -1760,8 +1636,8 @@
|
|
|
AND TUR.SEGMENT_SQE = 8
|
|
|
AND TWR4.TARE_SEGMENT_SQE = 9
|
|
|
AND TLFR2.SEGMENT_SQE = 10
|
|
|
- and oo.ORDER_TYPE in (10,20)
|
|
|
AND twr4.result_net_weight IS NOT NULL
|
|
|
+ AND oo.ORDER_TYPE in (10,20)
|
|
|
<if test="orgCode!=null">
|
|
|
and oo.OPTIONER_CODE = #{orgCode}
|
|
|
</if>
|
|
@@ -1791,7 +1667,8 @@
|
|
|
TWR.RESULT_TARE_WEIGHT_TIME "tareWeightTime",
|
|
|
TWR.RESULT_NET_WEIGHT "resultNetWeight",
|
|
|
RL.LINE_NAME "lineName",
|
|
|
- RC3.CARRIER_NAME "carrierName"
|
|
|
+ RC3.CARRIER_NAME "carrierName",
|
|
|
+ DB.RESULT_FOREIGN_SHIP_NAME "shipName"
|
|
|
from OMSTRUCK_ORDER OO
|
|
|
LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
ON OO.ORDER_ID=OOM.ORDER_ID
|
|
@@ -1803,6 +1680,8 @@
|
|
|
ON RM.MATERIAL_ID=OOM.MATERIAL_ID
|
|
|
LEFT JOIN AMS_PURCHASE_ORDER APO
|
|
|
ON OO.ORDER_PLAN_ID=APO.PURCHASE_ORDER_ID
|
|
|
+ LEFT JOIN DIL_BATCH DB
|
|
|
+ ON DB.BATCH_ID = APO.BATCH_ID
|
|
|
LEFT JOIN RMS_CARRIER RC3
|
|
|
ON RC3.CARRIER_ID=OO.CARRIER_ID
|
|
|
LEFT JOIN RMS_SUPPLIER RS
|
|
@@ -1871,7 +1750,7 @@
|
|
|
left join RMS_WAREHOUSE RW2 on ARM.REQUIREMENT_PLATFORM_ID = RW2.WAREHOUSE_ID
|
|
|
left join RMS_MATERIAL_TYPE RMT ON RMT.MATERIAL_TYPE_ID = RM.MATERIAL_TYPE_ID
|
|
|
<where>
|
|
|
- OO.ORDER_TYPE in (11,15,16) AND TWR.RESULT_NET_WEIGHT IS NOT NULL
|
|
|
+ OO.ORDER_TYPE = 11 AND TWR.RESULT_NET_WEIGHT IS NOT NULL
|
|
|
<if test="orgCode!=null">
|
|
|
AND OO.OPTIONER_CODE=#{orgCode}
|
|
|
</if>
|
|
@@ -1890,5 +1769,86 @@
|
|
|
)
|
|
|
</where>
|
|
|
</select>
|
|
|
+ <select id="getOutFactoryInwardList" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ select *
|
|
|
+ from (select DISTINCT oo.order_id "orderId",
|
|
|
+ rm.material_name "materialName",
|
|
|
+ rc.capacity_number "capacityNumber",
|
|
|
+ rs.supplier_name "sendName",
|
|
|
+ oo.order_number "orderNumber",
|
|
|
+ rce.consignee_company_name "reciveName",
|
|
|
+ ttr.result_total_id "totalResultId",
|
|
|
+ twr.result_gross_weight "grossWeight",
|
|
|
+ twr.result_gross_weight_time "grossweightTime",
|
|
|
+ twr.result_tare_weight "tareWeight",
|
|
|
+ twr.result_tare_weight_time "tareWeightTime",
|
|
|
+ twr.result_net_weight "resultNetWeight",
|
|
|
+ RC.CARRIER_NAME "carrierName",
|
|
|
+ RL.LINE_NAME "lineName",
|
|
|
+ DB.RESULT_FOREIGN_SHIP_NAME "shipName",
|
|
|
+ rw2.WAREHOUSE_NAME "warehouseName"
|
|
|
+ from omstruck_order oo
|
|
|
+ left join omstruck_order_material oom
|
|
|
+ on oom.order_id = oo.order_id
|
|
|
+ LEFT JOIN RMS_LINE RL
|
|
|
+ ON RL.LINE_ID=OO.LINE_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 amstruck_inward_plan aip
|
|
|
+ on aip.plan_id = oo.order_plan_id
|
|
|
+ left join amstruck_requirement_plan arp
|
|
|
+ on arp.plan_id = aip.plan_id
|
|
|
+ left join RMS_CARRIER rc
|
|
|
+ on AIP.CARRIER_ID=rc.CARRIER_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 DIL_BATCH DB
|
|
|
+ ON DB.BATCH_ID = APO.BATCH_ID
|
|
|
+ left join rms_supplier rs
|
|
|
+ on rs.supplier_id = apo.supplier_unit_id
|
|
|
+ left join rms_consignee rce
|
|
|
+ on rce.consignee_id = apo.receive_unit_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 rtc1.truck_calculate_id = twr.result_tare_place_id
|
|
|
+ left join tmstruck_load_result tlr
|
|
|
+ on tlr.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_warehouse rw
|
|
|
+ on rw.warehouse_id = tlr.loading_id
|
|
|
+ left join rms_truck_calculate rtc2
|
|
|
+ on rtc2.truck_calculate_id = twr.result_gross_place_id
|
|
|
+ left join tmstruck_unload_result tur
|
|
|
+ on tur.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_warehouse rw2
|
|
|
+ on rw2.warehouse_id = tur.result_unload_place_id
|
|
|
+ LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT TLFR1
|
|
|
+ ON TLFR1.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ where
|
|
|
+ twr.result_net_weight IS NOT NULL
|
|
|
+ AND oo.ORDER_TYPE in (23,24)
|
|
|
+ <if test="orgCode!=null">
|
|
|
+ and oo.OPTIONER_CODE = #{orgCode}
|
|
|
+ </if>
|
|
|
+ <if test="index!=null">
|
|
|
+ and ( (instr(rs.supplier_name, #{index}) > 0) or (instr(rm.material_name , #{index}) > 0)
|
|
|
+ or (instr(rc.capacity_number , #{index}) > 0) or (instr(rce.consignee_company_name , #{index}) > 0)
|
|
|
+ or (instr( RC.CARRIER_NAME , #{index}) > 0) or (instr(RL.LINE_NAME , #{index}) > 0))
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ )
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|