id, prid, order_no, aid, aname, `type`, type_other, `status`, process_status, total_amount,
attachment_url, apply_dep, pay_dep, eaaid, create_time, district_name, user_names,
release_start, release_end, duration, examine_name, settlement_amount, debit_id,
target_type, liquidation_status, remarks, check_no, expense_main, real_amount, secondary_type,
secondary_type_other, amount, approval
delete from expense_account
where id = #{id,jdbcType=INTEGER}
insert into expense_account (prid, order_no, aid,
aname, `type`, type_other,
`status`, process_status, total_amount,
attachment_url, apply_dep, pay_dep,
eaaid, create_time, district_name,
user_names, release_start, release_end,
duration, examine_name, settlement_amount,
debit_id, target_type, liquidation_status,
remarks, check_no, expense_main,
real_amount, secondary_type, secondary_type_other,
amount, approval)
values (#{prid,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
#{aname,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{typeOther,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{processStatus,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL},
#{attachmentUrl,jdbcType=VARCHAR}, #{applyDep,jdbcType=VARCHAR}, #{payDep,jdbcType=VARCHAR},
#{eaaid,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{districtName,jdbcType=VARCHAR},
#{userNames,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP},
#{duration,jdbcType=DOUBLE}, #{examineName,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL},
#{debitId,jdbcType=INTEGER}, #{targetType,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER},
#{remarks,jdbcType=VARCHAR}, #{checkNo,jdbcType=VARCHAR}, #{expenseMain,jdbcType=INTEGER},
#{realAmount,jdbcType=DECIMAL}, #{secondaryType,jdbcType=INTEGER}, #{secondaryTypeOther,jdbcType=VARCHAR},
#{amount,jdbcType=DECIMAL}, #{approval,jdbcType=INTEGER})
insert into expense_account
prid,
order_no,
aid,
aname,
`type`,
type_other,
`status`,
process_status,
total_amount,
attachment_url,
apply_dep,
pay_dep,
eaaid,
create_time,
district_name,
user_names,
release_start,
release_end,
duration,
examine_name,
settlement_amount,
debit_id,
target_type,
liquidation_status,
remarks,
check_no,
expense_main,
real_amount,
secondary_type,
secondary_type_other,
amount,
approval,
#{prid,jdbcType=INTEGER},
#{orderNo,jdbcType=VARCHAR},
#{aid,jdbcType=VARCHAR},
#{aname,jdbcType=VARCHAR},
#{type,jdbcType=INTEGER},
#{typeOther,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER},
#{processStatus,jdbcType=INTEGER},
#{totalAmount,jdbcType=DECIMAL},
#{attachmentUrl,jdbcType=VARCHAR},
#{applyDep,jdbcType=VARCHAR},
#{payDep,jdbcType=VARCHAR},
#{eaaid,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{districtName,jdbcType=VARCHAR},
#{userNames,jdbcType=VARCHAR},
#{releaseStart,jdbcType=TIMESTAMP},
#{releaseEnd,jdbcType=TIMESTAMP},
#{duration,jdbcType=DOUBLE},
#{examineName,jdbcType=VARCHAR},
#{settlementAmount,jdbcType=DECIMAL},
#{debitId,jdbcType=INTEGER},
#{targetType,jdbcType=INTEGER},
#{liquidationStatus,jdbcType=INTEGER},
#{remarks,jdbcType=VARCHAR},
#{checkNo,jdbcType=VARCHAR},
#{expenseMain,jdbcType=INTEGER},
#{realAmount,jdbcType=DECIMAL},
#{secondaryType,jdbcType=INTEGER},
#{secondaryTypeOther,jdbcType=VARCHAR},
#{amount,jdbcType=DECIMAL},
#{approval,jdbcType=INTEGER},
update expense_account
prid = #{prid,jdbcType=INTEGER},
order_no = #{orderNo,jdbcType=VARCHAR},
aid = #{aid,jdbcType=VARCHAR},
aname = #{aname,jdbcType=VARCHAR},
`type` = #{type,jdbcType=INTEGER},
type_other = #{typeOther,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
process_status = #{processStatus,jdbcType=INTEGER},
total_amount = #{totalAmount,jdbcType=DECIMAL},
attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
apply_dep = #{applyDep,jdbcType=VARCHAR},
pay_dep = #{payDep,jdbcType=VARCHAR},
eaaid = #{eaaid,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
district_name = #{districtName,jdbcType=VARCHAR},
user_names = #{userNames,jdbcType=VARCHAR},
release_start = #{releaseStart,jdbcType=TIMESTAMP},
release_end = #{releaseEnd,jdbcType=TIMESTAMP},
duration = #{duration,jdbcType=DOUBLE},
examine_name = #{examineName,jdbcType=VARCHAR},
settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
debit_id = #{debitId,jdbcType=INTEGER},
target_type = #{targetType,jdbcType=INTEGER},
liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
remarks = #{remarks,jdbcType=VARCHAR},
check_no = #{checkNo,jdbcType=VARCHAR},
expense_main = #{expenseMain,jdbcType=INTEGER},
real_amount = #{realAmount,jdbcType=DECIMAL},
secondary_type = #{secondaryType,jdbcType=INTEGER},
secondary_type_other = #{secondaryTypeOther,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL},
approval = #{approval,jdbcType=INTEGER},
where id = #{id,jdbcType=INTEGER}
update expense_account
set prid = #{prid,jdbcType=INTEGER},
order_no = #{orderNo,jdbcType=VARCHAR},
aid = #{aid,jdbcType=VARCHAR},
aname = #{aname,jdbcType=VARCHAR},
`type` = #{type,jdbcType=INTEGER},
type_other = #{typeOther,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
process_status = #{processStatus,jdbcType=INTEGER},
total_amount = #{totalAmount,jdbcType=DECIMAL},
attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
apply_dep = #{applyDep,jdbcType=VARCHAR},
pay_dep = #{payDep,jdbcType=VARCHAR},
eaaid = #{eaaid,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
district_name = #{districtName,jdbcType=VARCHAR},
user_names = #{userNames,jdbcType=VARCHAR},
release_start = #{releaseStart,jdbcType=TIMESTAMP},
release_end = #{releaseEnd,jdbcType=TIMESTAMP},
duration = #{duration,jdbcType=DOUBLE},
examine_name = #{examineName,jdbcType=VARCHAR},
settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
debit_id = #{debitId,jdbcType=INTEGER},
target_type = #{targetType,jdbcType=INTEGER},
liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
remarks = #{remarks,jdbcType=VARCHAR},
check_no = #{checkNo,jdbcType=VARCHAR},
expense_main = #{expenseMain,jdbcType=INTEGER},
real_amount = #{realAmount,jdbcType=DECIMAL},
secondary_type = #{secondaryType,jdbcType=INTEGER},
secondary_type_other = #{secondaryTypeOther,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL},
approval = #{approval,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
a.id, a.prid, a.order_no orderNo, o.contract_no contractNo ,tm.buyer_name buyerName, a.aid, a.aname, a.`type`,
a.type_other typeOther , a.status,a.process_status processStatus,a.total_amount totalAmount,a.debit_id debitId,
a.attachment_url attachmentUrl,a.apply_dep applyDep, a.pay_dep payDep, a.eaaid,a.district_name districtName,a.approval,
a.user_names userNames,a.create_time, a.release_start,a.release_end, a.duration,b.name applyDepName,a.amount,
c.name payDepName,d.name ,d.bank ,d.accounts ,a.settlement_amount settlementAmount,a.secondary_type secondaryType,
a.liquidation_status liquidationStatus, a.remarks,a.check_no checkNo,a.secondary_type_other secondaryTypeOther,
a.create_time createTime, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,pr.type publicReleaseType,
date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStartStr,
date_format(a.release_end,'%Y-%m-%d %H:%i:%S')releaseEndStr
FROM expense_account a left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
left join expense_account_private d on a.eaaid=d.id left join t_order_new o on a.order_no =o.order_no
left join t_order_mid tm on a.order_no =tm.order_no left join public_release pr on a.prid=pr.id
where 1=1
and a.process_status>0
and a.process_status =eae.`type`
and a.process_status >eae.`type`
and f.finance_id = #{auditor}
and a.process_status> 1
and a.status in (1,2)
and a.process_status= 2
and a.status=1
and a.process_status> 2
and a.status in (1,2)
and f.finance_id in (select id from admin where superior_id = #{auditor})
and a.status=1
and a.status in (2)
and a.aid= #{aid}
and a.status= #{status}
and mea.check_no like concat('%',#{checkNo},'%')
and a.check_no like concat('%',#{checkNo},'%')
and a.user_names like concat('%',#{username},'%')
and a.create_time between #{startTime} and #{endTime}
and d.department_id = #{depId}
and e.contract_no like concat('%',#{contractNo},'%')
and a.apply_dep = #{applyDep}
and a.pay_dep = #{payDep}
and a.expense_main= #{expenseMain}
and a.secondary_type= #{secondaryType}
update expense_account
set status= #{status}
where id in
#{item.id}
update expense_relationship a ,expense_account b
set b.status= #{status}
where a.id= #{id} and a.ea_id=b.id
update expense_account x ,(select b.id,sum(c.real_amount) amount
from expense_account_details a left join expense_account b on a.eaid =b.id
left join expense_account_details c on b.id =c.eaid
where a.id= #{id} group by b.id)y
set x.real_amount =y.amount
where x.id=y.id;
update expense_account x ,( select a.id,sum(c.real_amount)amount
from expense_account a left join expense_relationship b on a.id=b.id
left join expense_account c on b.ea_id =c.id
where a.id in(select c.id
from expense_account_details a left join expense_account b on a.eaid =b.id
left join expense_relationship c on b.id =c.ea_id
where a.id= #{id}) group by a.id)y
set x.real_amount =y.amount
where x.id=y.id
update expense_account
set debit_id=null,settlement_amount=0
where id= #{id}
update expense_relationship a left join expense_account b on a.id =b.id
left join expense_account c on a.ea_id =c.id
set c.status =b.status ,c.process_status =b.process_status
where a.id= #{id}
where 1=1 and b.expense_main =1 and b.status < 4
and b.check_no like concat('%',#{checkNo},'%')
and b.status = #{status}
and b.aid = #{aid}
and b.status >=0
and b.status =2
and b.process_status =eae.type
and eae.status=0
and b.process_status >= eae.type
and eae.status=1
and b.create_time between #{startTime} and #{endTime}
and ea2.user_names like concat('%',#{username},'%')
and mea.status = #{status}
and a.aid= #{aid}
and ad.department_id in
#{dep}
and dep.expense_finance_id = #{current}
and (dep.expense_finance_id in (select id from admin where superior_id = #{current}) or dep.expense_finance_id = #{current})
and o.contract_no like concat('%',#{contractNo},'%')
and tm.buyer_name like concat('%','buyerName','%')
and ead.`type` = #{type}
and mea.aname like concat('%',#{aname},'%')
and mea.apply_dep =#{applyDep}
and mea.pay_dep =#{payDep}
and mea.create_time between #{startTime} and #{endTime}
and mea.check_no like concat('%',#{checkNo},'%')
update expense_account a
set a.type_other = #{types}
where a.id in (select id from expense_relationship where ea_id = #{id} )