| | |
| | | c.project_no, |
| | | d.child_width as 'width', |
| | | d.child_height as 'height', |
| | | (d.child_width + d.child_height) * 2 as 'perimeter', |
| | | c.quantity, |
| | | od.shape, |
| | | concat( c.process_id, '-', c.technology_number ) AS 'process_id', |
| | | c.process_id AS processId, |
| | | c.technology_number as layer, |
| | | c.layers_number as totalLayer, |
| | | d.glass_child, |
| | | od.price, |
| | | od.remarks, |
| | | round( d.area * c.quantity, 4 ) as 'area', |
| | | c.order_number, |
| | | d.icon AS markIcon, |
| | | op.project_name, |
| | | 0 as patchState, |
| | | c.rack AS rackNo, |
| | | 0 as heatLayoutId, |
| | | d.process, |
| | | o.order_id AS orderNo, |
| | | o.customer_name AS customerName, |
| | |
| | | c.project_no, |
| | | d.child_width as 'width', |
| | | d.child_height as 'height', |
| | | (d.child_width + d.child_height) * 2 as 'perimeter', |
| | | c.patch_num as quantity, |
| | | od.shape, |
| | | concat( c.process_id, '-', c.technology_number ) AS 'process_id', |
| | | c.process_id AS 'process_ids', |
| | | c.technology_number as layer, |
| | | fc.layers_number as total_layer, |
| | | d.glass_child, |
| | | od.price, |
| | | od.remarks, |
| | | round( d.area * c.patch_num, 4 ) as 'area', |
| | | c.order_sort as order_number, |
| | | d.icon, |
| | | op.project_name, |
| | | 1 as patch_state, |
| | | a.id as rackNo, |
| | | 0 as heatLayoutId, |
| | | d.process, |
| | | o.order_id AS orderNo, |
| | | o.customer_name AS customerName, |
| | |
| | | <!--优化查询--> |
| | | <select id="computeAndOptimization"> |
| | | SELECT |
| | | c.project_no, |
| | | c.rack AS rackNo, |
| | | h.layout_id as heatLayoutId, |
| | | # h.layout_id as heatLayoutId, |
| | | h.width AS width, |
| | | h.height AS height, |
| | | (h.width + h.height) * 2 as 'perimeter', |
| | | od.shape, |
| | | count( 1 ) AS quantity, |
| | | concat( h.process_id, '-', h.layer ) AS processId, |
| | | concat( h.process_id, '-', h.layer ) AS process_id, |
| | | c.process_id AS processId, |
| | | h.process_id as process_ids, |
| | | h.layer, |
| | | c.layers_number as totalLayer, |
| | | d.glass_child, |
| | | od.price, |
| | | od.remarks, |
| | | round( d.area * count( 1 ), 4 ) AS 'area', |
| | | c.order_number, |
| | | h.order_sort AS orderSort, |
| | |
| | | WHERE |
| | | h.project_no = #{projectNo} |
| | | GROUP BY |
| | | h.layout_id, |
| | | # h.layout_id, |
| | | h.width, |
| | | h.height, |
| | | h.process_id, |
| | |
| | | ou.right_trim as rightTrim, |
| | | JSON_EXTRACT(ms.json, '$.thickness') AS thickness, |
| | | JSON_EXTRACT(ms.json, '$.name') AS name, |
| | | JSON_EXTRACT(ms.json, '$.model') AS model |
| | | JSON_EXTRACT(ms.json, '$.model') AS model, |
| | | (ou.width * ou.height * ou.use_count / 1000000.0) AS totalArea |
| | | from pp.optimize_use ou |
| | | left join mm.material_store ms on ou.raw_stock_code=ms.id where project_no=#{projectNumber} and state=1 |
| | | </select> |
| | |
| | | <!--修改模拟计算工程状态--> |
| | | <update id="updateProjectTemperingStateMp"> |
| | | update pp.optimize_project as p |
| | | set p.tempering_state = #{states} |
| | | set p.tempering_state = #{states}, |
| | | p.load_rate = NULL, |
| | | p.furnaces_qty = NULL |
| | | where p.project_no = #{projectNumber} |
| | | </update> |
| | | |
| | |
| | | NOW(), |
| | | NOW(), |
| | | 0, |
| | | #{glass.layers_number}, |
| | | #{glass.technology_number}, |
| | | #{glass.order_number}, |
| | | #{glass.tempering_layout_id}, |
| | | #{glass.tempering_feed_sequence}, |
| | |
| | | p.avg_cut_pct = #{optimalResults.avgCutRate}, |
| | | p.valid_cut_pct = #{optimalResults.validCutRate}, |
| | | p.last_cut_pct = #{optimalResults.lastCutRate}, |
| | | p.raw_stock_qty = #{optimalResults.totalQuantity} |
| | | p.raw_stock_qty = #{optimalResults.totalQuantity}, |
| | | p.raw_stock_area = #{totalArea} |
| | | where p.project_no = #{projectId} |
| | | </update> |
| | | <update id="updateProjectTemperingId"> |
| | | UPDATE pp.optimize_detail |
| | | SET heat_layout_id = NULL, |
| | | heat_layout_sort = NULL |
| | | WHERE project_no = #{projectNumber} |
| | | </update> |
| | | |
| | | <select id="simulatedTypesettingUsingOpt"> |
| | |
| | | ol.realwidth as rawGlassWidth, |
| | | ol.realheight as rawGlassHeight, |
| | | op.glass_thickness as rawGlassThickness, |
| | | ol.stock_id rawSequence |
| | | ol.stock_id as rawSequence, |
| | | ol.usage_rate as usageRate |
| | | from |
| | | pp.optimize_layout ol |
| | | left join pp.optimize_project op on ol.project_no = op.project_no |
| | |
| | | |
| | | |
| | | <select id="selectOptimizeDetail"> |
| | | |
| | | select |
| | | opd.glass_id as glassId, |
| | | opd.project_no as engineerId, |
| | |
| | | opd.mark_icon as markIcon, |
| | | fc.`merge` as combine, |
| | | concat( opd.process_id, '/', opd.layer ) as flowCardSequence, |
| | | ogd.process |
| | | ogd.process, |
| | | if(opd.graph_no=100,0,1) as graphNo |
| | | from |
| | | pp.optimize_detail opd |
| | | left join pp.optimize_project op on op.project_no = opd.project_no |