|
|
@@ -811,10 +811,10 @@
|
|
|
left join department adDep on ad .department_id=adDep.id
|
|
|
where 1=1 and b.expense_main =1
|
|
|
<if test=" status != null">
|
|
|
- and b.status = #{status}
|
|
|
+ and b.status = #{status}
|
|
|
</if>
|
|
|
<if test="listStatus ==0">
|
|
|
- and b.status in(0,1,3)
|
|
|
+ and b.status in(0,1,3)
|
|
|
</if>
|
|
|
<if test="listStatus ==1">
|
|
|
and b.status =2
|
|
|
@@ -823,7 +823,7 @@
|
|
|
and b.aid = #{aid}
|
|
|
</if>
|
|
|
<if test="roleType == 1">
|
|
|
- and b.process_status > 0
|
|
|
+ and b.process_status > 0
|
|
|
and ad.superior_id= #{aid}
|
|
|
</if>
|
|
|
<if test="roleType == 2">
|
|
|
@@ -874,4 +874,84 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ <select id="ExpenseDetailsList" resultMap="MainMap">
|
|
|
+ select b.id,b.check_no,b.total_amount,b.order_no,o.contract_no,b.aname,b.apply_dep,b.pay_dep,
|
|
|
+ date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,b.status,b.process_status,
|
|
|
+ dep.name applyDepName,dep2.name payDepName, b.remarks,b.eaaid ,
|
|
|
+ c.id sonId,c.total_amount sonAmount,c.`type` ,c.type_other ,c.user_names ,c.release_start ,c.release_end
|
|
|
+ from expense_relationship a
|
|
|
+ left join expense_account b on a.id =b.id
|
|
|
+ left join department dep on b.apply_dep =dep.id left join department dep2 on b.pay_dep =dep2.id
|
|
|
+ left join t_order_new o on b.order_no =o.order_no
|
|
|
+ left join expense_account c on a.ea_id =c.id
|
|
|
+
|
|
|
+ left join admin ad on b.aid=ad.id
|
|
|
+ left join department adDep on ad .department_id=adDep.id
|
|
|
+ where 1=1 and b.expense_main =1
|
|
|
+ <if test=" status != null">
|
|
|
+ and b.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="listStatus ==0">
|
|
|
+ and b.status in(0,1,3)
|
|
|
+ </if>
|
|
|
+ <if test="listStatus ==1">
|
|
|
+ and b.status =2
|
|
|
+ </if>
|
|
|
+ <if test=" roleType ==0">
|
|
|
+ and b.aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="roleType == 1">
|
|
|
+ and b.process_status > 0
|
|
|
+ and ad.superior_id= #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="roleType == 2">
|
|
|
+ and b.process_status > 1
|
|
|
+ and adDep.finance_id = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="roleType == 3">
|
|
|
+ and b.process_status > 2
|
|
|
+ and ad.department_id in
|
|
|
+ <foreach collection="deps" item="dep" open="(" close=")" separator=",">
|
|
|
+ #{dep}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ${page_sql}
|
|
|
+ </select>
|
|
|
+ <select id="ExpenseDetailsCount" resultType="java.lang.Integer">
|
|
|
+ select count(*)
|
|
|
+ from expense_account b
|
|
|
+ left join admin ad on b.aid=ad.id
|
|
|
+ left join department adDep on ad .department_id=adDep.id
|
|
|
+ where 1=1 and b.expense_main =1
|
|
|
+ <if test=" status != null">
|
|
|
+ and b.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="listStatus ==0">
|
|
|
+ and b.status in(0,1,3)
|
|
|
+ </if>
|
|
|
+ <if test="listStatus ==1">
|
|
|
+ and b.status =2
|
|
|
+ </if>
|
|
|
+ <if test=" roleType ==0">
|
|
|
+ and b.aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="roleType == 1">
|
|
|
+ and b.process_status > 0
|
|
|
+ and ad.superior_id= #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="roleType == 2">
|
|
|
+ and b.process_status > 1
|
|
|
+ and adDep.finance_id = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="roleType == 3">
|
|
|
+ and b.process_status > 2
|
|
|
+ and ad.department_id in
|
|
|
+ <foreach collection="deps" item="dep" open="(" close=")" separator=",">
|
|
|
+ #{dep}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|