|
|
@@ -1009,8 +1009,8 @@
|
|
|
|
|
|
|
|
|
<select id="ExpenseDetailsList" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountDetailsList">
|
|
|
- select mea.check_no ,ead.`type`,ead.amount ,ead.real_amount ,o.contract_no ,dep.name applyDepName,
|
|
|
- dep2.name payDepName ,mea.aname ,ad2.name financeName,mea.status ,mea.process_status ,mea.id mainId,
|
|
|
+ select mea.check_no checkNo ,ead.`type`,ead.amount ,ead.real_amount realAmount ,o.contract_no contractNo ,dep.name applyDepName,
|
|
|
+ dep2.name payDepName ,mea.aname ,ad2.name financeName,mea.status ,mea.process_status processStatus ,mea.id mainId,
|
|
|
tm.buyer_name buyerName ,date_format(mea.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr
|
|
|
from expense_account_details ead left join expense_account a on ead.eaid =a.id
|
|
|
left join expense_relationship er on a.id=er.ea_id left join expense_account mea on er.id=mea.id
|
|
|
@@ -1019,6 +1019,10 @@
|
|
|
left join department dep2 on mea.pay_dep =dep2.id left join admin ad on mea.aid=ad.id
|
|
|
left join department dep3 on ad.department_id =dep3.id left join admin ad2 on dep3.finance_id =ad2.id
|
|
|
where 1=1
|
|
|
+ <include refid="ExpenseDetailsSql"/>
|
|
|
+ ${page_sql}
|
|
|
+ </select>
|
|
|
+ <sql id="ExpenseDetailsSql">
|
|
|
<if test=" status != null">
|
|
|
and mea.status = #{status}
|
|
|
</if>
|
|
|
@@ -1028,6 +1032,12 @@
|
|
|
#{dep}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="roleType ==1">
|
|
|
+ and dep.finance_id = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="roleType ==2">
|
|
|
+ and dep.finance_id in (select id from admin where superior_id = #{aid})
|
|
|
+ </if>
|
|
|
<if test=" contractNo != null">
|
|
|
and o.contract_no like concat('%',#{contractNo},'%')
|
|
|
</if><if test=" buyerName != null">
|
|
|
@@ -1045,8 +1055,7 @@
|
|
|
</if><if test=" checkNo != null">
|
|
|
and mea.check_no like concat('%',#{checkNo},'%')
|
|
|
</if>
|
|
|
- ${page_sql}
|
|
|
- </select>
|
|
|
+ </sql>
|
|
|
<select id="ExpenseDetailsCount" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
|
from expense_account_details ead left join expense_account a on ead.eaid =a.id
|
|
|
@@ -1056,32 +1065,7 @@
|
|
|
left join department dep2 on mea.pay_dep =dep2.id left join admin ad on mea.aid=ad.id
|
|
|
left join department dep3 on ad.department_id =dep3.id left join admin ad2 on dep3.finance_id =ad2.id
|
|
|
where 1=1
|
|
|
- <if test=" status != null">
|
|
|
- and mea.status = #{status}
|
|
|
- </if>
|
|
|
- <if test="deps !=null">
|
|
|
- and ad.department_id in
|
|
|
- <foreach collection="deps" item="dep" open="(" close=")" separator=",">
|
|
|
- #{dep}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test=" contractNo != null">
|
|
|
- and o.contract_no like concat('%',#{contractNo},'%')
|
|
|
- </if><if test=" buyerName != null">
|
|
|
- and tm.buyer_name like concat('%','buyerName','%')
|
|
|
- </if><if test=" type != null">
|
|
|
- and ead.`type` = #{type}
|
|
|
- </if><if test=" aname != null">
|
|
|
- and mea.aname like concat('%',#{aname},'%')
|
|
|
- </if><if test=" applyDep != null">
|
|
|
- and mea.apply_dep =#{applyDep}
|
|
|
- </if><if test=" payDep != null">
|
|
|
- and mea.pay_dep =#{payDep}
|
|
|
- </if><if test=" startTime != null and endTime !=null">
|
|
|
- and mea.create_time between #{startTime} and #{endTime}
|
|
|
- </if><if test=" checkNo != null">
|
|
|
- and mea.check_no like concat('%',#{checkNo},'%')
|
|
|
- </if>
|
|
|
+ <include refid="ExpenseDetailsSql"/>
|
|
|
</select>
|
|
|
<select id="selectCountByIdsAndType" resultType="java.lang.Integer">
|
|
|
select count(*) from expense_account
|