|
|
@@ -457,37 +457,42 @@
|
|
|
left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
|
|
|
</if>
|
|
|
<if test="processStatus ==1">
|
|
|
- inner join (select eaid ,auditor,min(process_status)`type` from expense_account_examine
|
|
|
+ inner join (select eaid ,auditor,min(process_status)`type` from expense_account_examine
|
|
|
where auditor= #{auditor} group by eaid) eae on a.id=eae.eaid
|
|
|
</if>
|
|
|
where 1=1
|
|
|
- <if test="processStatus ==2">
|
|
|
- and a.process_status>=0
|
|
|
- <if test="examineStatus ==1">
|
|
|
- and a.status=1
|
|
|
- </if>
|
|
|
- <if test="examineStatus ==2">
|
|
|
- and a.status=2
|
|
|
- </if>
|
|
|
+ <include refid="selectExpenseAccountSql"/>
|
|
|
+ order by a.status,a.create_time desc
|
|
|
+ <if test="page_sql !=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <sql id="selectExpenseAccountSql">
|
|
|
+ <if test="processStatus ==2">
|
|
|
+ and a.process_status>=0
|
|
|
+ <if test="examineStatus ==1">
|
|
|
+ and a.status=1
|
|
|
</if>
|
|
|
+ <if test="examineStatus ==2">
|
|
|
+ and a.status=2
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
<if test=" aid !=null">
|
|
|
- and a.aid= #{aid}
|
|
|
+ and a.aid= #{aid}
|
|
|
</if>
|
|
|
<if test="processStatus ==1">
|
|
|
and a.process_status>0
|
|
|
- <if test="examineStatus ==0">
|
|
|
- and a.process_status =eae.`type`
|
|
|
- </if>
|
|
|
+ <if test="examineStatus ==0">
|
|
|
+ and a.process_status =eae.`type`
|
|
|
+ </if>
|
|
|
<if test="examineStatus ==1">
|
|
|
and a.process_status >eae.`type`
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="processStatus ==5">
|
|
|
-
|
|
|
+ and f.finance_id in (select id from admin where superior_id = #{auditor})
|
|
|
</if>
|
|
|
- <if test="processStatus ==6">
|
|
|
|
|
|
- </if>
|
|
|
<if test="status != null">
|
|
|
and a.status= #{status}
|
|
|
</if>
|
|
|
@@ -523,12 +528,7 @@
|
|
|
<if test="secondaryType != null">
|
|
|
and a.secondary_type= #{secondaryType}
|
|
|
</if>
|
|
|
- order by a.status,a.create_time desc
|
|
|
- <if test="page_sql !=null">
|
|
|
- ${page_sql}
|
|
|
- </if>
|
|
|
-
|
|
|
- </select>
|
|
|
+ </sql>
|
|
|
<select id="selectExpenseAccountCount" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
|
from expense_account a
|
|
|
@@ -554,64 +554,7 @@
|
|
|
where auditor= #{auditor} group by eaid) eae on a.id=eae.eaid
|
|
|
</if>
|
|
|
where 1=1
|
|
|
- <if test="processStatus ==2">
|
|
|
- and a.process_status>=0
|
|
|
- <if test="examineStatus ==1">
|
|
|
- and a.status=1
|
|
|
- </if>
|
|
|
- <if test="examineStatus ==2">
|
|
|
- and a.status=2
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test=" aid !=null">
|
|
|
- and a.aid= #{aid}
|
|
|
- </if>
|
|
|
- <if test="processStatus ==1">
|
|
|
- and a.process_status>0
|
|
|
- <if test="examineStatus ==0">
|
|
|
- and a.process_status =eae.`type`
|
|
|
- </if>
|
|
|
- <if test="examineStatus ==1">
|
|
|
- and a.process_status >eae.`type`
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and a.status= #{status}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="checkNo != null " >
|
|
|
- <if test="expenseMain ==0">
|
|
|
- and mea.check_no like concat('%',#{checkNo},'%')
|
|
|
- </if>
|
|
|
- <if test="expenseMain ==1">
|
|
|
- and a.check_no like concat('%',#{checkNo},'%')
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="username != null" >
|
|
|
- and a.user_names like concat('%',#{username},'%')
|
|
|
- </if>
|
|
|
- <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="contractNo != null">
|
|
|
- and e.contract_no = #{contractNo}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="applyDep != null">
|
|
|
- and a.apply_dep = #{applyDep}
|
|
|
- </if>
|
|
|
- <if test="payDep != null">
|
|
|
- and a.pay_dep = #{payDep}
|
|
|
- </if>
|
|
|
- <if test="expenseMain != null">
|
|
|
- and a.expense_main= #{expenseMain}
|
|
|
- </if>
|
|
|
- <if test="secondaryType != null">
|
|
|
- and a.secondary_type= #{secondaryType}
|
|
|
- </if>
|
|
|
+ <include refid="selectExpenseAccountSql"/>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectExpenseAccountTotalAmount" resultType="java.lang.Integer">
|
|
|
@@ -631,63 +574,7 @@
|
|
|
where auditor= #{auditor} group by eaid) eae on a.id=eae.eaid
|
|
|
</if>
|
|
|
where 1=1
|
|
|
- <if test="processStatus ==2">
|
|
|
- and a.process_status>=0
|
|
|
- <if test="examineStatus ==1">
|
|
|
- and a.status=1
|
|
|
- </if>
|
|
|
- <if test="examineStatus ==2">
|
|
|
- and a.status=2
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test=" aid !=null">
|
|
|
- and a.aid= #{aid}
|
|
|
- </if>
|
|
|
- <if test="processStatus ==1">
|
|
|
- and a.process_status>0
|
|
|
- <if test="examineStatus ==0">
|
|
|
- and a.process_status =eae.`type`
|
|
|
- </if>
|
|
|
- <if test="examineStatus ==1">
|
|
|
- and a.process_status >eae.`type`
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and a.status= #{status}
|
|
|
- </if>
|
|
|
- <if test="checkNo != null " >
|
|
|
- <if test="expenseMain ==0">
|
|
|
- and mea.check_no like concat('%',#{checkNo},'%')
|
|
|
- </if>
|
|
|
- <if test="expenseMain ==1">
|
|
|
- and a.check_no like concat('%',#{checkNo},'%')
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="username != null" >
|
|
|
- and a.user_names like concat('%',#{username},'%')
|
|
|
- </if>
|
|
|
- <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="contractNo != null">
|
|
|
- and e.contract_no = #{contractNo}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="applyDep != null">
|
|
|
- and a.apply_dep = #{applyDep}
|
|
|
- </if>
|
|
|
- <if test="payDep != null">
|
|
|
- and a.pay_dep = #{payDep}
|
|
|
- </if>
|
|
|
- <if test="expenseMain != null">
|
|
|
- and a.expense_main= #{expenseMain}
|
|
|
- </if>
|
|
|
- <if test="secondaryType != null">
|
|
|
- and a.secondary_type= #{secondaryType}
|
|
|
- </if>
|
|
|
+ <include refid="selectExpenseAccountSql"/>
|
|
|
</select>
|
|
|
|
|
|
|