|
@@ -5523,4 +5523,377 @@
|
|
</if>
|
|
</if>
|
|
) T6 ON T1 ."target" = T6."target" AND T1."carrierName" = T6."carrierName"
|
|
) T6 ON T1 ."target" = T6."target" AND T1."carrierName" = T6."carrierName"
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getAllSaleReportByLb" resultType="java.util.Map" parameterType="map">
|
|
|
|
+ select
|
|
|
|
+ *
|
|
|
|
+ from (
|
|
|
|
+ select DISTINCT OO.ORDER_NUMBER "orderNumber",
|
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
|
+ TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
|
|
|
|
+ TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
|
|
|
|
+ TWR.RESULT_TARE_WEIGHT "resultTareWeight",
|
|
|
|
+ TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
|
|
|
|
+ RW.WAREHOUSE_NAME "warehouseName",
|
|
|
|
+ TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
|
|
|
|
+ TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
|
|
|
|
+ TWR.RESULT_NET_WEIGHT "resultNetWeight",
|
|
|
|
+ TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
|
|
|
|
+ RTCMAO.TRUCK_CALCULATE_NUMBER "maoCalculate",
|
|
|
|
+ RTCPI.TRUCK_CALCULATE_NUMBER "piCalculate",
|
|
|
|
+ RGEN.GATEPOST_NAME "enGatepostName",
|
|
|
|
+ RGOUT.GATEPOST_NAME "outGatepostName",
|
|
|
|
+ RCON.CONSIGNEE_COMPANY_NAME "receiveName",
|
|
|
|
+ RS.SUPPLIER_NAME "sendName",
|
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
|
+ TLR.INSERT_UPDATE_REMARK "materialRemark",
|
|
|
|
+ ASO.SALE_NUMBER "saleNumber",
|
|
|
|
+ ASO.SALE_REMARK "saleRemark",
|
|
|
|
+ ASM.SALE_WAREHOUSE "saleWarehouse",
|
|
|
|
+ ASM.MATERIAL_NUMBER "materialNum",
|
|
|
|
+ ASM.MATERIAL_WEIGHT "materialWeight",
|
|
|
|
+ TLR.CASE_NUMBER "caseNumber",
|
|
|
|
+ TLR.CAPACITY_REMARK "capacityRemark",
|
|
|
|
+ RC2.CARRIER_NAME "carrierName",
|
|
|
|
+ TAR.RESULT_ARRIVAL_ADDRESS "arrivalAddress",
|
|
|
|
+ TRR.RESULT_ARRIVAL_ADDRESS "receiptAddress",
|
|
|
|
+ TAR.INSERT_TIME "arrivalTime",
|
|
|
|
+ TRR.INSERT_TIME "receiptTime",
|
|
|
|
+ TAR.RESULT_FULL_CONTAINER_PHOTO "arrivalPhoto",
|
|
|
|
+ TRR.RESULT_EMPTY_CONTAINER_PHOTO "receiptPhoto",
|
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "materialCode",
|
|
|
|
+ RM.MATERIAL_NAME || TLR.INSERT_UPDATE_REMARK "likeRemark",
|
|
|
|
+ ASM.SALE_WAREHOUSE || RW.WAREHOUSE_NAME "wareHouse",
|
|
|
|
+ TLR.RESULT_ID "resultId",
|
|
|
|
+ TLR.MATERIAL_ID "materialId",
|
|
|
|
+ OO.ORDER_ID "orderId",
|
|
|
|
+ CASE
|
|
|
|
+ WHEN TER.RESULT_ENTRY_GATE_TIME IS NULL
|
|
|
|
+ THEN '未进厂'
|
|
|
|
+ when TLFR.RESULT_OUT_GATE_TIME IS NULL
|
|
|
|
+ THEN '已进厂'
|
|
|
|
+ when TAR.RESULT_ARRIVAL_ADDRESS IS NULL
|
|
|
|
+ THEN '已出厂'
|
|
|
|
+ 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
|
|
|
|
+ WHERE OO.ORDER_TYPE = #{orderTypee}
|
|
|
|
+ AND ASO.SHIPPER_ID = #{shipperId}
|
|
|
|
+ AND OO.ORDER_STATUS IN (2,4,5)
|
|
|
|
+ <if test="orderTypee!=null and orderTypee==1">
|
|
|
|
+ AND ASM.MATERIAL_NUMBER IS NOT NULL
|
|
|
|
+ </if>
|
|
|
|
+ <if test="carrierSsoId != null">
|
|
|
|
+ and RC2.CARRIER_SSO_ID = #{carrierSsoId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="receivName != null and receivName != ''">
|
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME like Concat('%',Concat(#{receivName},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remarkOne != null and remarkOne != '' and remarkOne !='null' ">
|
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL || RC2.CARRIER_NAME
|
|
|
|
+ || RC.CAPACITY_NUMBER like Concat('%',Concat(#{remarkOne},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remarkTwo != null and remarkTwo != '' and remarkTwo !='null'">
|
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL || RC2.CARRIER_NAME
|
|
|
|
+ || RC.CAPACITY_NUMBER like Concat('%',Concat(#{remarkTwo},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remarkThree != null and remarkThree != '' and remarkThree !='null'">
|
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL || RC2.CARRIER_NAME
|
|
|
|
+ || RC.CAPACITY_NUMBER like Concat('%',Concat(#{remarkThree},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="oneDate != null and orderTypee == 1 and isEnFactoryFlag == 0">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= OO.ORDER_ISSUE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null and orderTypee == 1 and isEnFactoryFlag == 0">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= OO.ORDER_ISSUE_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OO.ORDER_ISSUE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="oneDate != null and orderTypee == 1 and isEnFactoryFlag == 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 isEnFactoryFlag == 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 isEnFactoryFlag == 0">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= OO.ORDER_ISSUE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null and orderTypee != 1 and isEnFactoryFlag == 0">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= OO.ORDER_ISSUE_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OO.ORDER_ISSUE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="oneDate != null and orderTypee != 1 and isEnFactoryFlag == 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 isEnFactoryFlag == 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>
|
|
|
|
+ )
|
|
|
|
+ <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>
|
|
|
|
+ <include refid="orderBy"></include>
|
|
|
|
+ <if test="orderField == null">
|
|
|
|
+ order by "resultOutGateTime" desc, "resultEntryGateTime" desc
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getPreMap" resultType="java.util.Map" parameterType="map">
|
|
|
|
+ select
|
|
|
|
+ *
|
|
|
|
+ from (
|
|
|
|
+ SELECT
|
|
|
|
+ sum(
|
|
|
|
+ CASE WHEN
|
|
|
|
+ TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
|
|
|
|
+ THEN 1
|
|
|
|
+ ELSE 0
|
|
|
|
+ END
|
|
|
|
+ ) "enFactoryNumber",
|
|
|
|
+ sum(
|
|
|
|
+ CASE WHEN
|
|
|
|
+ TWR.RESULT_GROSS_WEIGHT_TIME IS NOT NULL
|
|
|
|
+ THEN 1
|
|
|
|
+ ELSE 0
|
|
|
|
+ END
|
|
|
|
+ ) "grossNumber",
|
|
|
|
+ SUM(TWR.RESULT_NET_WEIGHT) "totalNumber"
|
|
|
|
+ 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
|
|
|
|
+ WHERE OO.ORDER_TYPE = #{orderTypee}
|
|
|
|
+ AND ASO.SHIPPER_ID = #{shipperId}
|
|
|
|
+ AND OO.ORDER_STATUS IN (2,4,5)
|
|
|
|
+ <if test="orderTypee!=null and orderTypee==1">
|
|
|
|
+ AND ASM.MATERIAL_NUMBER IS NOT NULL
|
|
|
|
+ </if>
|
|
|
|
+ <if test="carrierSsoId != null">
|
|
|
|
+ and RC2.CARRIER_SSO_ID = #{carrierSsoId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="receivName != null and receivName != ''">
|
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME like Concat('%',Concat(#{receivName},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remarkOne != null and remarkOne != '' and remarkOne !='null' ">
|
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL || RC2.CARRIER_NAME
|
|
|
|
+ || RC.CAPACITY_NUMBER like Concat('%',Concat(#{remarkOne},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remarkTwo != null and remarkTwo != '' and remarkTwo !='null'">
|
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL || RC2.CARRIER_NAME
|
|
|
|
+ || RC.CAPACITY_NUMBER like Concat('%',Concat(#{remarkTwo},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remarkThree != null and remarkThree != '' and remarkThree !='null'">
|
|
|
|
+ and RCON.CONSIGNEE_COMPANY_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL || RC2.CARRIER_NAME
|
|
|
|
+ || RC.CAPACITY_NUMBER like Concat('%',Concat(#{remarkThree},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="oneDate != null and orderTypee == 1 and isEnFactoryFlag == 0">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= OO.ORDER_ISSUE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null and orderTypee == 1 and isEnFactoryFlag == 0">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= OO.ORDER_ISSUE_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OO.ORDER_ISSUE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="oneDate != null and orderTypee == 1 and isEnFactoryFlag == 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 isEnFactoryFlag == 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 isEnFactoryFlag == 0">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= OO.ORDER_ISSUE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null and orderTypee != 1 and isEnFactoryFlag == 0">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= OO.ORDER_ISSUE_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OO.ORDER_ISSUE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="oneDate != null and orderTypee != 1 and isEnFactoryFlag == 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 isEnFactoryFlag == 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>
|
|
|
|
+ )
|
|
|
|
+ <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>
|
|
</mapper>
|