From ecf9d24221102b02e15a462f295301d5fce7f9ab Mon Sep 17 00:00:00 2001
From: huanghongfa <18228131219@163.com>
Date: 星期二, 26 一月 2021 17:26:13 +0800
Subject: [PATCH] 志愿者审核

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java
index 533aaab..a1f5319 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java
@@ -53,26 +53,29 @@
 
     @Select("<script> " +
             "SELECT\n" +
-            "id,\n" +
-            "`name`,\n" +
-            "state,\n" +
-            "phone,\n" +
-            "apply_reson,\n" +
-            "create_at \n" +
+            "t.id,\n" +
+            "t.`name`,\n" +
+            "t.state,\n" +
+            "t.phone,\n" +
+            "t.apply_reson,\n" +
+            "t.create_at \n" +
             "FROM\n" +
-            "com_mng_volunteer_mng \n" +
+            "com_mng_volunteer_mng t\n" +
+            " RIGHT JOIN \n" +
+            "(select phone, MAX(create_at)create_at  from com_mng_volunteer_mng where state IN ( 1, 3 ) GROUP BY phone ) tmp \n" +
+            "on t.create_at = tmp.create_at and t.phone=tmp.phone "+
             "WHERE\n" +
             "state in (1,3)  and community_id=#{comMngVolunteerMngVO.communityId} \n" +
             "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != &quot;&quot;'>" +
-            "and name like concat(#{comMngVolunteerMngVO.name},'%')  \n" +
+            "and t.name like concat(#{comMngVolunteerMngVO.name},'%')  \n" +
             " </if> " +
             "<if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != &quot;&quot;'>" +
-            "AND phone like concat(#{comMngVolunteerMngVO.phone},'%')\n" +
+            "AND t.phone like concat(#{comMngVolunteerMngVO.phone},'%')\n" +
             " </if> " +
             "<if test='comMngVolunteerMngVO.state != null and comMngVolunteerMngVO.state != 0'>" +
-            "and state=#{comMngVolunteerMngVO.state}\n" +
+            "and t.state=#{comMngVolunteerMngVO.state}\n" +
             " </if> " +
-            " \tgroup by phone,state ORDER BY state asc " +
+            " \tORDER BY t.state asc  " +
             "</script>")
     IPage<ComMngVolunteerMngVO> pageVolunteerExamine(Page page, @Param("comMngVolunteerMngVO") ComMngVolunteerMngVO comMngVolunteerMngVO);
     @Select("SELECT\n" +

--
Gitblit v1.7.1