DELETE FROM production_product_output_staff WHERE product_out_id IN (SELECT id FROM production_product_output WHERE product_main_id = #{mainId}) DELETE FROM production_artificial_information WHERE output_id IN (SELECT id FROM production_product_output WHERE product_main_id = #{mainId}) DELETE FROM production_product_output_staff WHERE product_out_id IN (SELECT id FROM production_product_output WHERE product_main_id = #{mainId}) update production_product_output set shift_output_id = null where shift_output_id = #{id} insert into production_product_output (part_id, product_qty, create_time, create_user, product_main_id, out_batch_no, system_no, sort_no, start_meter_mark, end_meter_mark, reel_number, ifs_batch_no, segment_desc, scrap_qty, ifs_opfeed_id, ifs_labor_id, remark, shift_output_id, sproduct_qty, reel_weight, gross_weight, net_weight, is_sn_generate_output,disc_tool_measurement ) values (#{item.partId,jdbcType=BIGINT}, #{item.productQty,jdbcType=NUMERIC}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.createUser,jdbcType=VARCHAR}, #{item.productMainId,jdbcType=BIGINT}, #{item.outBatchNo,jdbcType=VARCHAR}, #{item.systemNo,jdbcType=VARCHAR}, #{item.sortNo,jdbcType=BIGINT}, #{item.startMeterMark,jdbcType=NUMERIC}, #{item.endMeterMark,jdbcType=NUMERIC}, #{item.reelNumber,jdbcType=VARCHAR}, #{item.ifsBatchNo,jdbcType=VARCHAR}, #{item.segmentDesc,jdbcType=VARCHAR}, #{item.scrapQty,jdbcType=NUMERIC}, #{item.ifsOpfeedId,jdbcType=BIGINT}, #{item.ifsLaborId,jdbcType=BIGINT}, #{item.remark,jdbcType=VARCHAR}, #{item.shiftOutputId,jdbcType=BIGINT}, #{item.sproductQty,jdbcType=NUMERIC}, #{item.reelWeight,jdbcType=NUMERIC}, #{item.grossWeight,jdbcType=NUMERIC}, #{item.netWeight,jdbcType=NUMERIC}, #{item.isSnGenerateOutput,jdbcType=BOOLEAN}, #{item.discToolMeasurement,jdbcType=VARCHAR} )