@ -802,12 +802,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pow.workorder_code workorderCode,
pow.workorder_name workorderName,
bp.umrez spec,
bp.report_rate reportRate
bp.report_rate reportRate,
COALESCE(bpa.category, '蚊香') AS category,
mrw.reason AS reason,
mrw.useManRemark AS useManRemark
from base_equipment be
left join pro_order_workorder pow on be.equipment_code = pow.workorder_name
LEFT JOIN base_shifts_t bst ON bst.Shift_Id=pow.shift_id
left join mes_line_product mlp on pow.workorder_name = mlp.line_code and pow.product_code = mlp.product_code and mlp.del_flag='0'
left join base_product bp on bp.product_code = pow.product_code
LEFT JOIN (SELECT MIN(id) AS min_id,product_code,category FROM base_product_attached GROUP BY product_code,category) bpa ON RIGHT(pow.product_code, 11) = bpa.product_code
LEFT JOIN (SELECT
remark AS reason,
use_man_remark AS useManRemark,
workorder_code
FROM
mes_report_work
WHERE
del_flag = '0'
AND Reason IS NOT NULL
AND use_man_remark IS NOT NULL
AND reason != '无'
GROUP BY
use_man_remark,
remark,workorder_code) mrw ON mrw.workorder_code = pow.workorder_code
where be.del_flag = '0' and be.sap_code is not null and pow.status in ('w2','w3')
and pow.parent_order = '0' and pow.del_flag='0'
<iftest="sapName != null and sapName != ''">and be.equipment_name like concat('%', #{sapName}, '%')</if>
@ -1775,7 +1793,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"