From 02f18587bd8860b305e2c688e20465be166bb48c Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 22 七月 2021 15:14:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/EldersAuthDAO.java |   83 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 79 insertions(+), 4 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/EldersAuthDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/EldersAuthDAO.java
index 2d5b4b6..7960391 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/EldersAuthDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/EldersAuthDAO.java
@@ -5,10 +5,11 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.panzhihua.common.model.dtos.community.ExcelElderAuthDTO;
+import com.panzhihua.common.model.dtos.community.PageComEldersRecordsDTO;
 import com.panzhihua.common.model.dtos.community.PageEldersAuthDTO;
-import com.panzhihua.common.model.vos.R;
-import com.panzhihua.common.model.vos.community.EldersAuthDetailsVO;
-import com.panzhihua.common.model.vos.community.EldersAuthVO;
+import com.panzhihua.common.model.dtos.community.PageEldersAuthRecordDTO;
+import com.panzhihua.common.model.vos.community.*;
+import com.panzhihua.common.model.vos.user.SysUserVO;
 import com.panzhihua.service_community.model.dos.EldersAuthDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -39,7 +40,13 @@
             " ) t  " +
             " LEFT JOIN com_elders_auth ea ON t.id = ea.id  " +
             " LEFT JOIN sys_user  u ON ea.SUMIT_USER_ID = u.user_id\n" +
+            " LEFT JOIN com_act ac ON u.community_id = ac.community_id\n" +
             " <where> " +
+
+            "<if test='pageEldersAuthDTO.communityId != null'>" +
+            "  AND ac.community_id = #{pageEldersAuthDTO.communityId} " +
+            " </if> " +
+
             "<if test='pageEldersAuthDTO.sumitUserId != null'>" +
             " AND ea.SUMIT_USER_ID = #{pageEldersAuthDTO.sumitUserId} " +
             " </if> " +
@@ -103,6 +110,10 @@
             " LEFT JOIN com_act ac ON u.community_id = ac.community_id\n" +
             " <where> " +
 
+            "<if test='pageEldersAuthDTO.communityId != null'>" +
+            "  AND ac.community_id = #{pageEldersAuthDTO.communityId} " +
+            " </if> " +
+
             "<if test='pageEldersAuthDTO.ids != null and pageEldersAuthDTO.ids.length>0 '>" +
             " AND ea.id in " +
             "<foreach collection='pageEldersAuthDTO.ids' item='id' index='index' open='(' close=')' separator=',' >\n" +
@@ -143,5 +154,69 @@
             " LEFT JOIN com_mng_struct_area_district ad ON ct.city_adcode = ad.city_adcode "  +
             "  WHERE substring(ad.district_adcode, 1, 6) = substring(#{idCard}, 1, 6) "+
             "</script>")
-    String selectDomicile(@Param("idCard")String idCard);
+    String selectDomicile(@Param("idCard") String idCard);
+
+
+    @Select("<script> " +
+            " SELECT distinct t.id, t.yearMonth, au.`type`,  DATE_FORMAT(au.CREATE_AT,'%Y-%m-%d')  AS create_at,\n" +
+            " case " +
+            " when fed.id IS NOT NULL then true\n" +
+            " ELSE false " +
+            " END hasFeed " +
+            " FROM ( SELECT MAX(id) AS id , DATE_FORMAT(create_at, '%Y-%m') AS yearMonth\n" +
+            " FROM com_elders_auth \n" +
+            " GROUP BY id_card, yearMonth\n" +
+            " ) t  LEFT JOIN com_elders_auth au ON t.id = au.id\n" +
+            " LEFT JOIN com_elders_auth_feedback fed ON t.id = fed.AUTH_ID\n" +
+            " <where>" +
+            " au.FAMILY_USER_ID = #{pageComEldersRecordsDTO.bigAgeid} " +
+            "</where>" +
+            "<if test='pageComEldersRecordsDTO.sortColumns!=null'>\n" +
+            "ORDER BY ${pageComEldersRecordsDTO.sortColumns} ${pageComEldersRecordsDTO.sortType}\n" +
+            "</if>  " +
+            "</script>")
+    List<ComEldersAuthRecordVO> selectEldersRecordByPage(Page page, @Param("pageComEldersRecordsDTO") PageComEldersRecordsDTO pageComEldersRecordsDTO);
+
+    @Select("<script> " +
+            "  SELECT DISTINCT a.name" +
+            " FROM com_elders_auth ea LEFT JOIN com_elders_auth_user au ON ea.FAMILY_USER_ID = au.id \n" +
+            "LEFT JOIN com_act a ON au.community_id = a.community_id\n" +
+            " WHERE ea.ID = #{id}  " +
+            "</script>")
+    String selectCommunityNameByAuth(@Param("id")  Long id);
+
+    @Select("select user_id,id_card,name from sys_user where user_id = #{userId}")
+    SysUserVO getSysUserByUserId(@Param("userId")Long userId);
+
+
+    @Select("<script> " +
+            " SELECT e.ID,e.CREATE_BY,e.CREATE_AT, e.UPDATE_BY, e.UPDATE_AT, e.ID_CARD, e.AUTH_USER_NAME, e.VIDEO_URL," +
+            " e.SUMIT_USER_ID, e.DOMICILE, e.STATUS, e.BIRTH_DAY, e.type, e.age, e.verification_result, u.name as sumitUserName, u.phone as sumitUserAccount  " +
+            " FROM ( " +
+            "       SELECT MAX(id) AS id , DATE_FORMAT(create_at, '%Y-%m') AS yearMonth " +
+            "        FROM com_elders_auth " +
+            "        GROUP BY id_card, yearMonth " +
+            "       ) t " +
+            " left join com_elders_auth e on t.id = e.id " +
+            " LEFT JOIN sys_user u ON e.SUMIT_USER_ID = u.user_id  " +
+            "<where>" +
+            " <if test='pageEldersAuthRecordDTO.name!=null'>\n" +
+            " AND e.AUTH_USER_NAME like concat('%', #{pageEldersAuthRecordDTO.name}, '%')" +
+            "</if>" +
+            " <if test='pageEldersAuthRecordDTO.idCard!=null'>\n" +
+            " AND e.ID_CARD  like concat('%',  #{pageEldersAuthRecordDTO.idCard}, '%')\n" +
+            "</if>" +
+            " <if test='pageEldersAuthRecordDTO.type!=null'>\n" +
+            " AND e.type = #{pageEldersAuthRecordDTO.type}\n" +
+            "</if>" +
+            " <if test='pageEldersAuthRecordDTO.month!=null'>\n" +
+            " AND month(e.CREATE_AT) = #{pageEldersAuthRecordDTO.month}\n" +
+            "</if>\n" +
+            "</where>\n" +
+            "<if test='pageEldersAuthRecordDTO.sortColumns!=null'>\n" +
+            "ORDER BY e.${pageEldersAuthRecordDTO.sortColumns} ${pageEldersAuthRecordDTO.sortType}\n" +
+            "</if> " +
+            "</script>")
+    IPage<ComEldersAuthRecordForCommunityVO> selectCommunityEldersRecordByPage(Page page, @Param("pageEldersAuthRecordDTO") PageEldersAuthRecordDTO pageEldersAuthRecordDTO);
+
 }

--
Gitblit v1.7.1