Browse Source

报销列表修改

anderx 2 years ago
parent
commit
baf8ae7121

+ 24 - 14
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -278,28 +278,26 @@
 
 
   <select id="selectExpenseAccountList" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountBo">
-    select a.id,a.total_amount totalAmount,a.`type`,a.process_status processStatus,
+    select a.id,a.total_amount totalAmount,a.`type`,a.process_status processStatus,a.status,
            date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr
     from expense_account a
+    <if test="processStatus ==1">
+      left join admin b on a.aid =b.id
+    </if>
     where 1=1
     <if test="processStatus ==0">
     and a.aid= #{aid}
     </if>
-    order by
-    <if test="timeSort !=null">
-      create_time
-      <if test="timeSort  == 1">
-        desc
-      </if>
-      ,
+    <if test="processStatus ==1">
+      and b.superior_id =#{aid}
     </if>
-    <if test="examineSort!=null">
-      a.status
-      <if test="examineSort == 1">
-        desc
-      </if>
-
+    <if test="status != null">
+      and a.status= #{status}
+    </if>
+    <if test="startTime !=null and endTime !=null">
+      and a.create_time between #{startTime} and #{endTime}
     </if>
+    order by a.create_time desc
     <if test="page_sql !=null">
       ${page_sql}
     </if>
@@ -308,10 +306,22 @@
   <select id="selectExpenseAccountCount" resultType="java.lang.Integer">
     select count(*)
     from expense_account a
+    <if test="processStatus ==1">
+      left join admin b on a.aid =b.id
+    </if>
     where 1=1
     <if test="processStatus ==0">
       and a.aid= #{aid}
     </if>
+    <if test="processStatus ==1">
+      and b.superior_id =#{aid}
+    </if>
+    <if test="status != null">
+      and a.status= #{status}
+    </if>
+    <if test="startTime !=null and endTime !=null">
+      and a.create_time between #{startTime} and #{endTime}
+    </if>
   </select>
   <select id="selectByaidAndPrid" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccount">
     SELECT

+ 27 - 14
src/main/java/com/goafanti/expenseAccount/bo/InputPageListBo.java

@@ -1,36 +1,49 @@
 package com.goafanti.expenseAccount.bo;
 
+import java.util.Date;
+
 public class InputPageListBo {
-    private Integer timeSort;
-    private Integer examineSort;
+    private String startTime;
+    private String endTime;
+    private Integer status;
     private Integer processStatus;
     private Integer pageNo;
     private Integer pageSize;
 
-    public Integer getProcessStatus() {
-        return processStatus;
+    public String getStartTime() {
+        return startTime;
     }
 
-    public void setProcessStatus(Integer processStatus) {
-        this.processStatus = processStatus;
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
     }
 
-    public Integer getTimeSort() {
-        return timeSort;
+    public String getEndTime() {
+        return endTime;
     }
 
-    public void setTimeSort(Integer timeSort) {
-        this.timeSort = timeSort;
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
     }
 
-    public Integer getExamineSort() {
-        return examineSort;
+    public Integer getStatus() {
+        return status;
     }
 
-    public void setExamineSort(Integer examineSort) {
-        this.examineSort = examineSort;
+    public void setStatus(Integer status) {
+        this.status = status;
     }
 
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+
+
+
     public Integer getPageNo() {
         return pageNo;
     }

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

@@ -4,6 +4,15 @@ import java.math.BigDecimal;
 
 public class OutExpenseAccountBo {
     private Integer id;private BigDecimal totalAmount;private Integer type;private Integer processStatus;private String createTimeStr;
+    private Integer status;
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
 
     public Integer getId() {
         return id;

+ 4 - 10
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -144,17 +144,11 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
 
     private void addParam(InputPageListBo in, Map<String, Object> param) {
         param.put("aid",TokenManager.getAdminId());
-        if (in.getTimeSort()!=null){
-            param.put("timeSort", in.getTimeSort());
-        }else {
-            param.put("timeSort",0);
-        }
-
-        if (in.getExamineSort()!=null){
-            param.put("examineSort", in.getExamineSort());
-        }else {
-            param.put("examineSort",0);
+        if (in.getStartTime()!=null&&in.getEndTime()!=null){
+            param.put("startTime",in.getStartTime());
+            param.put("endTime",in.getEndTime()+" 23:59:59");
         }
+        if (in.getStatus()!=null)param.put("status",in.getStatus());
         if (in.getProcessStatus()!=null){
             param.put("processStatus", in.getProcessStatus());
         }else {