select lod.id, lod.parent_id, lod.type_id, lod.ma_id, lod.out_num, lod.out_type, lod.create_by, lod.create_time, lod.update_by, lod.update_time, lod.remark, lod.company_id, lod.car_code, lod.push_notifications from lease_out_details lod 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, car_code, push_notifications, #{parentId}, #{typeId}, #{maId}, #{outNum}, #{outType}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, #{companyId}, #{carCode}, #{pushNotifications}, update lease_out_details parent_id = #{parentId}, type_id = #{typeId}, ma_id = #{maId}, out_num = #{outNum}, out_type = #{outType}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, company_id = #{companyId}, car_code = #{carCode}, push_notifications = #{pushNotifications}, where id = #{id} delete from lease_out_details where id = #{id} delete from lease_out_details where id in #{id} update tm_task set task_status = #{status}, update_time = NOW() where task_id = #{taskId} insert into lease_out_details parent_id, type_id, ma_id, out_num, out_type, create_by, update_by, remark, company_id, car_code, create_time, update_time #{parentId}, #{typeId}, #{maId}, #{outNum}, #{outType}, #{createBy}, #{updateBy}, #{remark}, #{companyId}, #{carCode}, 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 slt_agreement_info set num = #{num}, update_time = now() where id = #{id} 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,lease_type,create_time) values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},'0',#{record.companyId},#{record.leaseType},now()); 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 = '1' WHERE parent_id = #{record.parentId} and type_id = #{record.typeId} UPDATE lease_apply_details SET status = '2' WHERE parent_id = #{record.parentId} and type_id = #{record.typeId}