看板接口sql修改

master
zhaoxiaolin 6 months ago
parent 90d1e52de8
commit df6d74daca

@ -362,22 +362,24 @@
group by check_result group by check_result
</select> </select>
<select id="getPorOrderList" resultType="com.op.mes.domain.ProOrderWorkorder"> <select id="getPorOrderList" resultType="com.op.mes.domain.ProOrderWorkorder">
select t0.*,t.quantityFeedback from
(
select pow.workorder_code_sap workorderCodeSap, select pow.workorder_code_sap workorderCodeSap,
pow.product_name productName, pow.product_name productName,
powb.batch_code batchCode, powb.batch_code batchCode,
powb.batch_quantity quantitySplit, powb.batch_quantity quantitySplit
t.quantityFeedback quantityProduced
from pro_order_workorder pow from pro_order_workorder pow
left join pro_order_workorder_batch powb on powb.workorder_id = pow.workorder_id left join pro_order_workorder_batch powb on powb.workorder_id = pow.workorder_id
where pow.del_flag = '0' and CONVERT(varchar(10),pow.product_date, 120) = CONVERT(varchar(10),GETDATE(), 120)
and pow.workorder_name = #{equCode} and pow.parent_order ='0' and powb.del_flag = '0'
) t0
left join ( left join (
select workorder_code,batch,sum(quantity_feedback) quantityFeedback from mes_report_work select workorder_code,batch,sum(quantity_feedback) quantityFeedback from mes_report_work
where CONVERT(varchar(10),feedback_time, 120) = CONVERT(varchar(10),GETDATE(), 120) where CONVERT(varchar(10),feedback_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
and del_flag = '0' and del_flag = '0'
group by workorder_code,batch group by workorder_code,batch
)t on pow.workorder_code = t.workorder_code and powb.batch_code = t.batch )t on t0.workorderCodeSap = t.workorder_code and t0.batchCode = t.batch
where pow.del_flag = '0' and CONVERT(varchar(10),pow.product_date, 120) = CONVERT(varchar(10),GETDATE(), 120) order by t0.batchCode
and pow.workorder_name = #{equCode} and pow.parent_order ='0' and powb.del_flag = '0'
order by powb.batch_code
</select> </select>
<select id="getHFProInfo" resultType="com.op.system.api.domain.dto.BoardDTO"> <select id="getHFProInfo" resultType="com.op.system.api.domain.dto.BoardDTO">
select t.*,isnull(be.unit_working_hours,0) unitPro from select t.*,isnull(be.unit_working_hours,0) unitPro from

Loading…
Cancel
Save