|
@@ -1292,5 +1292,142 @@
|
|
|
</where>
|
|
|
<include refid="orderByEnterTime"></include>
|
|
|
</select>
|
|
|
+ <select id="getCGNZEnFactory" resultType="java.util.Map" parameterType="map">
|
|
|
+ select TER.RESULT_ID "resultId",
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RG.GATEPOST_NAME "gatepostName",
|
|
|
+ TER.RESULT_ENTRY_MODE "resultEntryMode",
|
|
|
+ TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
|
|
|
+ RS.SUPPLIER_NAME "supplierName",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ TER.INSERT_TIME "insertTime",
|
|
|
+ RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
|
|
|
+ from TMSTRUCK_ENFACTORY_RESULT TER
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on TTR.ORDER_ID = OO.ORDER_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 DIL_BATCH DB
|
|
|
+ on DB.BATCH_ID = APO.BATCH_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ left join RMS_SUPPLIER RS
|
|
|
+ on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
|
|
|
+ left join RMS_CONSIGNEE RCON
|
|
|
+ on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
|
|
|
+ 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_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = TER.GATEPOST_ID
|
|
|
+ where TER.RESULT_ENTRY_GATE_TIME is not null
|
|
|
+ and OO.ORDER_TYPE = 10
|
|
|
+ <where>
|
|
|
+ <if test="purchaseOrderId != null">
|
|
|
+ <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
|
|
|
+ "purchaseOrderId" 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="resultForeignShipName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultForeignShipName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </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="warehouseName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
|
|
|
+ "warehouseName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultEntryMode != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultEntryMode" 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="orderMaterialWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderMaterialWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderByEnterTime"></include>
|
|
|
+ </select>
|
|
|
+ <select id="getCgNzOutFactory" resultType="java.util.Map">
|
|
|
+ select TLFR.RESULT_ID "resultId",
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RG.GATEPOST_NAME "gatepostName",
|
|
|
+ TLFR.RESULT_OUT_MODE "resultOutMode",
|
|
|
+ TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
|
|
|
+ TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
|
|
|
+ from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_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 = OO.ORDER_PLAN_ID
|
|
|
+ left join DIL_BATCH DB
|
|
|
+ on DB.BATCH_ID = APO.BATCH_ID
|
|
|
+ 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 RMS_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = TLFR.GATEPOST_ID
|
|
|
+ where RESULT_OUT_GATE_TIME is not null
|
|
|
+ and OO.ORDER_TYPE = 10
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|