|
|
|
|
@ -235,4 +235,108 @@ |
|
|
|
|
-- oem |
|
|
|
|
ORDER BY t.ID DESC |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryWorkOrder" |
|
|
|
|
resultType="org.springblade.desk.quality.pojo.vo.InspectionTaskListVO"> |
|
|
|
|
SELECT |
|
|
|
|
wo.*, |
|
|
|
|
-- 完工时间:仅当运行状态为15时取更新时间,否则为null |
|
|
|
|
CASE WHEN wo.RUN_STATUS = 15 THEN wo.update_time ELSE null END AS finishDate, |
|
|
|
|
yo.id AS yoId, |
|
|
|
|
ts.TS_NAME AS mainProcessingUnit, |
|
|
|
|
yo.USE_DEPT AS needDeptName, |
|
|
|
|
wo.batch_no AS batchNo, |
|
|
|
|
wo.batch_no AS poBatchNo, |
|
|
|
|
ps.NAME AS currentProcessName, |
|
|
|
|
yo.PRODUCT_IDENT AS prodIdent, |
|
|
|
|
yo.YP_AREA * wo.MAKE_QTY AS areaTotal, |
|
|
|
|
yo.YP_AREA AS area, |
|
|
|
|
wo.MAKE_QTY AS poQty, |
|
|
|
|
wo.WO_CODE AS woCode, |
|
|
|
|
wo.PART_CODE AS partCode, |
|
|
|
|
wo.CARD_NO AS cardNo |
|
|
|
|
FROM MES_WORK_ORDER wo |
|
|
|
|
-- 车间作业计划 wp |
|
|
|
|
LEFT JOIN MES_WORK_PLAN wp ON wp.WO_ID = wo.ID |
|
|
|
|
-- 生产订单 yo |
|
|
|
|
LEFT JOIN MES_YIELD_ORDER yo ON wo.YO_ID = yo.ID |
|
|
|
|
-- 工序 |
|
|
|
|
LEFT JOIN BS_PROCESS_SET ps ON wp.ORDERS = ps.CODE |
|
|
|
|
-- 外协厂商 oem |
|
|
|
|
LEFT JOIN BS_OEM oem ON wp.OC_ID = oem.ID |
|
|
|
|
-- 班组 ts |
|
|
|
|
LEFT JOIN BS_TEAM_SET ts ON wp.MAKE_TEAM = ts.ID |
|
|
|
|
WHERE |
|
|
|
|
wo.IS_DELETED = 0 |
|
|
|
|
<if test="q.wpId != null"> |
|
|
|
|
AND t.WP_ID = #{q.wpId} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.status != null"> |
|
|
|
|
AND t.STATUS = #{q.status} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.fromType != null"> |
|
|
|
|
AND t.FROM_TYPE = #{q.fromType} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.receiveDateStart != null"> |
|
|
|
|
AND rs.RECEIVE_DATE >= #{q.receiveDateStart} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.receiveDateStart != null"> |
|
|
|
|
AND rs.RECEIVE_DATE <= #{q.receiveDateEnd} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.teamSetId != null"> |
|
|
|
|
AND wo.MAKE_TEAM = #{q.teamSetId} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.oemId != null"> |
|
|
|
|
AND wp.OC_ID = #{q.oemId} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.frontProcessId != null"> |
|
|
|
|
AND wp.FRONT_WP_ID = #{q.frontProcessId} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.nextProcessId != null"> |
|
|
|
|
AND wp.NEXT_WP_ID = #{q.nextProcessId} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.cardNo != null and q.cardNo != ''"> |
|
|
|
|
AND wo.CARD_NO = #{q.cardNo} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.woCode != null"> |
|
|
|
|
AND wo.WO_CODE = #{q.woCode} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.partCode != null and q.partCode != ''"> |
|
|
|
|
AND wo.PART_CODE = #{q.partCode} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.batchNo != null and q.batchNo != ''"> |
|
|
|
|
AND wo.BATCH_NO = #{q.batchNo} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.poQty != null"> |
|
|
|
|
AND wo.MAKE_QTY = #{q.poQty} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.prodIdent != null and q.prodIdent != ''"> |
|
|
|
|
AND yo.PRODUCT_IDENT = #{q.prodIdent} |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="q.cardNo != null and q.cardNo != ''"> |
|
|
|
|
AND wo.CARD_NO = #{cardNo} |
|
|
|
|
</if> |
|
|
|
|
<if test="q.currentProcessId != null"> |
|
|
|
|
AND ps.ID = #{q.currentProcessId} |
|
|
|
|
</if> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="correspondingProcess" |
|
|
|
|
resultType="org.springblade.desk.quality.pojo.vo.InspectionTaskListVO"> |
|
|
|
|
SELECT |
|
|
|
|
ps.NAME AS ppsName, |
|
|
|
|
ps.ID AS ppsId, |
|
|
|
|
ps.CODE AS ppsCode |
|
|
|
|
FROM MES_WORK_ORDER wo |
|
|
|
|
-- 车间作业计划 wp |
|
|
|
|
LEFT JOIN MES_WORK_PLAN wp ON wp.WO_ID = wo.ID |
|
|
|
|
-- 工序 |
|
|
|
|
LEFT JOIN BS_PROCESS_SET ps ON wp.ORDERS = ps.CODE |
|
|
|
|
WHERE |
|
|
|
|
wo.IS_DELETED = 0 and wo.id = #{woId} |
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
|
|