select id, 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 from lease_out_details
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
parennt_id = #{record.parentId} and type_id = #{record.typeId}
UPDATE
lease_apply_details
SET
status = '2'
WHERE
parennt_id = #{record.parentId} and type_id = #{record.typeId}