|
@@ -824,19 +824,21 @@
|
|
|
c.id sonId,c.total_amount sonTotalAmount,c.settlement_amount sonSettlementAmount,c.amount sonAmount,c.`type` sonType,c.type_other sonTypeOTher,
|
|
c.id sonId,c.total_amount sonTotalAmount,c.settlement_amount sonSettlementAmount,c.amount sonAmount,c.`type` sonType,c.type_other sonTypeOTher,
|
|
|
c.user_names ,c.release_start ,c.release_end, c.attachment_url attachmentUrl,c.secondary_type,c.secondary_type_other
|
|
c.user_names ,c.release_start ,c.release_end, c.attachment_url attachmentUrl,c.secondary_type,c.secondary_type_other
|
|
|
from expense_relationship a
|
|
from expense_relationship a
|
|
|
- left join expense_account b on a.id =b.id
|
|
|
|
|
|
|
+ left join expense_account b on a.id =b.id left join expense_relationship er on er.id=b.id
|
|
|
|
|
+ left join expense_account ea2 on ea2.id=er.ea_id
|
|
|
left join department dep on b.apply_dep =dep.id left join department dep2 on b.pay_dep =dep2.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 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
|
|
left join admin ad on b.aid=ad.id left join department adDep on ad.department_id=adDep.id
|
|
|
<if test="roleType == 1">
|
|
<if test="roleType == 1">
|
|
|
- inner join (select eaid ,auditor,min(process_status)`type` from expense_account_examine
|
|
|
|
|
- where auditor= #{aid} group by eaid) eae on b.id=eae.eaid
|
|
|
|
|
|
|
+ inner join (select eaid ,auditor,min(process_status)`type` from expense_account_examine
|
|
|
|
|
+ where auditor= #{aid} group by eaid) eae on b.id=eae.eaid
|
|
|
</if>
|
|
</if>
|
|
|
<include refid="ExpenseMainSql"/>
|
|
<include refid="ExpenseMainSql"/>
|
|
|
order by if(b.status=3,-1,b.status) ,b.create_time desc
|
|
order by if(b.status=3,-1,b.status) ,b.create_time desc
|
|
|
${page_sql}
|
|
${page_sql}
|
|
|
</select>
|
|
</select>
|
|
|
<sql id="ExpenseMainSql">
|
|
<sql id="ExpenseMainSql">
|
|
|
|
|
+
|
|
|
where 1=1 and b.expense_main =1 and b.status < 4
|
|
where 1=1 and b.expense_main =1 and b.status < 4
|
|
|
<if test="checkNo !=null">
|
|
<if test="checkNo !=null">
|
|
|
and b.check_no like concat('%',#{checkNo},'%')
|
|
and b.check_no like concat('%',#{checkNo},'%')
|
|
@@ -884,12 +886,17 @@
|
|
|
<if test="startTime !=null and endTime !=null ">
|
|
<if test="startTime !=null and endTime !=null ">
|
|
|
and b.create_time between #{startTime} and #{endTime}
|
|
and b.create_time between #{startTime} and #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="username !=null">
|
|
|
|
|
+ and ea2.user_names like concat('%',#{username},'%')
|
|
|
|
|
+ </if>
|
|
|
</sql>
|
|
</sql>
|
|
|
<select id="ExpenseMainCount" resultType="java.lang.Integer">
|
|
<select id="ExpenseMainCount" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
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
|
|
|
|
|
|
|
+ from expense_account b left join expense_relationship er on er.id=b.id
|
|
|
|
|
+ left join expense_account ea2 on ea2.id=er.ea_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 admin ad on b.aid=ad.id left join department adDep on ad.department_id=adDep.id
|
|
|
<if test="roleType == 1">
|
|
<if test="roleType == 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= #{aid} group by eaid) eae on b.id=eae.eaid
|
|
where auditor= #{aid} group by eaid) eae on b.id=eae.eaid
|