insert into tm_task ( task_type, task_status, code, create_by, update_by, update_time, remark, company_id, create_time ) values ( #{taskType}, #{taskStatus}, #{code}, #{createBy}, #{updateBy}, #{updateTime}, #{remark}, #{companyId}, NOW() ) insert into tm_task ( task_type, task_status, code, create_by, update_by, update_time, remark, company_id, create_time ) values ( #{taskType}, #{taskStatus}, #{code}, #{createBy}, #{updateBy}, #{updateTime}, #{remark}, #{companyId}, NOW() ) insert into tm_task_agreement ( task_id, agreement_id, create_by, update_by, update_time, remark, company_id, create_time ) values ( #{taskId}, #{agreementId}, #{createBy}, #{updateBy}, #{updateTime}, #{remark}, #{companyId}, NOW() ) insert into tm_task_agreement ( task_id, agreement_id, create_time ) values ( #{taskId}, #{agreementId}, NOW() ) insert into repair_apply_details ( task_id, ma_id, type_id, repair_num, status, create_by, update_by, update_time, remark, company_id, back_id, create_time ) values ( #{taskId}, #{maId}, #{typeId}, #{backNum}, #{status}, #{createBy}, #{createBy}, NOW(), #{remark}, #{companyId}, #{id}, NOW() ) insert into back_check_details ( parent_id, type_id, ma_id, back_num, back_status, create_by, update_by, update_time, remark, scrap_reason, scrap_type, file_url, company_id, create_time ) values ( #{parentId}, #{typeId}, #{maId}, #{backNum}, #{backStatus}, #{createBy}, #{createBy}, NOW(), #{remark}, #{scrapReason}, #{scrapType}, #{fileUrl}, #{companyId}, NOW() ) insert into input_apply_details ( task_id, ma_id, type_id, parent_id, input_num, input_type, create_by, update_by, update_time, remark, company_id, create_time ) values ( #{taskId}, #{maId}, #{typeId}, #{parentId}, #{inputNum}, '2', #{createBy}, #{createBy}, NOW(), #{remark}, #{companyId}, NOW() ) insert into input_apply_details ( task_id, ma_id, type_id, parent_id, input_num, input_type, create_by, update_by, update_time, remark, company_id, create_time ) values ( #{taskId}, #{maId}, #{typeId}, #{parentId}, #{backNum}, '2', #{createBy}, #{createBy}, NOW(), #{remark}, #{companyId}, NOW() ) insert into scrap_apply_details ( task_id, parent_id, ma_id, type_id, scrap_num, scrap_source, status, create_by, company_id, remark, scrap_type, file_url, create_time ) values ( #{taskId}, #{parentId}, #{maId}, #{typeId}, #{backNum}, '1', '0', #{createBy}, #{companyId}, #{scrapReason}, #{scrapType}, #{fileUrl}, NOW() ) insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id) values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId}); update tm_task set task_status=#{status} where task_id = #{taskId} update ma_machine set ma_status=#{maStatus} where ma_id = #{maId} UPDATE ma_type SET num = (IFNULL(num, 0)) + #{backNum} WHERE type_id = #{typeId} update slt_agreement_info set end_time = now(), back_id = #{record.parentId}, status = '1' where id = #{info.id} update slt_agreement_info set num = #{backNum}, end_time = now(), back_id = #{record.parentId}, status = '1' where id = #{info.id} update back_apply_details set back_status = 1 where parent_id = #{parentId} and type_id = #{typeId} update back_check_details set is_finished = 1 where parent_id = #{parentId} and type_id = #{typeId} and (is_finished is null or is_finished != 1) delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId} and (is_finished is null or is_finished != 1) and ma_id = #{maId}