| | |
| | | ifnull((rw.reviewed_state),1) as reviewed_state -- 下工序审核状态 |
| | | from sd.order as o |
| | | left join flow_card as fc on fc.order_id = o.order_id |
| | | left join (select if(count(reviewed_state)>0 and process_id=null,1,0) as reviewed_state , |
| | | process_id |
| | | from reporting_work |
| | | where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr}) as rw |
| | | left join (select reviewed_state as reviewed_state , |
| | | process_id,a.reporting_work_id |
| | | from reporting_work as a |
| | | left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id |
| | | where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr} and b.technology_number=#{technologyStr}) as rw |
| | | on rw.process_id = fc.process_id |
| | | left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id and rwd.technology_number=fc.technology_number |
| | | where fc.process_id = #{processIdStr} |
| | | and fc.technology_number = #{technologyStr} |
| | | GROUP BY fc.process_id |
| | |
| | | select ogd.process |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id = LEFT(#{processIdStr}, 11) |
| | | and ogd.technology_number=#{technologyStr} |
| | | limit 1 |
| | | |
| | | </select> |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num as quantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num as completedQuantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(patch.patch_num,0) as quantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(patch.patch_num,0) as completedQuantity, |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | od.other_columns |
| | | FROM |
| | | sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | and odpd.process_id = fc.process_id |
| | | left join ( |
| | | select ifnull(sum(a.patch_num),0) as patch_num,a.process_id,a.technology_number,a.order_sort |
| | | from patch_log as a |
| | | where a.process_id=#{processIdStr} |
| | | and a.technology_number = #{technologyStr} |
| | | and a.patch_processes = #{process} |
| | | and a.review_status = 1 |
| | | group by a.process_id,a.order_sort,a.technology_number |
| | | ) as patch |
| | | on patch.process_id = fc.process_id |
| | | and patch.order_sort = fc.order_number |
| | | and patch.technology_number = fc.technology_number |
| | | |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND fc.technology_number = #{technologyStr} |
| | |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | ogd.`group`, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | od.other_columns |
| | | |
| | | FROM |
| | | sd.order_detail AS od |
| | |
| | | ifnull(a.breakage_quantity,0) as 'breakageQuantity', -- 破损数 |
| | | ifnull(f.completed_quantity,0) as thisQuantitySum ,-- 本工序完工和 |
| | | if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag, |
| | | e.other_columns, |
| | | <if test="nextProcess != null and nextProcess != ''"> -- 非最后一道工序 |
| | | ifnull(g.completed_quantity,0) as nextQuantitySum, -- 后工序已完成 |
| | | if((f.completed_quantity |
| | |
| | | update reporting_work as rw left join damage_details as dd on rw.reporting_work_id = dd.reporting_work_id |
| | | set dd.quality_ins_status = 2, |
| | | rw.quality_inspector=#{username}, |
| | | rw.examine_time=NOW() |
| | | rw.quality_ins_time=NOW() |
| | | where rw.reporting_work_id = #{reportingWorkId} |
| | | </update> |
| | | |
| | |
| | | select REPLACE(GROUP_CONCAT(DISTINCT rwd.technology_number),',','') from reporting_work_detail as rwd |
| | | where rwd.reporting_work_id=#{reportingWorkId} |
| | | </select> |
| | | |
| | | <update id="ReviewReportingWorkMp"> |
| | | update reporting_work as rw |
| | | left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id |
| | | set rw.reviewed_state = 1 |
| | | where rw.process_id = #{substring} and rw.this_process=#{process} |
| | | and rwd.technology_number = #{result} and reviewed_state=0 |
| | | </update> |
| | | </mapper> |