|
@@ -5576,53 +5576,30 @@
|
|
|
WHEN TRR.RESULT_ARRIVAL_ADDRESS IS NULL
|
|
|
THEN '已抵达'
|
|
|
ELSE '已签收' END "transportStatus"
|
|
|
- from TMSTRUCK_WEIGHT_RESULT TWR
|
|
|
- left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
- on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
- left join OMSTRUCK_ORDER OO
|
|
|
- on TTR.ORDER_ID = OO.ORDER_ID
|
|
|
- left join AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
- on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
|
|
|
- left join AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
- on ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
- left join RMS_MATERIAL RM
|
|
|
- on RM.MATERIAL_ID = TWR.MATERIAL_ID
|
|
|
- left join AMS_SALE_MATERIAL ASM
|
|
|
- on ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID AND ASM.MATERIAL_ID=RM.MATERIAL_ID
|
|
|
- -- left join RMS_MATERIAL RM
|
|
|
- -- on ASM.MATERIAL_ID = RM.MATERIAL_ID
|
|
|
- left join AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
- on ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
- left join RMS_CARRIER RC2
|
|
|
- on RC2.CARRIER_ID = ADSO.CARRIER_ID
|
|
|
- left join AMS_SALE_ORDER ASO
|
|
|
- on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
|
- left join RMS_CONSIGNEE RCON
|
|
|
- on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
|
|
|
- left join RMS_SUPPLIER RS
|
|
|
- on RS.SUPPLIER_ID = ASO.SHIPPER_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 RTCMAO
|
|
|
- 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
|
|
|
- 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
|
|
|
- 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
|
|
|
- left join RMS_CAPACITY RC
|
|
|
- on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
- left join TMSTRUCK_ARRIVAL_RESULT TAR
|
|
|
- on TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
- left join TMStRUCK_RECEIPT_RESULT TRR
|
|
|
- on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
|
|
|
+ from AMS_SALE_ORDER ASO
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
|
+ LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_MATERIAL ASM ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASM.MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER OO ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN TMSTRUCK_LOAD_RESULT TLR ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT TLFR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN TMSTRUCK_ARRIVAL_RESULT TAR ON TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN TMStRUCK_RECEIPT_RESULT TRR ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN RMS_TRUCK_CALCULATE RTCMAO 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
|
|
|
+ LEFT JOIN RMS_CARRIER RC2 ON RC2.CARRIER_ID = ADSO.CARRIER_ID
|
|
|
+ LEFT JOIN RMS_CONSIGNEE RCON ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
|
|
|
+ LEFT JOIN RMS_SUPPLIER RS ON RS.SUPPLIER_ID = ASO.SHIPPER_ID
|
|
|
+ LEFT JOIN RMS_WAREHOUSE RW ON RW.WAREHOUSE_ID = TLR.LOADING_ID
|
|
|
+ LEFT JOIN RMS_GATEPOST RGEN ON RGEN.GATEPOST_ID = TER.GATEPOST_ID
|
|
|
+ LEFT JOIN RMS_GATEPOST RGOUT ON RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
WHERE OO.ORDER_TYPE = #{orderTypee}
|
|
|
AND ASO.SHIPPER_ID = #{shipperId}
|
|
|
AND OO.ORDER_STATUS IN (2,4,5)
|
|
@@ -5686,41 +5663,26 @@
|
|
|
<if test="wareHouse != null and wareHouse != ''">
|
|
|
and "wareHouse" like Concat('%',Concat(#{wareHouse},'%'))
|
|
|
</if>
|
|
|
+ <if test="wareHouse != null and wareHouse != ''">
|
|
|
+ and "wareHouse" like Concat('%',Concat(#{wareHouse},'%'))
|
|
|
+ </if>
|
|
|
<if test="materialName != null">
|
|
|
- and
|
|
|
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
- "materialName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ and "materialName" like Concat('%',Concat(#{materialName},'%'))
|
|
|
</if>
|
|
|
<if test="receiveName != null">
|
|
|
- and
|
|
|
- <foreach collection="receiveName" item="item" open="(" separator="or" close=")">
|
|
|
- "receiveName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ and "receiveName" like Concat('%',Concat(#{receiveName},'%'))
|
|
|
</if>
|
|
|
<if test="sendName != null">
|
|
|
- and
|
|
|
- <foreach collection="sendName" item="item" open="(" separator="or" close=")">
|
|
|
- "sendName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ and "sendName" like Concat('%',Concat(#{sendName},'%'))
|
|
|
</if>
|
|
|
<if test="saleWarehouse != null">
|
|
|
- and
|
|
|
- <foreach collection="saleWarehouse" item="item" open="(" separator="or" close=")">
|
|
|
- "saleWarehouse" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="warehouseName != null">
|
|
|
- and
|
|
|
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
|
|
|
- "warehouseName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ and "saleWarehouse" like Concat('%',Concat(#{saleWarehouse},'%'))
|
|
|
</if>
|
|
|
<if test="saleRemark != null">
|
|
|
- and
|
|
|
- <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">
|
|
|
- "saleRemark" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ and "saleRemark" like Concat('%',Concat(#{saleRemark},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="transportStatus != null">
|
|
|
+ and "transportStatus" like Concat('%',Concat(#{transportStatus},'%'))
|
|
|
</if>
|
|
|
</where>
|
|
|
<include refid="orderBy"></include>
|
|
@@ -5847,53 +5809,33 @@
|
|
|
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="capacityNumber != null and capacityNumber != ''">
|
|
|
+ and RC.CAPACITY_NUMBER like Concat('%',Concat(#{capacityNumber},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ and RM.MATERIAL_NAME || TLR.INSERT_UPDATE_REMARK like Concat('%',Concat(#{remark},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="wareHouse != null and wareHouse != ''">
|
|
|
+ and RW.WAREHOUSE_NAME like Concat('%',Concat(#{wareHouse},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="materialName != null">
|
|
|
+ and RM.MATERIAL_NAME like Concat('%',Concat(#{materialName},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="receiveName != null">
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME like Concat('%',Concat(#{receiveName},'%'))
|
|
|
+
|
|
|
+ </if>
|
|
|
+ <if test="sendName != null">
|
|
|
+ and RS.SUPPLIER_NAME like Concat('%',Concat(#{sendName},'%'))
|
|
|
+
|
|
|
+ </if>
|
|
|
+ <if test="saleWarehouse != null">
|
|
|
+ and ASM.SALE_WAREHOUSE like Concat('%',Concat(#{saleWarehouse},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="saleRemark != null">
|
|
|
+ and ASO.SALE_REMARK like Concat('%',Concat(#{saleRemark},'%'))
|
|
|
+ </if>
|
|
|
+
|
|
|
)
|
|
|
- <where>
|
|
|
- <if test="capacityNumber != null and capacityNumber != ''">
|
|
|
- and "capacityNumber" like Concat('%',Concat(#{capacityNumber},'%'))
|
|
|
- </if>
|
|
|
- <if test="remark != null and remark != ''">
|
|
|
- and "likeRemark" like Concat('%',Concat(#{remark},'%'))
|
|
|
- </if>
|
|
|
- <if test="wareHouse != null and wareHouse != ''">
|
|
|
- and "wareHouse" like Concat('%',Concat(#{wareHouse},'%'))
|
|
|
- </if>
|
|
|
- <if test="materialName != null">
|
|
|
- and
|
|
|
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
- "materialName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="receiveName != null">
|
|
|
- and
|
|
|
- <foreach collection="receiveName" item="item" open="(" separator="or" close=")">
|
|
|
- "receiveName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sendName != null">
|
|
|
- and
|
|
|
- <foreach collection="sendName" item="item" open="(" separator="or" close=")">
|
|
|
- "sendName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="saleWarehouse != null">
|
|
|
- and
|
|
|
- <foreach collection="saleWarehouse" item="item" open="(" separator="or" close=")">
|
|
|
- "saleWarehouse" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="warehouseName != null">
|
|
|
- and
|
|
|
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
|
|
|
- "warehouseName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="saleRemark != null">
|
|
|
- and
|
|
|
- <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">
|
|
|
- "saleRemark" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
</select>
|
|
|
</mapper>
|