@ -93,28 +93,57 @@
WHERE mwp.WO_ID = #{woId}
ORDER BY mwp.ORDERS
</select>
<select id= "loadNotReceived" resultType= "org.springblade.desk.produce.pojo.entity.WorkPlan" >
SELECT a.* FROM mes_work_plan a
<select id= "loadNotReceived" resultType= "org.springblade.desk.produce.pojo.vo.WorkPlanLoadVO" >
SELECT
d.ROAM_NO_NEXT AS nextRoam,
d.YO_CODE AS yoCode,
d.YP_CODE AS ypCode,
d.PART_CODE AS partCode,
d.PRODUCT_TYPE AS productType,
d.PART_NAME AS partName,
d.PLATE AS plate,
d.PRODUCT_IDENT AS prodIdent,
d.USE_DEPT AS useDept,
d.YP_AREA AS poArea,
d.DEMAND_DATE AS demandDate,
d.PLAN_USER AS planUser,
d.RELEASE_DATE AS releaseDate,
d.PRIMARY_CRAFT AS primaryCraft,
c.CARD_NO AS cardNo,
c.BATCH_NO AS batchNo,
c.WO_CODE AS woCode,
a.QUALIFIED_QTY AS makeQty,
a.QUALIFIED_QTY - a.WORK_QTY - a.SCRAP_QTY AS notWorkQty,
a.WORK_QTY AS workQty,
a.SCRAP_QTY AS scrapQty,
c.PLAN_START_TIME AS planStartTime,
c.PLAN_END_TIME AS planEndTime,
c.INVENTORY_QTY AS inventoryQty,
c.MAKE_QTY - c.INVENTORY_QTY AS notInQty,
c.RUN_STATUS AS runStatus,
a.STATUS AS status,
c.PRIORITY AS priority,
c.PICKING_STATUS AS pickingStatus,
a.ORDERS || '|' || bps.NAME AS currentWpTitle,
bts.TS_NAME AS currentMakeTeam,
a.ID AS wpId,
a.ID AS currentWpId
FROM mes_work_plan a
INNER JOIN mes_WORK_ORDER c ON a.wo_id = c.ID
INNER JOIN mes_YIELD_ORDER d ON c.yo_id = d.ID
LEFT JOIN mes_work_plan b ON a.front_wp_id = b.ID
LEFT JOIN BS_PROCESS_SET bps ON a.PPS_ID = bps.ID
LEFT JOIN BS_TEAM_SET bts ON a.MAKE_TEAM = bts.ID
WHERE ((a.front_wp_id IS NULL AND a.status = 1) OR (b.status = 3))
AND a.make_team IN
AND (( a.make_team IN
<foreach collection= "tsIds" item= "tsId" open= "(" separator= "," close= ")" >
#{tsId}
</foreach>
AND a.subsidiary_team IS NULL AND c.run_status >= 2 AND c.run_status < 15 AND c.id = #{id}
UNION
SELECT a.* FROM mes_work_plan a
INNER JOIN mes_WORK_ORDER c ON a.wo_id = c.ID
INNER JOIN mes_YIELD_ORDER d ON c.yo_id = d.ID
LEFT JOIN mes_work_plan b ON a.front_wp_id = b.ID
WHERE ((a.front_wp_id IS NULL AND a.status = 1) OR (b.status = 3))
AND a.subsidiary_team IN
AND a.subsidiary_team IS NULL) OR a.subsidiary_team IN
<foreach collection= "tsIds" item= "tsId" open= "(" separator= "," close= ")" >
#{tsId}
</foreach>
AND c.run_status >= 2 AND c.run_status < 15 AND c.id = #{id}
) AND c.run_status >= 2 AND c.run_status < 15 AND c.id = #{id}
</select>
</mapper>