left join sys_user u on u.user_id=a.create_by
left join sys_user u2 on u2.user_id=a.exp_receive_user_id
left join sys_dept d on u.dept_id = d.dept_id
select a.exp_id, a.exp_code, a.exp_pq_number, a.exp_number, a.exp_bid_number, a.exp_expenditure_mode, a.exp_customer_bm,
a.exp_customer_name, a.exp_expenditure_people, a.exp_project, a.exp_return_date,
a.exp_expenditure_type, a.exp_expenditure_amount, a.exp_lk_amount, a.exp_bid_area, a.exp_expenditure_date,
a.exp_expenditure_amount_uppercase, a.exp_staff_tureorfales, a.exp_back_office,a.exp_back_office_id,
a.exp_salesman_code, a.exp_salesman_bm, a.exp_salesman_name, a.exp_salesman_dept_id,
a.exp_salesman_dept_name, a.exp_dispatch_status, a.exp_account_name, a.exp_account_number,
a.exp_deposit_bank, a.exp_line_number_and_othres, a.exp_request_remark,a.exp_cash_deposit,a.exp_lxr, a.exp_lxrdh,
a.exp_return_remark,a.exp_approval_status, a.exp_oa_approval_status,a.exp_oa_remark, a.exp_receive_user_id,
u2.nick_name exp_receive_user_nick_name,
a.create_by, a.create_time, a.update_by, a.update_time
from expenses a
insert into expenses
exp_id,
exp_code,
exp_number,
exp_pq_number,
exp_bid_number,
exp_expenditure_mode,
exp_customer_bm,
exp_customer_name,
exp_expenditure_people,
exp_project,
exp_return_date,
exp_expenditure_type,
exp_expenditure_amount,
exp_lk_amount,
exp_bid_area,
exp_expenditure_date,
exp_expenditure_amount_uppercase,
exp_staff_tureorfales,
exp_back_office,
exp_back_office_id,
exp_salesman_code,
exp_salesman_bm,
exp_salesman_name,
exp_salesman_dept_id,
exp_salesman_dept_name,
exp_dispatch_status,
exp_account_name,
exp_account_number,
exp_deposit_bank,
exp_line_number_and_othres,
exp_request_remark,
exp_cash_deposit,
exp_lxr,
exp_lxrdh,
exp_return_remark,
exp_approval_status,
exp_oa_approval_status,
exp_oa_remark,
exp_receive_user_id,
exp_receive_user_nick_name,
create_by,
create_time,
update_by,
update_time,
#{expId},
#{expCode},
#{expNumber},
#{expPqNumber},
#{expBidNumber},
#{expExpenditureMode},
#{expCustomerBm},
#{expCustomerName},
#{expExpenditurePeople},
#{expProject},
#{expReturnDate},
#{expExpenditureType},
#{expExpenditureAmount},
#{expLkAmount},
#{expBidArea},
#{expExpenditureDate},
#{expExpenditureAmountUppercase},
#{expStaffTureorfales},
#{expBackOffice},
#{expBackOfficeId},
#{expSalesmanCode},
#{expSalesmanBm},
#{expSalesmanName},
#{expSalesmanDeptId},
#{expSalesmanDeptName},
#{expDispatchStatus},
#{expAccountName},
#{expAccountNumber},
#{expDepositBank},
#{expLineNumberAndOthres},
#{expRequestRemark},
#{expCashDeposit},
#{expLxr},
#{expLxrdh},
#{expReturnRemark},
#{expApprovalStatus},
#{expOaApprovalStatus},
#{expOaRemark},
#{expReceiveUserId},
#{expReceiveUserNickName},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
insert into sys_oa_expenses
user_id,
department_id,
submission_time,
exp_id,
exp_code,
exp_number,
exp_bid_number,
exp_expenditure_mode,
exp_customer_name,
exp_expenditure_people,
exp_project,
exp_return_date,
exp_expenditure_type,
exp_expenditure_amount,
exp_expenditure_amount_uppercase,
exp_bid_area,
exp_expenditure_date,
exp_staff_tureorfales,
exp_back_office_id,
exp_oa_userId,
exp_oa_departmentId,
exp_account_name,
exp_account_number,
exp_deposit_bank,
exp_line_number_and_othres,
exp_request_remark,
exp_cash_deposit,
exp_lxr,
exp_lxrdh,
file_address,
create_time,
isFinish,
#{userId},
#{departmentId},
#{submissionTime},
#{expId},
#{expCode},
#{expNumber},
#{expBidNumber},
#{expExpenditureMode},
#{expCustomerName},
#{expExpenditurePeople},
#{expProject},
#{expReturnDate},
#{expExpenditureType},
#{expExpenditureAmount},
#{expExpenditureAmountUppercase},
#{expBidArea},
#{expExpenditureDate},
#{expStaffTureorfales},
#{expBackOfficeId},
#{oaUserId},
#{oaDepartmentId},
#{expAccountName},
#{expAccountNumber},
#{expDepositBank},
#{expLineNumberAndOthres},
#{expRequestRemark},
#{expCashDeposit},
#{expLxr},
#{expLxrdh},
#{fileAddress},
#{createTime},
#{isFinish},
update expenses
exp_code = #{expCode},
exp_pq_number = #{expPqNumber},
exp_number = #{expNumber},
exp_bid_number = #{expBidNumber},
exp_expenditure_mode = #{expExpenditureMode},
exp_customer_bm = #{expCustomerBm},
exp_customer_name = #{expCustomerName},
exp_expenditure_people = #{expExpenditurePeople},
exp_project = #{expProject},
exp_return_date = #{expReturnDate},
exp_expenditure_type = #{expExpenditureType},
exp_expenditure_amount = #{expExpenditureAmount},
exp_lk_amount = #{expLkAmount},
exp_bid_area = #{expBidArea},
exp_expenditure_date = #{expExpenditureDate},
exp_expenditure_amount_uppercase = #{expExpenditureAmountUppercase},
exp_staff_tureorfales = #{expStaffTureorfales},
exp_back_office = #{expBackOffice},
exp_back_office_id = #{expBackOfficeId},
exp_salesman_code = #{expSalesmanCode},
exp_salesman_bm = #{expSalesmanBm},
exp_salesman_name = #{expSalesmanName},
exp_salesman_dept_id = #{expSalesmanDeptId},
exp_salesman_dept_name = #{expSalesmanDeptName},
exp_dispatch_status = #{expDispatchStatus},
exp_account_name = #{expAccountName},
exp_account_number = #{expAccountNumber},
exp_deposit_bank = #{expDepositBank},
exp_line_number_and_othres = #{expLineNumberAndOthres},
exp_request_remark = #{expRequestRemark},
exp_cash_deposit = #{expCashDeposit},
exp_lxr = #{expLxr},
exp_lxrdh = #{expLxrdh},
exp_return_remark = #{expReturnRemark},
exp_approval_status = #{expApprovalStatus},
exp_oa_approval_status = #{expOaApprovalStatus},
exp_oa_remark = #{expOaRemark},
exp_receive_user_id = #{expReceiveUserId},
exp_receive_user_nick_name = #{expReceiveUserNickName},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
where exp_id = #{expId}
delete from expenses where exp_id = #{expId}
delete from expenses where exp_id in
#{expId}
delete from expenses_lkdetail where exp_id = #{expId}
insert into expenses_lkdetail( exp_lk_id, pz, pzDate, year,customerBm, customerName, salesmanBm,salesmanName, amount,checkAmount,remark,exp_id) values
( #{item.expLkId}, #{item.pz}, #{item.pzDate}, #{item.year}, #{item.customerBm}, #{item.customerName}, #{item.salesmanBm}, #{item.salesmanName}, cast(#{item.amount,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.checkAmount,jdbcType=DECIMAL} as decimal(18,3)),#{item.remark}, #{item.expId})