UPDATE lease_apply_details SET al_num = IF(al_num IS NULL, #{record.outNum}, al_num + #{record.outNum}), update_by = #{record.updateBy}, update_time = now(), status = '2' WHERE parennt_id = #{record.parentId} and type_id = #{record.typeId} insert into lease_out_details(parent_id,type_id,ma_id,out_num,out_type,create_by,create_time,update_by,update_time,remark,company_id) values(#{parentId},#{typeId},#{maId},#{outNum},#{outType},#{createBy},now(),#{updateBy},now(),#{remark},#{companyId}) insert into lease_out_details parent_id, type_id, ma_id, out_num, out_type, create_by, update_by, remark, company_id, create_time, update_time #{parentId}, #{typeId}, #{maId}, #{outNum}, #{outType}, #{createBy}, #{updateBy}, #{remark}, #{companyId}, NOW(), NOW() UPDATE ma_type SET num = num - #{record.outNum} ,update_time = NOW() WHERE type_id = #{record.typeId} UPDATE ma_machine SET ma_status = '16' , create_time = NOW() type_id = #{record.typeId} and ma_id = #{record.maId} update tm_task set task_status = #{status} where task_id = #{taskId} insert into tm_task_agreement task_id, agreement_id, create_by, update_by, remark, company_id, create_time #{record.parentId}, #{record.typeId}, #{record.createBy}, #{record.updateBy}, #{record.remark}, #{record.companyId}, now()