|
|
|
@ -20,6 +20,7 @@ |
|
|
|
<result column="approval_time" property="approvalTime"/> |
|
|
|
<result column="approval_time" property="approvalTime"/> |
|
|
|
<result column="batch_reason" property="batchReason"/> |
|
|
|
<result column="batch_reason" property="batchReason"/> |
|
|
|
<result column="oem_status" property="oemStatus"/> |
|
|
|
<result column="oem_status" property="oemStatus"/> |
|
|
|
|
|
|
|
<result column="oem_status_title" property="oemStatusTitle"/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- OemOrderVO自身字段 --> |
|
|
|
<!-- OemOrderVO自身字段 --> |
|
|
|
<result column="memo" property="memo"/> |
|
|
|
<result column="memo" property="memo"/> |
|
|
|
@ -103,12 +104,18 @@ |
|
|
|
-- planner_user.real_name as planner_name, |
|
|
|
-- planner_user.real_name as planner_name, |
|
|
|
-- 调度员名称 |
|
|
|
-- 调度员名称 |
|
|
|
tyo.plan_user as planner_name, |
|
|
|
tyo.plan_user as planner_name, |
|
|
|
dispatcher_user.real_name as dispatcher_name |
|
|
|
dispatcher_user.real_name as dispatcher_name, |
|
|
|
|
|
|
|
case |
|
|
|
|
|
|
|
when two.run_status = 17 then '已交接' |
|
|
|
|
|
|
|
when two.run_status = 15 then '订单完工' |
|
|
|
|
|
|
|
when mwor.oem_status = 3 then '外协完工' |
|
|
|
|
|
|
|
when mwor.oem_status = 2 then '外协中' |
|
|
|
|
|
|
|
else '未知' end AS oem_status_title |
|
|
|
FROM MES_WORK_ORDER_RUN mwor |
|
|
|
FROM MES_WORK_ORDER_RUN mwor |
|
|
|
-- 关联车间订单表 |
|
|
|
-- 关联车间订单表 |
|
|
|
LEFT JOIN MES_WORK_ORDER two ON mwor.wo_id = two.id |
|
|
|
INNER JOIN MES_WORK_ORDER two ON mwor.wo_id = two.id |
|
|
|
-- 关联生产订单表 |
|
|
|
-- 关联生产订单表 |
|
|
|
LEFT JOIN MES_YIELD_ORDER tyo ON two.yo_id = tyo.id |
|
|
|
INNER JOIN MES_YIELD_ORDER tyo ON two.yo_id = tyo.id |
|
|
|
-- 关联转出班组(只取名称) |
|
|
|
-- 关联转出班组(只取名称) |
|
|
|
LEFT JOIN BS_TEAM_SET out_team ON mwor.out_team = out_team.id |
|
|
|
LEFT JOIN BS_TEAM_SET out_team ON mwor.out_team = out_team.id |
|
|
|
-- 关联转入班组(只取名称) |
|
|
|
-- 关联转入班组(只取名称) |
|
|
|
@ -119,7 +126,7 @@ |
|
|
|
-- LEFT JOIN blade_user planner_user ON two.planner = planner_user.id |
|
|
|
-- LEFT JOIN blade_user planner_user ON two.planner = planner_user.id |
|
|
|
-- 关联调度员 |
|
|
|
-- 关联调度员 |
|
|
|
LEFT JOIN blade_user dispatcher_user ON two.dispatcher = dispatcher_user.id |
|
|
|
LEFT JOIN blade_user dispatcher_user ON two.dispatcher = dispatcher_user.id |
|
|
|
--关联外协厂商 |
|
|
|
-- 关联外协厂商 |
|
|
|
LEFT JOIN BS_OEM oem ON mwor.in_customer = oem.id |
|
|
|
LEFT JOIN BS_OEM oem ON mwor.in_customer = oem.id |
|
|
|
|
|
|
|
|
|
|
|
where |
|
|
|
where |
|
|
|
@ -189,25 +196,22 @@ |
|
|
|
<if test="query.demandDateEnd != null"> |
|
|
|
<if test="query.demandDateEnd != null"> |
|
|
|
AND two.demand_date < #{query.demandDateEnd}+ 1 |
|
|
|
AND two.demand_date < #{query.demandDateEnd}+ 1 |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="query.oemStatusList != null and query.oemStatusList != ''"> |
|
|
|
<if test="query.oemStatus != null and query.oemStatus != ''"> |
|
|
|
AND mwor.oem_status IN |
|
|
|
<choose> |
|
|
|
<foreach collection="query.oemStatusList.split(',')" item="status" |
|
|
|
<when test='query.oemStatus == "1"'> |
|
|
|
open="(" separator="," close=")" index="index"> |
|
|
|
AND mwor.oem_status = 2 |
|
|
|
#{status} |
|
|
|
</when> |
|
|
|
</foreach> |
|
|
|
<when test='query.oemStatus == "2"'> |
|
|
|
|
|
|
|
AND mwor.oem_status = 3 |
|
|
|
|
|
|
|
</when> |
|
|
|
|
|
|
|
<when test='query.oemStatus == "3"'> |
|
|
|
|
|
|
|
AND two.run_status = 15 |
|
|
|
|
|
|
|
</when> |
|
|
|
|
|
|
|
<otherwise> |
|
|
|
|
|
|
|
AND two.run_status = 17 |
|
|
|
|
|
|
|
</otherwise> |
|
|
|
|
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<choose> |
|
|
|
|
|
|
|
<when test='query.orderStatus != null and query.orderStatus != ""'> |
|
|
|
|
|
|
|
AND two.run_status IN |
|
|
|
|
|
|
|
<foreach collection="query.orderStatus.split(',')" item="status" |
|
|
|
|
|
|
|
open="(" separator="," close=")" index="index"> |
|
|
|
|
|
|
|
#{status} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</when> |
|
|
|
|
|
|
|
<otherwise> |
|
|
|
|
|
|
|
AND two.run_status < 15 |
|
|
|
|
|
|
|
</otherwise> |
|
|
|
|
|
|
|
</choose> |
|
|
|
|
|
|
|
ORDER BY mwor.create_time DESC |
|
|
|
ORDER BY mwor.create_time DESC |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|