| | |
| | | <!-- 更新分架状态--> |
| | | <update id="updateDeleteState"> |
| | | update |
| | | sd.order_glass_detail as ogd left join flow_card as fc |
| | | sd.order_glass_detail as ogd left join pp.flow_card as fc |
| | | on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number |
| | | set ogd.splitting_status=0 |
| | | where fc.process_id = #{processId} |
| | | where |
| | | <if test="processId=='all'"> |
| | | ogd.order_id = #{orderId} |
| | | </if> |
| | | <if test="processId!='all'"> |
| | | fc.process_id = #{processId} |
| | | </if> |
| | | |
| | | |
| | | </update> |
| | | |
| | | <!-- 删除流程卡--> |
| | | <update id="deleteFlowCardMp"> |
| | | delete |
| | | from flow_card as fc |
| | | where fc.process_id = #{processId} |
| | | from pp.flow_card as fc |
| | | where |
| | | <if test="processId=='all'"> |
| | | fc.order_id = #{orderId} |
| | | </if> |
| | | <if test="processId!='all'"> |
| | | fc.process_id = #{processId} |
| | | </if> |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | |
| | | from reporting_work as rw |
| | | where rw.process_id = #{processId} and reviewed_state>=0 |
| | | </select> |
| | | <!-- 查询报工表内是否有对应流程卡--> |
| | | <select id="reportingWorkCountByOrderId"> |
| | | select COUNT(rw.process_id) |
| | | from pp.reporting_work as rw |
| | | where rw.order_id = #{orderId} and reviewed_state>=0 |
| | | </select> |
| | | |
| | | <!-- 插入Flow_card表--> |
| | | <insert id="addFlowCardMp"> |
| | | insert into flow_card (order_id, |
| | |
| | | from sd.order_process_detail |
| | | where process_id = #{processId} |
| | | </delete> |
| | | |
| | | <delete id="deleteReportingWorkByOrderId"> |
| | | delete |
| | | from sd.order_process_detail |
| | | where order_id = #{orderId} |
| | | </delete> |
| | | |
| | | |
| | | |
| | | <select id="selectPrintFlowCardMp"> |
| | | select order_id, |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | |
| | | order by fc.process_id |
| | | </select> |
| | | |
| | | <select id="getPrintCustomData2"> |
| | | select o.order_id as orderId, |
| | | project, |
| | | customer_id as customerId, |
| | | o.customer_name as customerName, |
| | | order_type as orderType, |
| | | order_classify as orderClassify, |
| | | batch, |
| | | o.icon, |
| | | pack_type as packType, |
| | | delivery_date as deliveryDate, |
| | | al_type as alType, |
| | | money, |
| | | contract_id as contractId, |
| | | customer_batch customerBatch, |
| | | contacts, |
| | | delivery_address as deliveryAddress, |
| | | od.processing_note as processingNote, |
| | | width, |
| | | height, |
| | | fc.quantity, |
| | | od.order_number as orderNumber, |
| | | fc.technology_number as technologyNumber, |
| | | od.building_number as buildingNumber, |
| | | od.product_name as productName, |
| | | od.edging_type as edgingType, |
| | | od.remarks, |
| | | c.customer_abbreviation as customerAbbreviation, |
| | | p.product_abbreviation as productAbbreviation, |
| | | fc.process_id as processId, |
| | | o.create_time as createTime, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')) AS figureNumber, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S03')) AS colourCeramicGlaze, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')) AS remarks1, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S05')) AS remarks2, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S06')) AS remarks3, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S07')) AS remarks4, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S08')) AS remarks5, |
| | | p.remarks as filmNumber, |
| | | od.bend_radius as bendRadius, |
| | | od.other_columns, |
| | | ogd.glass_child as glassChild, |
| | | ogd.glass_address as glassAddress, |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color')) AS color |
| | | from sd.order as o |
| | | left join sd.order_detail as od on o.order_id = od.order_id |
| | | left join flow_card as fc on o.order_id = fc.order_id and |
| | | od.order_number = fc.order_number |
| | | left join sd.product as p on p.id = od.product_id |
| | | left join sd.customer as c on c.id = o.customer_id |
| | | left join sd.product_detail as pd on pd.prod_id = p.id and pd.sort_num = od.order_number and |
| | | pd.glass_sort = fc.technology_number |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number and |
| | | ogd.technology_number = fc.technology_number |
| | | where fc.process_id = #{processId} |
| | | group by od.order_number |
| | | order by fc.process_id |
| | | </select> |
| | | |
| | | <select id="selectReplenishPrintMp"> |
| | | select fc.id, |
| | | fc.order_id, |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | |
| | | sum(pl.patch_num) as quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | |
| | | delete from flow_card_sort where process_id = #{processId} |
| | | </delete> |
| | | |
| | | <delete id="deleteflowCardSortByOrderId"> |
| | | delete from pp.flow_card_sort |
| | | where process_id =( |
| | | select process_id from pp.flow_card |
| | | where order_id=#{orderId} |
| | | group by process_id |
| | | ) |
| | | </delete> |
| | | |
| | | <select id="getPrintProjectDetailsMp"> |
| | | SELECT opd.project_no,opd.stock_id,opl.glass_count FROM optimize_detail as opd left join optimize_layout as opl on opl.project_no=opd.project_no and opl.stock_id=opd.stock_id |
| | | where opd.project_no=#{projectNo} |
| | |
| | | select processPrintNum from optimize_project where project_no=#{projectNo} |
| | | </select> |
| | | |
| | | |
| | | <select id="flowCardToOptimizeCount"> |
| | | select count(*) from pp.flow_card where order_id = #{orderId} and engineering_occupancy=1 |
| | | </select> |
| | | </mapper> |