|
|
@@ -295,12 +295,10 @@
|
|
|
|
|
|
<select id="selectExpenseAccountList" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountBo">
|
|
|
select a.id,a.total_amount totalAmount,a.`type`,a.process_status processStatus,a.status,a.examine_name examineName,
|
|
|
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,a.aname,
|
|
|
- b.name appDepName, c.name payDepName,
|
|
|
+ date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,a.aname, b.name appDepName, c.name payDepName
|
|
|
from expense_account a left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
|
|
|
- <if test="processStatus ==1">
|
|
|
- left join admin b on a.aid =b.id
|
|
|
- </if>
|
|
|
+ left join admin d on a.aid =d.id left join t_order_new e on a.order_no =e.order_no
|
|
|
+ left join t_order_mid tm on a.order_no =tm.order_no
|
|
|
where 1=1
|
|
|
<if test="processStatus ==0">
|
|
|
and a.aid= #{aid}
|
|
|
@@ -308,7 +306,7 @@
|
|
|
<if test="processStatus ==1">
|
|
|
and a.process_status>0
|
|
|
and a.status =1
|
|
|
- and b.superior_id =#{aid}
|
|
|
+ and d.superior_id =#{aid}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
and a.status= #{status}
|
|
|
@@ -316,6 +314,21 @@
|
|
|
<if test="startTime !=null and endTime !=null">
|
|
|
and a.create_time between #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
+ <if test="depId != null">
|
|
|
+ and d.department_id = #{depId}
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ and a.order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="username != null">
|
|
|
+ and tm.buyer_name = #{username}
|
|
|
+ </if>
|
|
|
+ <if test="applyDep != null">
|
|
|
+ and a.apply_dep = #{applyDep}
|
|
|
+ </if>
|
|
|
+ <if test="payDep != null">
|
|
|
+ and a.pay_dep = #{payDep}
|
|
|
+ </if>
|
|
|
order by a.create_time desc
|
|
|
<if test="page_sql !=null">
|
|
|
${page_sql}
|
|
|
@@ -324,10 +337,9 @@
|
|
|
</select>
|
|
|
<select id="selectExpenseAccountCount" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
|
- from expense_account a
|
|
|
- <if test="processStatus ==1">
|
|
|
- left join admin b on a.aid =b.id
|
|
|
- </if>
|
|
|
+ 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 admin d on a.aid =d.id left join t_order_new e on a.order_no =e.order_no
|
|
|
+ left join t_order_mid tm on a.order_no =tm.order_no
|
|
|
where 1=1
|
|
|
<if test="processStatus ==0">
|
|
|
and a.aid= #{aid}
|
|
|
@@ -335,7 +347,7 @@
|
|
|
<if test="processStatus ==1">
|
|
|
and a.process_status>0
|
|
|
and a.status =1
|
|
|
- and b.superior_id =#{aid}
|
|
|
+ and d.superior_id =#{aid}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
and a.status= #{status}
|
|
|
@@ -343,6 +355,21 @@
|
|
|
<if test="startTime !=null and endTime !=null">
|
|
|
and a.create_time between #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
+ <if test="depId != null">
|
|
|
+ and d.department_id = #{depId}
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ and a.order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="username != null">
|
|
|
+ and tm.buyer_name = #{username}
|
|
|
+ </if>
|
|
|
+ <if test="applyDep != null">
|
|
|
+ and a.apply_dep = #{applyDep}
|
|
|
+ </if>
|
|
|
+ <if test="payDep != null">
|
|
|
+ and a.pay_dep = #{payDep}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="selectByaidAndPrid" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccount">
|
|
|
SELECT
|