|
@@ -404,7 +404,7 @@
|
|
select
|
|
select
|
|
*
|
|
*
|
|
from (
|
|
from (
|
|
- select
|
|
|
|
|
|
+ select DISTINCT
|
|
APO.PURCHASE_ORDER_ID "purchaseOrderId",
|
|
APO.PURCHASE_ORDER_ID "purchaseOrderId",
|
|
APM.PURPLAN_PLAN_MATERIAL_ID "purplanPlanMaterialId",
|
|
APM.PURPLAN_PLAN_MATERIAL_ID "purplanPlanMaterialId",
|
|
APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
@@ -431,14 +431,130 @@
|
|
on RM.MATERIAL_ID = DB.MATERIAL_ID
|
|
on RM.MATERIAL_ID = DB.MATERIAL_ID
|
|
left join RMS_CARRIER RC
|
|
left join RMS_CARRIER RC
|
|
on AP.CARRIER_ID = RC.CARRIER_ID
|
|
on AP.CARRIER_ID = RC.CARRIER_ID
|
|
- <where>
|
|
|
|
|
|
+ where APM.MATERIAL_ALLOCATED_WEIGHT = AP.MATERIAL_TOTAL_WEIGHT
|
|
<if test="planId != null">
|
|
<if test="planId != null">
|
|
- AP.PLAN_ID = #{planId}
|
|
|
|
|
|
+ and AP.PLAN_ID = #{planId}
|
|
</if>
|
|
</if>
|
|
<if test="planStatus != null">
|
|
<if test="planStatus != null">
|
|
and AP.PLAN_STATUS = #{planStatus}
|
|
and AP.PLAN_STATUS = #{planStatus}
|
|
</if>
|
|
</if>
|
|
|
|
+ )
|
|
|
|
+ <where>
|
|
|
|
+ <if test="purplanPlanMaterialId != null">
|
|
|
|
+
|
|
|
|
+ <foreach collection="purplanPlanMaterialId" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "purplanPlanMaterialId" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="purchaseOrderNo != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "purchaseOrderNo" 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="materialName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="planNo != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="planNo" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "planNo" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="carrierName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "carrierName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialTotalWeight != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="materialTotalWeight" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialTotalWeight" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="planTruckTime != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="planTruckTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "planTruckTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="lineDesc != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="lineDesc" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "lineDesc" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="planIncomingTime" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "planIncomingTime" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialAllocatedWeight != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="materialAllocatedWeight" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialAllocatedWeight" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialUnallocatedWeight != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="materialUnallocatedWeight" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialUnallocatedWeight" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
|
|
+ <include refid="orderBy"></include>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!--查询分解计划 -->
|
|
|
|
+ <select id="getUnStartDecomposedPlan" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
|
+ select
|
|
|
|
+ *
|
|
|
|
+ from (
|
|
|
|
+ select DISTINCT
|
|
|
|
+ APO.PURCHASE_ORDER_ID "purchaseOrderId",
|
|
|
|
+ APM.PURPLAN_PLAN_MATERIAL_ID "purplanPlanMaterialId",
|
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
|
+ DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
|
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
|
+ AP.PLAN_NO "planNo",
|
|
|
|
+ RC.CARRIER_NAME "carrierName",
|
|
|
|
+ AP.MATERIAL_TOTAL_WEIGHT "materialTotalWeight",
|
|
|
|
+ APM.MATERIAL_ALLOCATED_WEIGHT "materialAllocatedWeight",
|
|
|
|
+ APM.MATERIAL_UNALLOCATED_WEIGHT "materialUnallocatedWeight",
|
|
|
|
+ to_char(AP.PLAN_TRUCK_TIME, 'yyyy-mm-dd') "planTruckTime",
|
|
|
|
+ RM.MATERIAL_ID "materialId",
|
|
|
|
+ to_char(AP.PLAN_INCOMING_TIME, 'yyyy-mm-dd') "planIncomingTime",
|
|
|
|
+ AP.PLAN_ID "planId",
|
|
|
|
+ AP.INSERT_TIME "insertTime"
|
|
|
|
+ from AMSTRUCK_PURPLAN AP
|
|
|
|
+ left join AMSTRUCK_PURPLAN_MATERIAL APM
|
|
|
|
+ on AP.PLAN_ID = APM.PLAN_ID
|
|
|
|
+ left join AMS_PURCHASE_ORDER APO
|
|
|
|
+ on AP.BATCH_ID = APO.BATCH_ID
|
|
|
|
+ left join DIL_BATCH DB
|
|
|
|
+ on AP.BATCH_ID = DB.BATCH_ID
|
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
|
+ on RM.MATERIAL_ID = DB.MATERIAL_ID
|
|
|
|
+ left join RMS_CARRIER RC
|
|
|
|
+ on AP.CARRIER_ID = RC.CARRIER_ID
|
|
|
|
+ where APM.MATERIAL_ALLOCATED_WEIGHT <![CDATA[<]]> AP.MATERIAL_TOTAL_WEIGHT
|
|
|
|
+ <if test="planId != null">
|
|
|
|
+ and AP.PLAN_ID = #{planId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="planStatus != null">
|
|
|
|
+ and AP.PLAN_STATUS = #{planStatus}
|
|
|
|
+ </if>
|
|
)
|
|
)
|
|
<where>
|
|
<where>
|
|
<if test="purplanPlanMaterialId != null">
|
|
<if test="purplanPlanMaterialId != null">
|