| | |
| | | ROUND(od.quantity-IFNULL(sum(fc.quantity)/count(fc.technology_number),0)) as baiscQuantity, |
| | | od.compute_gross_area as 'computeGrossArea', |
| | | p.total_thickness AS 'totalThickness', |
| | | p.thickness, |
| | | ifnull(p.thickness,'') as thickness, |
| | | od.weight, |
| | | od.remarks, |
| | | od.bend_radius, |
| | | od.processing_note, |
| | | ifnull(od.bend_radius,'') as bend_radius, |
| | | ods.S01, |
| | | ods.S02, |
| | | ods.S03, |
| | |
| | | where create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in order_id) |
| | | and position(#{project} in project) |
| | | and processing_card = 2 |
| | | and processing_card >0 |
| | | order by create_time desc |
| | | </select> |
| | | |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | |
| | | opd.stock_id, |
| | | od.quantity, |
| | | od.other_columns, |
| | | od.bend_radius |
| | | od.bend_radius, |
| | | od.order_number as heat_layout_id, |
| | | a.id as heat_layout_sort |
| | | from pp.optimize_detail opd |
| | | left join sd.`order` o on SUBSTR(opd.process_id, 1, 10) = o.order_id |
| | | left join sd.order_detail od |
| | |
| | | left join sd.product p on od.product_id = p.id |
| | | left join sd.basic_glass_type e on e.type_id = p.type_id |
| | | left join sd.customer c on c.id = o.customer_id |
| | | left join |
| | | (select (@row_number := @row_number + 1) as id,process_id as process_id from (select process_id from pp.optimize_detail tt where project_no =#{projectNo} group by process_id) tt,(select @row_number := 0) as t) a |
| | | on a.process_id=opd.process_id |
| | | where opd.project_no = #{projectNo} |
| | | order by opd.stock_id |
| | | </select> |
| | |
| | | ogd.glass_child, |
| | | ogd.process, |
| | | e.type_name, |
| | | opd.stock_id, |
| | | od.quantity, |
| | | od.other_columns, |
| | | od.bend_radius, |
| | |
| | | group by od.order_number, od.width, od.height |
| | | </select> |
| | | |
| | | <select id="getPrintLabelDetail"> |
| | | select o.order_id, |
| | | o.project, |
| | | o.customer_id, |
| | | ogd.child_width as width, |
| | | ogd.child_height as height, |
| | | fc.quantity, |
| | | od.order_number as orderNumber, |
| | | fc.technology_number as technologyNumber, |
| | | ogd.glass_child, |
| | | ogd.process, |
| | | c.customer_abbreviation as customer_name, |
| | | ifnull(od.processing_note, '') as processing_note, |
| | | bgt.type_name, |
| | | od.other_columns, |
| | | od.building_number, |
| | | od.bend_radius |
| | | from sd.order as o |
| | | left join sd.order_detail as od on o.order_id = od.order_id |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id = od.order_id and ogd.order_number = od.order_number |
| | | left join pp.flow_card as fc on o.order_id = fc.order_id and |
| | | od.order_number = fc.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.product pt on pt.id = od.product_id |
| | | left join sd.customer c on c.id = o.customer_id |
| | | left join sd.basic_glass_type bgt on bgt.type_id = pt.type_id |
| | | <where> |
| | | and fc.process_id = #{flowCard.processId} |
| | | and fc.order_number = #{flowCard.orderNumber} |
| | | <if test="flowCard.technologyNumber != null and flowCard.technologyNumber != ''"> |
| | | and fc.technology_number = #{flowCard.technologyNumber} |
| | | </if> |
| | | </where> |
| | | group by od.order_number,fc.technology_number, od.width, od.height |
| | | </select> |
| | | |
| | | <select id="printFlowCardDetailsMp"> |
| | | SELECT fc.process_id, |
| | | fc.order_number, |
| | |
| | | ifnull(fcs.sort, '') as sort, |
| | | ogd.glass_child, |
| | | #{process} as process, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, |
| | | od.bend_radius |
| | | FROM flow_card AS fc |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON fc.order_id = ogd.order_id |
| | | AND fc.order_number = ogd.order_number |
| | |
| | | ogd.glass_child, |
| | | fc.print_status, |
| | | pl.reporting_work_id, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, |
| | | pl.patch_id |
| | | |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) 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, |
| | | od.bend_radius, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | | round(ogd.child_height) as height, |
| | | pd.separation, |
| | | fc.technology_number |
| | | fc.technology_number, |
| | | pl.patch_type, |
| | | pl.patch_reason, |
| | | pl.patch_processes, |
| | | pl.responsible_team, |
| | | pl.responsible_personnel |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | and fc.order_number = #{orderNumber} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | and pl.reporting_work_id = #{reportingWorkId} |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | and pl.patch_reason = #{patchReason} |
| | | group by fc.process_id, fc.order_number, fc.technology_number,pl.id |
| | | order by IF(sort != NULL and sort != '', sort, fc.order_number) |
| | | </select> |
| | | |
| | |
| | | where fc.process_id = #{processId} |
| | | and fc.order_number = #{orderNumber} |
| | | and fc.technology_number = #{technologyNumber} |
| | | and rw.reporting_work_id = #{reportingWorkId} |
| | | and pl.reporting_work_id = #{reportingWorkId} |
| | | and dd.breakage_reason = #{patchReason} |
| | | group by fc.process_id, fc.technology_number |
| | | </select> |
| | | |
| | |
| | | dd.responsible_process, |
| | | dd.responsible_team, |
| | | concat('对应我司单号', o.batch) AS otherRemarks, |
| | | dd.responsible_personnel |
| | | dd.responsible_personnel, |
| | | pl.rework_id as patch_id |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | (pl.rework_num) as quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | concat(od.processing_note, od.remarks) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | | round(ogd.child_height) as height, |
| | | pd.separation, |
| | | fc.technology_number |
| | | fc.technology_number, |
| | | pl.rework_type as patch_type, |
| | | pl.rework_reason as patch_reason, |
| | | pl.rework_processes as patch_processes, |
| | | pl.responsible_team, |
| | | pl.rework_team, |
| | | pl.responsible_personnel |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | fc.process_id, |
| | | o.customer_name, |
| | | o.project, |
| | | ogd.technology_number, |
| | | /*ogd.technology_number,*/ |
| | | ogd.glass_address, |
| | | (fc.quantity) as quantity, |
| | | round((ogd.child_width * ogd.child_height * fc.quantity / 1000000), 2) as total_area, |
| | |
| | | where fc.order_id = #{orderId} |
| | | GROUP BY fc.process_id, od.order_number |
| | | order by fc.process_id, od.order_number |
| | | </select> |
| | | |
| | | <select id="selectPrintDetailsMp1"> |
| | | select fc.id, |
| | | fc.order_id, |
| | | fc.process_id, |
| | | o.customer_name, |
| | | o.project, |
| | | ogd.technology_number, |
| | | ogd.glass_address, |
| | | (fc.quantity) as quantity, |
| | | round((ogd.child_width * ogd.child_height * fc.quantity / 1000000), 2) as total_area, |
| | | od.product_name, |
| | | ogd.glass_child, |
| | | fc.founder, |
| | | date(fc.splitFrame_time) as splitFrame_time, |
| | | /* if(fc.print_status=0,'未打印','已打印') as print_status*/ |
| | | fc.print_status, |
| | | ogd.process, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, |
| | | od.order_number |
| | | from flow_card as fc |
| | | 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 |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.`order` as o on o.order_id = fc.order_id |
| | | where fc.order_id = #{orderId} |
| | | GROUP BY fc.process_id, od.order_number,fc.technology_number |
| | | order by fc.process_id, od.order_number,fc.technology_number |
| | | </select> |
| | | |
| | | <select id="getPrintCustomDataDetails"> |
| | |
| | | od.other_columns, |
| | | ogd.glass_child as glassChild, |
| | | ogd.glass_address as glassAddress, |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color')) AS color |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color')) AS color, |
| | | '文本' as custom1, |
| | | '文本' as custom2, |
| | | '文本' as custom3, |
| | | '文本' as custom4, |
| | | '文本' as custom5 |
| | | 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 |
| | |
| | | and fc.order_number = #{orderNumber} |
| | | group by od.order_number, width, height |
| | | order by fc.process_id |
| | | </select> |
| | | |
| | | <select id="getPrintCustomDataProjectNo"> |
| | | 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, |
| | | od.width, |
| | | od.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, |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color')) AS color, |
| | | '文本' as custom1, |
| | | '文本' as custom2, |
| | | '文本' as custom3, |
| | | '文本' as custom4, |
| | | '文本' as custom5 |
| | | from optimize_detail as opt |
| | | left join flow_card as fc on opt.project_no=fc.project_no and opt.process_id=fc.process_id and opt.layer=fc.technology_number and opt.order_sort=fc.order_number |
| | | left join sd.order as o on o.order_id=fc.order_id |
| | | left join sd.order_detail as od on fc.order_id = od.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 |
| | | where opt.project_no=#{projectNo} |
| | | order by opt.stock_id,opt.polys_id |
| | | </select> |
| | | |
| | | <select id="selectUserMp"> |
| | |
| | | </select> |
| | | |
| | | <select id="selectFlowCardMerge"> |
| | | select * |
| | | select *,GROUP_CONCAT(DISTINCT fc.technology_number) as count1,count(DISTINCT fc.technology_number) as count2 |
| | | from pp.flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | </select> |
| | | |
| | | <update id="updateFlowCardMerge"> |
| | | update pp.flow_card fc set fc.merge=1 |
| | | where fc.process_id = #{processId} |
| | | update pp.flow_card fc set fc.merge=#{index} |
| | | where fc.process_id = #{processId} and fc.technology_number in |
| | | <foreach item="technologyNumber" collection="technologyNumbers" open="(" separator="," close=")"> |
| | | #{technologyNumber} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <delete id="deleteflowCardSort"> |
| | | delete from flow_card_sort where process_id = #{processId} |
| | | </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} |
| | | GROUP BY opd.stock_id |
| | | ORDER BY opd.stock_id |
| | | </select> |
| | | |
| | | <select id="getPrintCustomDataProjectDetail"> |
| | | 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, |
| | | od.width, |
| | | od.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, |
| | | JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color')) AS color, |
| | | '文本' as custom1, |
| | | '文本' as custom2, |
| | | '文本' as custom3, |
| | | '文本' as custom4, |
| | | '文本' as custom5 |
| | | from optimize_detail as opt |
| | | left join flow_card as fc on opt.project_no=fc.project_no and opt.process_id=fc.process_id and opt.layer=fc.technology_number and opt.order_sort=fc.order_number |
| | | left join sd.order as o on o.order_id=fc.order_id |
| | | left join sd.order_detail as od on fc.order_id = od.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 |
| | | where opt.project_no=#{projectNo} and opt.stock_id=#{stockId} |
| | | order by opt.stock_id,opt.polys_id |
| | | </select> |
| | | |
| | | </mapper> |