| | |
| | | ROUND(SUM(od.width * od.height * fc.quantity / 1000000), 2) AS area, |
| | | o.project, |
| | | ogd.glass_child, |
| | | od.shape |
| | | od.shape, |
| | | SUBSTRING(glass_child, 1, LOCATE('mm', glass_child) - 1) as thickness, |
| | | SUBSTRING(glass_child, LOCATE('mm', glass_child) + 2) as glassType |
| | | FROM |
| | | pp.flow_card AS fc |
| | | LEFT JOIN sd.`order` AS o ON fc.order_id = o.order_id |
| | |
| | | </select> |
| | | |
| | | <!--模拟计算流程卡详情--> |
| | | <select id="selectComputeDetailMp"> |
| | | <select id="selectComputeDetailMp1"> |
| | | SELECT |
| | | d.width AS width, |
| | | d.height AS height, |
| | |
| | | WHERE |
| | | p.state IN (1, 2) |
| | | AND f.process_id = #{processId} |
| | | </select> |
| | | |
| | | |
| | | <!--模拟计算流程卡详情2--> |
| | | <select id="selectComputeDetailMp"> |
| | | SELECT |
| | | d.width AS width, |
| | | d.height AS height, |
| | | f.quantity AS quantity, |
| | | d.building_number AS `Storey Number`, |
| | | d.shape AS shape, |
| | | round(g.area * f.quantity, 4) AS area, |
| | | g.icon AS `Label type`, |
| | | dal.patch_status, |
| | | g.technology_number, |
| | | g.order_number, |
| | | fl.layers_number, |
| | | g.child_width, |
| | | g.child_height, |
| | | fl.process_id |
| | | |
| | | FROM |
| | | pp.flow_card f |
| | | LEFT JOIN pp.optimize_project p ON f.project_no = p.project_no |
| | | LEFT JOIN sd.order o ON f.order_id = o.order_id |
| | | LEFT JOIN sd.order_detail d ON f.order_id = d.order_id AND f.order_number = d.order_number |
| | | LEFT JOIN sd.order_glass_detail g ON f.order_id = g.order_id AND f.order_number = g.order_number AND f.technology_number = g.technology_number |
| | | LEFT JOIN sd.product_detail p2 ON d.product_id = p2.prod_id AND f.technology_number = p2.glass_sort |
| | | LEFT JOIN pp.optimize_project j ON f.project_no = j.project_no |
| | | LEFT JOIN pp.damage_details dal ON dal.order_number = g.order_number AND dal.technology_number = g.technology_number and f.process_id=dal.process_id |
| | | LEFT JOIN pp.flow_card fl ON fl.order_id = g.order_id AND fl.order_number = g.order_number AND fl.technology_number = g.technology_number |
| | | WHERE |
| | | f.process_id = #{processId} |
| | | </select> |
| | | |
| | | <select id="getProcessCardDetailmMp"> |
| | |
| | | insert into pp.optimize_project (project_no, project_name, order_glass_type, order_glass_thickness) |
| | | values (#{projectId}, #{projectNmae}, #{glassType}, #{glassThickness}) |
| | | </insert> |
| | | |
| | | |
| | | <insert id="addSimulation" parameterType="map"> |
| | | <foreach collection="projectdetail.data[0].glass_details" item="glass"> |
| | | INSERT INTO pp.optimize_heat_detail ( |
| | | project_no, |
| | | process_id, |
| | | width, |
| | | height, |
| | | x_axis, |
| | | y_axis, |
| | | rotate_angle, |
| | | creater, |
| | | create_time, |
| | | update_time, |
| | | patch_state, |
| | | layer, |
| | | order_sort, |
| | | layout_id, |
| | | sort, |
| | | glass_id, |
| | | pair_width, |
| | | pair_height, |
| | | intRemark, |
| | | strRemark |
| | | ) VALUES ( |
| | | #{inputValues.project_no}, |
| | | #{glass.process_id}, |
| | | #{glass.width}, |
| | | #{glass.height}, |
| | | #{glass.x_coordinate}, |
| | | #{glass.y_coordinate}, |
| | | #{glass.angle}, |
| | | #{userName}, |
| | | NOW(), |
| | | NOW(), |
| | | 0, |
| | | #{glass.layers_number}, |
| | | #{glass.order_number}, |
| | | #{glass.tempering_layout_id}, |
| | | #{glass.tempering_feed_sequence}, |
| | | null, |
| | | #{glass.width}, |
| | | #{glass.height}, |
| | | null, |
| | | null |
| | | ); |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <insert id="addratioResult" parameterType="map"> |
| | | <foreach collection="projectdetail.data[0].ratioResult" item="glass"> |
| | | INSERT INTO pp.optimize_heat_layout ( |
| | | project_no, |
| | | layout_id, |
| | | glass_qty, |
| | | glass_area, |
| | | layout_rate, |
| | | creater, |
| | | create_time, |
| | | intRemark, |
| | | strRemark |
| | | ) VALUES ( |
| | | #{inputValues.project_no}, |
| | | #{glass.tempering_layout_id}, |
| | | #{glass.glass_total}, |
| | | #{glass.area}, |
| | | #{glass.ratio}, |
| | | 1, |
| | | NOW(), |
| | | null, |
| | | null |
| | | ); |
| | | </foreach> |
| | | </insert> |
| | | |
| | | |
| | | <update id="addratioProjectResult" parameterType="map"> |
| | | UPDATE pp.optimize_project |
| | | SET |
| | | state = 10, |
| | | chaos_pct = #{inputValues.chaos_pct}, |
| | | max_load_pct = #{inputValues.max_load_pct}, |
| | | max_area=#{inputValues.max_area}, |
| | | max_qty=#{inputValues.max_qty}, |
| | | load_width=#{inputValues.load_width}, |
| | | load_length=#{inputValues.load_length}, |
| | | x_space=#{inputValues.x_space}, |
| | | y_space=#{inputValues.y_space}, |
| | | load_rate=#{inputValues.load_rate} |
| | | WHERE |
| | | project_no = #{inputValues.project_no} |
| | | |
| | | </update> |
| | | |
| | | |
| | | </mapper> |