insert into direct_apply_info ( code, back_agreement_id, back_man, back_phone, back_remark, lease_agreement_id, lease_man, lease_phone, dir_url, status, auditor, audit_time, audit_remark, create_time ) values ( #{code}, #{backAgreementId}, #{backMan}, #{backPhone}, #{backRemark}, #{leaseAgreementId}, #{leaseMan}, #{leasePhone}, #{dirUrl}, #{status}, #{auditor}, #{auditTime}, #{auditRemark}, NOW() ) insert into direct_apply_details(direct_id,type_id,ma_id,direct_num) values (#{directId},#{typeId},#{maId}, #{directNum}) insert into lease_apply_info code, task_id, lease_person, phone, `type`, company_audit_by, company_audit_time, company_audit_remark, dept_audit_by, dept_audit_time, dept_audit_remark, create_by, create_time, update_by, update_time, remark, company_id, #{code,jdbcType=VARCHAR}, #{taskId,jdbcType=INTEGER}, #{leasePerson,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{companyAuditBy,jdbcType=INTEGER}, #{companyAuditTime,jdbcType=VARCHAR}, #{companyAuditRemark,jdbcType=VARCHAR}, #{deptAuditBy,jdbcType=INTEGER}, #{deptAuditTime,jdbcType=VARCHAR}, #{deptAuditRemark,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, insert into lease_apply_details (parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by, update_time, remark, company_id) values (#{item.parenntId,jdbcType=INTEGER}, #{item.typeId,jdbcType=INTEGER}, #{item.preNum,jdbcType=FLOAT}, #{item.alNum,jdbcType=FLOAT}, #{item.status,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, NOW(), #{item.updateBy,jdbcType=VARCHAR}, NOW(), #{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}) 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 direct_apply_info set status = #{status} where id = #{id} 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} delete from lease_user_book where id in #{id}