update pp.optimize_project as p set p.state = #{state} where p.project_no = #{projectNumber} update pp.optimize_project as p set p.tempering_state = #{states} where p.project_no = #{projectNumber} update pp.optimize_project as p set p.optimize_state = #{states} where p.project_no = #{projectNumber} delete from pp.optimize_project where project_no = #{projectNumber} delete from pp.optimize_heat_detail where project_no = #{projectNumber} delete from pp.optimize_heat_layout where project_no = #{projectNumber} delete from pp.optimize_detail where project_no = #{projectNumber} delete from pp.optimize_layout where project_no = #{projectNumber} delete from pp.optimize_project_file where project_no = #{projectNumber} update pp.optimize_use set state=0 where project_no = #{projectNumber} UPDATE pp.flow_card set project_no=#{projectId},layout_status=2 where process_id=#{processId} and technology_number=#{technologyNumber} UPDATE pp.patch_log set project_no=#{projectId} where process_id=#{processId} and technology_number=#{technologyNumber} UPDATE pp.flow_card set project_no=null,layout_status=1 where process_id=#{processId} and technology_number=#{technologyNumber} and project_no=#{projectId} UPDATE pp.patch_log set project_no=null where process_id=#{processId} and technology_number=#{technologyNumber} and project_no=#{projectId} update pp.optimize_project set project_name=#{projectNmae},glass_total=#{sumQuantity},glass_total_area= #{sumArea}, type=#{type},process_qty=#{processIdCount},process_cards=#{processId} where project_no=#{projectId} insert into pp.optimize_project (project_no, project_name, order_glass_type, order_glass_thickness,glass_type, glass_thickness, glass_total,glass_total_area,type,state,process_qty,process_cards) values (#{projectId}, #{projectNmae}, #{glassType}, #{glassThickness}, #{glassType}, #{glassThickness},#{sumQuantity}, #{sumArea}, #{type},1,#{processIdCount},#{processId}) 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 ); 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 ( #{projectId}, #{processId}, #{width}, #{height}, 0, 0, 0, #{username}, NOW(), NOW(), #{patchState}, #{technologyNumber}, #{orderNumber}, 0, #{index}, null, #{width}, #{height}, null, null ); 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 ); INSERT INTO pp.optimize_detail ( project_no, process_id, layer, total_layer, order_sort, stock_id, polys_id, o_width, o_height, width, height, x_axis, y_axis, patch_state, mark_icon, rack_no ) VALUES ( #{projectId}, #{glass.processId}, #{glass.layer}, #{glass.totalLayer}, #{glass.orderSort}, #{glass.stockSort}, #{glass.polySort}, #{glass.realWidth}, #{glass.realHeight}, #{glass.width}, #{glass.height}, #{glass.x}, #{glass.y}, #{glass.patchState}, #{glass.markIcon}, #{glass.rackNo} ); INSERT INTO pp.optimize_project_file ( project_no, type, content, create_time, creater ) VALUES ( #{projectId}, "优化结果", #{object}, now(), #{name} ); INSERT INTO pp.optimize_layout ( project_no, stock_id, width, height, usage_rate, stock_code, up_trim, down_trim, left_trim, right_trim, glass_count, glass_area, create_time ) VALUES ( #{projectId}, #{glass.stockId}, #{glass.width}, #{glass.height}, #{glass.usageRate}, #{glass.stockCode}, #{glass.upTrim}, #{glass.downTrim}, #{glass.leftTrim}, #{glass.rightTrim}, #{glass.glassCount}, #{glass.glassArea}, now() ); INSERT INTO pp.optimize_use ( project_no, raw_stock_code, type, width, height, use_count, not_use_count, state, left_trim, down_trim, right_trim, up_trim, creater, create_time ) VALUES ( #{projectId}, #{glass.stockCode}, 1, #{glass.width}, #{glass.height}, #{glass.count}, #{glass.count}, 1, #{glass.leftTrim}, #{glass.downTrim}, #{glass.rightTrim}, #{glass.upTrim}, #{name}, now() ); UPDATE pp.optimize_project SET tempering_state = 1, furnaces_qty=#{resultSum[0]}, load_rate=#{resultSum[1]}, 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} WHERE project_no = #{inputValues.project_no} update erp_user_info.user as u set u.optimize_parms = #{jsonString} where user_name=#{username} update pp.optimize_project_file as u set u.content = #{jsonString} where u.project_no=#{processId} and type='优化结果' update pp.optimize_detail set heat_layout_id=#{layoutId},heat_layout_sort=#{sort},glass_id=concat(process_id,'|',#{layoutId},'|',#{sort}) where id=#{id}; UPDATE pp.optimize_config set config_detail=#{json},create_time=now() where config_type=#{type} and creater=#{username} UPDATE pp.flow_card SET rack = #{rackValue} WHERE process_id = #{processId} AND technology_number = #{technologyNumber} delete from pp.other_flow_card where project_no = #{projectNumber}