Browse Source

报销开发子报销列表新增字段

anderx 2 years ago
parent
commit
d934b516a7

+ 25 - 11
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -439,6 +439,12 @@
     f.name depName,d2.name financeName, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,a.aname,
     b.name appDepName, c.name payDepName
     from expense_account a
+    <if test="type !=null">
+      right join  (select a.id
+      from expense_account a left join expense_relationship b on a.id =b.id
+      left join expense_account c on b.ea_id =c.id
+      where c.`type` = #{type})x on a.id=x.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 left join department f on d.department_id =f.id
     left join admin d2 on f.finance_id =d2.id
@@ -479,9 +485,6 @@
     <if test="status != null">
       and a.status= #{status}
     </if>
-    <if test="type != null">
-      and a.type= #{type}
-    </if>
     <if test="checkNo != null " >
       <if test="expenseMain ==0">
         and mea.check_no like concat('%',#{checkNo},'%')
@@ -522,7 +525,14 @@
   </select>
   <select id="selectExpenseAccountCount" resultType="java.lang.Integer">
     select count(*)
-    from expense_account a left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
+    from expense_account a
+    <if test="type !=null">
+      right join  (select a.id
+      from expense_account a left join expense_relationship b on a.id =b.id
+      left join expense_account c on b.ea_id =c.id
+      where c.`type` = #{type})x on a.id=x.id
+    </if>
+    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
     <if test="processStatus ==1">
@@ -554,9 +564,7 @@
     <if test="status != null">
       and a.status= #{status}
     </if>
-    <if test="type != null">
-      and a.type= #{type}
-    </if>
+
     <if test="checkNo != null " >
       <if test="expenseMain ==0">
         and mea.check_no like concat('%',#{checkNo},'%')
@@ -594,7 +602,14 @@
 
   <select id="selectExpenseAccountTotalAmount" resultType="java.lang.Integer">
     select sum(a.total_amount) totalAmount
-    from expense_account a left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
+    from expense_account a
+    <if test="type !=null">
+      right join  (select a.id
+      from expense_account a left join expense_relationship b on a.id =b.id
+      left join expense_account c on b.ea_id =c.id
+      where c.`type` = #{type})x on a.id=x.id
+    </if>
+    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
     <if test="processStatus ==1">
@@ -626,9 +641,6 @@
     <if test="status != null">
       and a.status= #{status}
     </if>
-    <if test="type != null">
-      and a.type= #{type}
-    </if>
     <if test="checkNo != null " >
       <if test="expenseMain ==0">
         and mea.check_no like concat('%',#{checkNo},'%')
@@ -751,6 +763,7 @@
            dep.name applyDepName,dep2.name payDepName, b.remarks,b.eaaid ,eap.name ,eap.bank ,eap.accounts ,b.status,b.process_status,
            c.id sonId,c.total_amount sonAmount,c.`type` ,c.type_other ,c.user_names ,c.release_start ,c.release_end ,
            c.district_name districtName,c.user_names userNames,c.secondary_type ,c.secondary_type_other,c.attachment_url,
+           c.duration,
            d.id detId,d.`type` detType,d.amount,d.real_amount realAmount ,d.start_district ,d.end_district,d.vehicle,d.vehicle_other,
            d.pay_type ,d.invoice_type ,d.invoice_no,d.payer_name ,d.open_bank ,d.bank_accounts ,d.open_bank_address
     from expense_relationship a left join expense_account b on a.id =b.id
@@ -801,6 +814,7 @@
     <result column="release_start" jdbcType="VARCHAR" property="releaseStart" />
     <result column="release_end" jdbcType="VARCHAR" property="releaseEnd" />
     <result column="districtName" jdbcType="VARCHAR" property="districtName" />
+    <result column="duration" jdbcType="VARCHAR" property="duration" />
     <association property="detList" resultMap="ExpenseAccountDetailsMap"></association>
   </resultMap>
 

+ 9 - 0
src/main/java/com/goafanti/expenseAccount/bo/SonExpenseAccount.java

@@ -15,8 +15,17 @@ public class SonExpenseAccount {
     private Integer secondaryType;
     private String secondaryTypeOther;
     private String attachmentUrl;
+    private String duration;
     private List<SonExpenseAccountDetails> detList;
 
+    public String getDuration() {
+        return duration;
+    }
+
+    public void setDuration(String duration) {
+        this.duration = duration;
+    }
+
     public Integer getSecondaryType() {
         return secondaryType;
     }