select id, task_id, parent_id, ma_id, type_id, scrap_num, scrap_source, scrap_type, status, audit_by, audit_time, audit_remark, create_by, create_time, update_by, update_time, remark, file_url, company_id, file_name from scrap_apply_details insert into scrap_apply_details id, task_id, parent_id, ma_id, type_id, scrap_num, scrap_source, scrap_type, status, audit_by, audit_time, audit_remark, create_by, create_time, update_by, update_time, remark, file_url, company_id, file_name, #{id}, #{taskId}, #{parentId}, #{maId}, #{typeId}, #{scrapNum}, #{scrapSource}, #{scrapType}, #{status}, #{auditBy}, #{auditTime}, #{auditRemark}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, #{fileUrl}, #{companyId}, #{fileName}, insert into back_apply_details (parent_id,type_id,pre_num,audit_num,status,create_by,create_time,update_by,update_time,company_id) values (#{parentId},#{typeId},#{scrapNum},#{scrapNum},#{status},#{createBy},now(),#{updateBy},now(),#{companyId}); insert into back_apply_info (code,task_id,back_person,phone,direct_audit_by,direct_audit_time,direct_audit_remark,create_by,create_time,update_by,update_time,company_id,back_time,status) values (#{code},#{taskId},#{backPerson},#{phone},#{directAuditBy},#{directAuditTime},#{directAuditRemark},#{createBy},now(),#{updateBy},now(),#{companyId},#{backTime},#{status}); insert into repair_audit_details (task_id,repair_id,ma_id,type_id,repair_num,repaired_num,scrap_num,status,create_by,create_time,update_by,update_time,company_id) values (#{taskId},#{repairId},#{maId},#{typeId},#{repairNum},#{repairedNum},#{scrapNum},#{status},#{createBy},now(),#{updateBy},now(),#{companyId}); update scrap_apply_details task_id = #{taskId}, parent_id = #{parentId}, ma_id = #{maId}, type_id = #{typeId}, scrap_num = #{scrapNum}, scrap_source = #{scrapSource}, scrap_type = #{scrapType}, status = #{status}, audit_by = #{auditBy}, audit_time = #{auditTime}, audit_remark = #{auditRemark}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, file_url = #{fileUrl}, company_id = #{companyId}, file_name = #{fileName}, where id = #{id} delete from scrap_apply_details where id = #{id} delete from scrap_apply_details where id in #{id} update ma_machine set ma_status = 22 where ma_id = #{maId} update scrap_apply_details set audit_by = #{auditBy}, audit_time = now(), status = #{status}, update_by = #{updateBy}, update_time = now(), audit_remark = #{auditRemark} where id = #{id}