From d7a8baeff8b0e68c54a959e5f46f639c54aad1d1 Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期一, 27 九月 2021 17:15:29 +0800
Subject: [PATCH] Merge branch 'test_bak' into 'master'

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java |  104 ++++++++++++++++++++++++----------------------------
 1 files changed, 48 insertions(+), 56 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 cb7d029..ae5ca54 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
@@ -1,13 +1,17 @@
 package com.panzhihua.service_community.dao;
 
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO;
+import com.panzhihua.common.model.vos.community.TodoEventsVO;
 import com.panzhihua.service_community.model.dos.ComMngVolunteerMngDO;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
 
 /**
  * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -17,58 +21,46 @@
  **/
 @Mapper
 public interface ComMngVolunteerMngDAO extends BaseMapper<ComMngVolunteerMngDO> {
-    //    @Select("<script> " +
-//            " <where>" +
-//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
-//            " </if> " +
-//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
-//            " </if> " +
-//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
-//            " </if> " +
-//            " </where>" +
-//            "</script>")
-    @Select("<script> " +
-            "SELECT\n" +
-            "id,\n" +
-            "`name`,\n" +
-            "photo_path,\n" +
-            "phone,\n" +
-            "integral,\n" +
-            "create_at \n" +
-            "FROM\n" +
-            "com_mng_volunteer_mng \n" +
-            " where state=2 and community_id=#{comMngVolunteerMngVO.communityId}" +
-            "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != &quot;&quot;'>" +
-            " and name = #{comMngVolunteerMngVO.name} \n" +
-            " </if> " +
-            "<if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != &quot;&quot;'>" +
-            "AND phone = #{comMngVolunteerMngVO.phone}" +
-            " </if> " +
-            " order by integral desc,create_at desc"+
-            "</script>")
-    IPage<ComMngVolunteerMngVO> pageVolunteer(Page page, @Param("comMngVolunteerMngVO") ComMngVolunteerMngVO comMngVolunteerMngVO);
+    // @Select("<script> " +
+    // " <where>" +
+    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
+    // " </if> " +
+    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
+    // " </if> " +
+    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
+    // " </if> " +
+    // " </where>" +
+    // "</script>")
+    @Select("<script> " + "SELECT\n" + "id,\n" + "`name`,\n" + "photo_path,\n" + "phone,\n" + "integral,\n"
+        + "create_at \n" + "FROM\n" + "com_mng_volunteer_mng \n"
+        + " where state=2 and community_id=#{comMngVolunteerMngVO.communityId}"
+        + "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != &quot;&quot;'>"
+        + " and name like concat(#{comMngVolunteerMngVO.name},'%')  \n" + " </if> "
+        + "<if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != &quot;&quot;'>"
+        + "AND phone like concat(#{comMngVolunteerMngVO.phone},'%') " + " </if> "
+        + " order by integral desc,create_at desc" + "</script>")
+    IPage<ComMngVolunteerMngVO> pageVolunteer(Page page,
+        @Param("comMngVolunteerMngVO") ComMngVolunteerMngVO comMngVolunteerMngVO);
 
-    @Select("<script> " +
-            "SELECT\n" +
-            "id,\n" +
-            "`name`,\n" +
-            "state,\n" +
-            "phone,\n" +
-            "create_at \n" +
-            "FROM\n" +
-            "com_mng_volunteer_mng \n" +
-            "WHERE\n" +
-            "state in (1,3)\n" +
-            "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != &quot;&quot;'>" +
-            "and name = #{comMngVolunteerMngVO.name} \n" +
-            " </if> " +
-            "<if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != &quot;&quot;'>" +
-            "AND phone = #{comMngVolunteerMngVO.phone}\n" +
-            " </if> " +
-            "<if test='comMngVolunteerMngVO.state != null and comMngVolunteerMngVO.state != 0'>" +
-            "and state=#{comMngVolunteerMngVO.state}\n" +
-            " </if> " +
-            "ORDER BY state asc " +
-            "</script>")
-    IPage<ComMngVolunteerMngVO> pageVolunteerExamine(Page page, @Param("comMngVolunteerMngVO") ComMngVolunteerMngVO comMngVolunteerMngVO);
+    @Select("<script> " + "SELECT\n" + "t.id,\n" + "t.`name`,\n" + "t.state,\n" + "t.phone,\n" + "t.apply_reson,\n"
+        + "t.create_at, " + "t.submit_user_id \n" + "FROM\n" + "com_mng_volunteer_mng t\n" + " RIGHT JOIN \n"
+        + "(select submit_user_id, MAX(create_at)create_at  from com_mng_volunteer_mng where state IN ( 1, 3 ) GROUP BY submit_user_id ) tmp \n"
+        + "on t.create_at = tmp.create_at and t.submit_user_id=tmp.submit_user_id " + "WHERE\n"
+        + "state in (1,3)  and community_id=#{comMngVolunteerMngVO.communityId} \n"
+        + "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != &quot;&quot;'>"
+        + "and t.name like concat(#{comMngVolunteerMngVO.name},'%')  \n" + " </if> "
+        + "<if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != &quot;&quot;'>"
+        + "AND t.phone like concat(#{comMngVolunteerMngVO.phone},'%')\n" + " </if> "
+        + "<if test='comMngVolunteerMngVO.state != null and comMngVolunteerMngVO.state != 0'>"
+        + "and t.state=#{comMngVolunteerMngVO.state}\n" + " </if> " + " \tORDER BY t.state asc  " + "</script>")
+    IPage<ComMngVolunteerMngVO> pageVolunteerExamine(Page page,
+        @Param("comMngVolunteerMngVO") ComMngVolunteerMngVO comMngVolunteerMngVO);
+
+    @Select("SELECT\n" + "'4' type\n" + "FROM\n" + "com_mng_volunteer_mng v \n" + "WHERE\n" + "v.state = 1 \n"
+        + "AND v.`community_id` = #{communityId} \n")
+    List<TodoEventsVO> selectNeedToDo(Long communityId);
+
+    @Select("select user_id from sys_user where type=1 and phone=#{phone}")
+    Long selectUserIdByPhone(String phone);
+
 }

--
Gitblit v1.7.1