| | |
| | | if(a.layout_status=0,'不可排版',if(a.layout_status=1,'可排版','已排版')) as layout_status, |
| | | a.merge |
| | | from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,merge from flow_card |
| | | group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | group by process_Id,order_number) as a |
| | | left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where date(a.create_time)>=#{selectTime1} and date(a.create_time) <= #{selectTime2} |
| | | and b.create_order>0 |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and a.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | |
| | | from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where date(a.create_time)>=#{selectTime1} and date(a.create_time) <= #{selectTime2} |
| | | and b.create_order>0 |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and a.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | <select id="selectPrintFlowCard"> |
| | | select project_no,glass_total,glass_total_area |
| | | from pp.optimize_project |
| | | where date(create_time)>=#{selectTime1} and date(create_time) <= #{selectTime2} |
| | | and state >= 20 |
| | | order by create_time desc |
| | | select op.project_no,glass_total,glass_total_area,labelPrintNum,processPrintNum |
| | | from pp.optimize_project as op |
| | | left join pp.flow_card as fc on op.project_no=fc.project_no |
| | | left join sd.`order` as o on o.order_id=fc.order_id |
| | | where date(op.create_time)>=#{selectTime1} and date(op.create_time) <= #{selectTime2} |
| | | and state >= 20 and o.create_order>0 |
| | | GROUP BY op.project_no |
| | | order by op.create_time desc |
| | | </select> |
| | | |
| | | <select id="selectPrintMp"> |
| | | select * |
| | | SELECT result.*,fcc.print_status from ( select * |
| | | from ((select fc.id, |
| | | fc.order_id, |
| | | fc.process_id, |
| | |
| | | ogdss.concatenated_glass_child as glass_child, |
| | | fc.founder, |
| | | date(fc.splitFrame_time) as splitFrame_time, |
| | | fc.print_status, |
| | | processed_part as process |
| | | |
| | | from flow_card as fc |
| | |
| | | ogdss.concatenated_glass_child as glass_child, |
| | | fc.founder, |
| | | date(fc.splitFrame_time) as splitFrame_time, |
| | | fc.print_status, |
| | | processed_part as process |
| | | |
| | | from flow_card as fc |
| | |
| | | ogdss.concatenated_glass_child as glass_child, |
| | | fc.founder, |
| | | date(fc.splitFrame_time) as splitFrame_time, |
| | | fc.print_status, |
| | | processed_part as process |
| | | |
| | | from flow_card as fc |
| | |
| | | GROUP_CONCAT(pds.glass_sort SEPARATOR '') AS technology_number, |
| | | ogds.glass_child, |
| | | GROUP_CONCAT(ogds.glass_child SEPARATOR '+') AS concatenated_glass_child, |
| | | SUBSTRING(pds.process, LOCATE('中空', pds.process)) AS processed_part |
| | | SUBSTRING(ogds.process, LOCATE('中空', ogds.process)) AS processed_part |
| | | from sd.order_glass_detail as ogds |
| | | left join sd.order_detail as ods |
| | | on ods.order_id = ogds.order_id and ods.order_number = ogds.order_number |
| | |
| | | where process is not null |
| | | and process != "" |
| | | GROUP BY order_id, process_id, technology_number, process |
| | | order by order_id, process_id, length(technology_number) |
| | | order by order_id, process_id, length(technology_number)) as result |
| | | LEFT JOIN (SELECT * from flow_card GROUP BY process_id,technology_number) as fcc |
| | | on result.process_id = fcc.process_id and result.technology_number = fcc.technology_number |
| | | </select> |
| | | |
| | | <select id="getPrimaryList"> |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | if(od.bend_radius!=null,od.bend_radius,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, |
| | |
| | | ogd.glass_child, |
| | | #{process} as process, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, |
| | | od.bend_radius |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as 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 |
| | |
| | | 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} |
| | | and fc.technology_number = #{technologyNumber} |
| | | and fc.order_number = #{orderNumber} |
| | | group by od.order_number, width, height |
| | | order by fc.process_id |
| | | </select> |
| | |
| | | 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.bend_radius as bendRadius, |
| | | CONCAT( |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))), |
| | | ' = ',pl.patch_num ) as size, |
| | | |
| | | CONCAT( |
| | | od.order_number,') ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))), |
| | | ' = ',pl.patch_num ) as numberSize |
| | | 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 |
| | |
| | | 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 |
| | | where pl.process_id = #{processId} |
| | | and pl.order_sort=#{orderNumber} |
| | | and pl.technology_number = #{technologyNumber} |
| | | and pl.reporting_work_id = #{reportingWorkId} |
| | | group by od.order_number, width, height |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | if(od.bend_radius!=null,od.bend_radius,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, |
| | |
| | | <select id="getDetailListLikes"> |
| | | select fc.order_number, |
| | | concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width, |
| | | #{quantity} as quantity, |
| | | round(ogd.child_width*ogd.child_height*#{quantity}/1000000, 2) as total_area, |
| | | round((ogd.child_width+ogd.child_height)*2*#{quantity}/1000, 2) as perimeter, |
| | | count(*) as quantity, |
| | | round(ogd.child_width*ogd.child_height*count(*)/1000000, 2) as total_area, |
| | | round((ogd.child_width+ogd.child_height)*2*count(*)/1000, 2) as perimeter, |
| | | 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, |
| | |
| | | fc.technology_number, |
| | | IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber, |
| | | od.building_number |
| | | 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.technology_number = ogd.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.product_detail as pd |
| | | on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number |
| | | left join flow_card_sort as fcs |
| | | on fcs.process_id = fc.process_id and fcs.order_number = fc.order_number and |
| | | fcs.technology_number = fc.technology_number |
| | | and fcs.process = #{process} |
| | | where fc.process_id = #{processId} |
| | | from optimize_detail opt left join flow_card as fc on opt.process_id = fc.process_id and opt.order_sort = fc.order_number and |
| | | opt.layer = fc.technology_number |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.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.product_detail as pd |
| | | on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number |
| | | left join flow_card_sort as fcs |
| | | on fcs.process_id = fc.process_id and fcs.order_number = fc.order_number and |
| | | fcs.technology_number = fc.technology_number |
| | | and fcs.process = #{process} |
| | | where opt.process_id = #{processId} and opt.project_no=#{printProject} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | and fc.order_number=#{orderNumber} |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | order by IF(fcs.sort != NULL or fcs.sort != '', fcs.sort, fc.order_number) |
| | | </select> |
| | |
| | | sum(pl.patch_num) as quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | if(od.bend_radius!=null,od.bend_radius,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, |
| | |
| | | od.bend_radius as bendRadius, |
| | | 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, |
| | | CONCAT( |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_height AS CHAR))), |
| | | ' = ',pl.patch_num ) as size, |
| | | |
| | | CONCAT( |
| | | od.order_number,') ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_width AS CHAR))), |
| | | ' X ', |
| | | TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(ogd.child_height AS CHAR))), |
| | | ' = ',pl.patch_num ) as numberSize |
| | | 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 |
| | |
| | | on ogd.order_id = o.order_id and ogd.order_number = od.order_number and |
| | | ogd.technology_number = fc.technology_number |
| | | where pl.process_id = #{processId} |
| | | and pl.order_sort=#{orderNumber} |
| | | and pl.technology_number = #{technologyNumber} |
| | | and pl.reporting_work_id = #{reportingWorkId} |
| | | group by od.order_number, width, height |
| | |
| | | GROUP BY fc.process_id, ogd.technology_number |
| | | order by fc.process_id, ogd.technology_number |
| | | </select> |
| | | |
| | | <update id="updateProjectLabelPrintCount"> |
| | | update optimize_project set labelPrintNum=labelPrintNum+1 where project_no=#{projectNo} |
| | | </update> |
| | | |
| | | <select id="selectProjectLabelPrintCount"> |
| | | select labelPrintNum from optimize_project where project_no=#{projectNo} |
| | | </select> |
| | | |
| | | <update id="updateProjectProcessPrintCount"> |
| | | update optimize_project set processPrintNum=processPrintNum+1 where project_no=#{projectNo} |
| | | </update> |
| | | |
| | | <select id="selectProjectProcessPrintCount"> |
| | | select processPrintNum from optimize_project where project_no=#{projectNo} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |