Преглед изворни кода

fix: 解析邮件增加发件时间和解析时间排序

chenjianhua пре 6 месеци
родитељ
комит
3ac8420d30

+ 28 - 0
service-base/src/main/java/com/simuwang/base/common/support/query/PageQuery.java

@@ -22,6 +22,18 @@ public class PageQuery extends BaseQuery {
      * 当前页记录开始
      */
     private Long offset;
+
+
+    /**
+     * 新排序字段
+     */
+    private String sort;
+
+    /**
+     * 新排序方式,DESC降序,ASC升序
+     */
+    private String order;
+
     /**
      * 排序字段
      */
@@ -56,6 +68,22 @@ public class PageQuery extends BaseQuery {
         this.orderItems = orderItems;
     }
 
+    public void setSort(String sort) {
+        this.sort = sort;
+    }
+
+    public void setOrder(String order) {
+        this.order = order;
+    }
+
+    public String getSort() {
+        return sort;
+    }
+
+    public String getOrder() {
+        return order;
+    }
+
     public Long getOffset() {
         return (current - 1) * pageSize;
     }

+ 11 - 1
service-base/src/main/resources/mapper/EmailParseInfoMapper.xml

@@ -92,7 +92,17 @@
     <select id="searchEmailList" resultMap="BaseResultMap">
         <include refid="selectEmailParse"/>
         <include refid="sqlwhereSearch"/>
-        order by epi.parse_date desc
+        <choose>
+            <when test="sort != null and sort !='' and sort=='parseDate' and order != null and order !=''">
+                order by epi.parse_date ${order}
+            </when>
+            <when test="sort != null and sort !='' and sort=='emailDate'  and order != null and order !=''">
+                order by epi.email_date ${order}
+            </when>
+            <otherwise>
+                order by epi.parse_date desc
+            </otherwise>
+        </choose>
      limit #{offset},#{pageSize}
     </select>
     <select id="searchEmailById" resultMap="BaseResultMap">

+ 2 - 2
service-manage/src/main/java/com/simuwang/manage/api/email/ParseEmailController.java

@@ -70,11 +70,11 @@ public class ParseEmailController{
     }
 
     /**
-     * 邮箱配置页面展示查询
+     * 解析页面展示查询
      * @param emailParseQuery
      * @return
      */
-    @SystemLog(value = "邮箱配置页面展示查询")
+    @SystemLog(value = "解析页面展示查询")
     @GetMapping("/search-email-list")
     public MybatisPage<EmailParseInfoVO> searchEmailList(EmailParseQuery emailParseQuery){
         MybatisPage<EmailParseInfoVO> result = parseEmailService.searchEmailList(emailParseQuery);