|
@@ -1760,8 +1760,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>
|
|
@@ -1890,5 +1890,82 @@
|
|
|
)
|
|
|
</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"
|
|
|
+ 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 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>
|