|
@@ -717,13 +717,171 @@
|
|
|
order by "resultOutGateTime" desc, "resultEntryGateTime" desc
|
|
|
</if>
|
|
|
</select>
|
|
|
- <select id="getTotalResultList" resultType="java.util.Map">
|
|
|
+ <select id="getTotalResultList" resultType="java.util.LinkedHashMap">
|
|
|
SELECT DISTINCT
|
|
|
TTR.RESULT_TOTAL_ID "totalId"
|
|
|
FROM
|
|
|
TMSTRUCK_TOTAL_RESULT TTR
|
|
|
- LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
|
|
|
WHERE
|
|
|
OO.ORDER_TYPE = 10
|
|
|
+ order by TTR.RESULT_TOTAL_ID desc
|
|
|
+ </select>
|
|
|
+ <select id="getInwardReportResult" resultType="java.util.LinkedHashMap">
|
|
|
+ select * from (select oo.order_id "orderId",
|
|
|
+ rm.material_name "materialName",
|
|
|
+ apo.purchase_order_no "purchaseNo",
|
|
|
+ rc.capacity_number "capacityNo",
|
|
|
+ rs.supplier_name "supplierName",
|
|
|
+ oo.order_number "orderNumber",
|
|
|
+ rce.consignee_company_name "consigneeName",
|
|
|
+ ttr.result_total_id "totalResultId",
|
|
|
+ ter1.result_entry_mode "entryModeFirst",
|
|
|
+ ter1.result_entry_gate_time "entryGateTimeFirst",
|
|
|
+ rg1.gatepost_name "entryGatepostNameFirst",
|
|
|
+ twr1.result_tare_weight "tareWeightFirst",
|
|
|
+ twr1.result_tare_weight_time "tareWeightTimeFirst",
|
|
|
+ rtc1.truck_calculate_number "tareTruckCalculateFirst",
|
|
|
+ tlr.result_load_end_time "loadTime",
|
|
|
+ rw.warehouse_name "loadPoint",
|
|
|
+ twr2.result_gross_weight "grossWeightFirst",
|
|
|
+ twr2.result_gross_weight_time "grossWeigtTimeFirst",
|
|
|
+ rtc2.truck_calculate_number "grossTruckCalculateFirst",
|
|
|
+ twr2.result_net_weight "netWeightFirst",
|
|
|
+ tlfr1.result_out_gate_time "outGatepostTimeFirst",
|
|
|
+ tlfr1.result_out_mode "outModeFirst",
|
|
|
+ rg2.gatepost_name "gatepostNameFirst",
|
|
|
+ ter2.result_entry_mode "entryModeSecond",
|
|
|
+ ter2.result_entry_gate_time "resultEntryGateTime",
|
|
|
+ ter2.result_entry_gate_time "entryGateTimeSecond",
|
|
|
+ rg3.gatepost_name "entryGatepostNameSecond",
|
|
|
+ twr3.result_gross_weight "grossWeightSecond",
|
|
|
+ twr3.result_gross_weight_time "grossWeigtTimeSecond",
|
|
|
+ rtc3.truck_calculate_number "grossTruckCalculateSecond",
|
|
|
+ tur.result_end_time "unloadTime",
|
|
|
+ rw2.warehouse_name "unloadPoint",
|
|
|
+ twr4.result_tare_weight "tareWeightSecond",
|
|
|
+ twr4.result_tare_weight_time "tareWeightTimeSecond",
|
|
|
+ twr4.result_net_weight "netWeightSecond",
|
|
|
+ rtc4.truck_calculate_number "tareTruckCalculateSecond",
|
|
|
+ tlfr2.result_out_gate_time "outGatepostTimeSecond",
|
|
|
+ tlfr2.result_out_gate_time "resultOutGateTime",
|
|
|
+ tlfr2.result_out_mode "outModeSecond",
|
|
|
+ rg4.gatepost_name "gatepostNameSecond"
|
|
|
+ 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 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 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_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_enfactory_result ter1
|
|
|
+ on ter1.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_gatepost rg1
|
|
|
+ on rg1.gatepost_id = ter1.gatepost_id
|
|
|
+ left join tmstruck_weight_result twr1
|
|
|
+ on twr1.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_truck_calculate rtc1
|
|
|
+ on rtc1.truck_calculate_id = twr1.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 tmstruck_weight_result twr2
|
|
|
+ on twr2.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_truck_calculate rtc2
|
|
|
+ on rtc2.truck_calculate_id = twr2.result_gross_place_id
|
|
|
+ left join tmstruck_leave_factory_result tlfr1
|
|
|
+ on tlfr1.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_gatepost rg2
|
|
|
+ on tlfr1.gatepost_id = rg2.gatepost_id
|
|
|
+ left join tmstruck_enfactory_result ter2
|
|
|
+ on ter2.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_gatepost rg3
|
|
|
+ on rg3.gatepost_id = ter2.gatepost_id
|
|
|
+ left join tmstruck_weight_result twr3
|
|
|
+ on twr3.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_truck_calculate rtc3
|
|
|
+ on rtc3.truck_calculate_id = twr3.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_weight_result twr4
|
|
|
+ on twr4.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_truck_calculate rtc4
|
|
|
+ on rtc4.truck_calculate_id = twr4.result_tare_place_id
|
|
|
+ left join tmstruck_leave_factory_result tlfr2
|
|
|
+ on tlfr2.result_total_id = ttr.result_total_id
|
|
|
+ left join rms_gatepost rg4
|
|
|
+ on tlfr2.gatepost_id = rg4.gatepost_id
|
|
|
+ where oo.order_type = 10
|
|
|
+ and ter1.segmen_sqe = 1
|
|
|
+ and twr1.tare_segment_sqe = 2
|
|
|
+ and tlr.segment_sqe = 3
|
|
|
+ and twr2.gross_segment_sqe = 4
|
|
|
+ and tlfr1.segment_sqe = 5
|
|
|
+ and ter2.segmen_sqe = 6
|
|
|
+ and twr3.gross_segment_sqe = 7
|
|
|
+ and tur.segment_sqe = 8
|
|
|
+ and twr4.tare_segment_sqe = 9
|
|
|
+ and tlfr2.segment_sqe = 10
|
|
|
+ and twr2.result_gross_weight_time is not null
|
|
|
+ <if test="oneDate != null">
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR4.RESULT_TARE_WEIGHT_TIME
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR4.RESULT_TARE_WEIGHT_TIME
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR4.RESULT_TARE_WEIGHT_TIME
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="consigneeName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeName" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="supplierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "supplierName" 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="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNo != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where><include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null">
|
|
|
+ order by "outGatepostTimeFirst" desc, "entryGateTimeFirst" desc
|
|
|
+ </if>
|
|
|
</select>
|
|
|
</mapper>
|