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/ComMngVaccinesEnrollRecordDAO.java |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVaccinesEnrollRecordDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVaccinesEnrollRecordDAO.java
index ee83aa4..6f4e8ee 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVaccinesEnrollRecordDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVaccinesEnrollRecordDAO.java
@@ -22,20 +22,24 @@
 @Mapper
 public interface ComMngVaccinesEnrollRecordDAO extends BaseMapper<ComMngVaccinesEnrollRecordDO> {
 
-    @Select("select cmfi.id as userId,cmfi.name,cmfi.age,cmfi.job,cmfi.phone,cmfi.id_card from com_mng_family_info as cmfi where user_id = #{userId}")
+    @Select("select cmfi.id as userId,cmfi.name,cmfi.age,cmfi.job,cmfi.phone,cmfi.id_card,cmfi.create_at from com_mng_family_info as cmfi where user_id = #{userId}")
     List<VaccinesEnrollUserByAppVO> getFamilyUserList(@Param("userId") Long userId);
 
-    @Select("select su.user_id,su.name,su.nick_name,su.job,su.phone,su.id_card,su.birthday,su.sex from sys_user as su where user_id = #{userId}")
+    @Select("select su.user_id,su.name,su.nick_name,su.job,su.phone,su.id_card,su.birthday,su.sex,su.create_at from sys_user as su where user_id = #{userId}")
     VaccinesEnrollUserByAppVO getSysUser(@Param("userId") Long userId);
 
     @Select("select cmfi.name,cmfi.age,cmfi.phone,cmfi.id_card from com_mng_family_info as cmfi where id = #{userId}")
     VaccinesEnrollUserByAppVO getFamilyUser(@Param("userId") Long userId);
 
     @Select("<script> " +
-            "select cmver.id,cmver.name,cmver.sex,cmver.age,cmver.phone,cmver.id_card,cmver.create_at from com_mng_vaccines_enroll_record as cmver" +
+            "select cmver.id,cmver.name,cmver.sex,cmver.age,cmver.phone,cmver.id_card,cmver.create_at,cmv.name as vaccines from com_mng_vaccines_enroll_record as cmver " +
+            " left join com_mng_vaccines as cmv on cmv.id = cmver.type " +
             " <where>" +
             "<if test='vaccinesByAdminDTO.communityId != null'>" +
             " and cmver.community_id = #{vaccinesByAdminDTO.communityId} "+
+            " </if> " +
+            "<if test='vaccinesByAdminDTO.vaccines != null and vaccinesByAdminDTO.vaccines != &quot;&quot;'>" +
+            " and cmv.name = #{vaccinesByAdminDTO.vaccines} "+
             " </if> " +
             "<if test='vaccinesByAdminDTO.name != null and vaccinesByAdminDTO.name != &quot;&quot;'>" +
             " and cmver.name like concat('%',#{vaccinesByAdminDTO.name},'%') "+
@@ -53,14 +57,25 @@
             " AND cmver.create_at <![CDATA[<=]]> #{vaccinesByAdminDTO.endTime}  " +
             " </if> \n" +
             " </where>" +
+            " order by cmver.create_at desc"+
             " </script>")
     IPage<VaccinesEnrollByAdminVO> getVaccinesEnrollListByAdmin(Page page, @Param("vaccinesByAdminDTO") VaccinesEnrollByAdminDTO vaccinesByAdminDTO);
 
     @Select("<script> " +
-            "select cmver.name,cmver.sex,cmver.age,cmver.phone,cmver.id_card,cmver.create_at from com_mng_vaccines_enroll_record as cmver" +
+            "select cmver.name,cmver.sex,cmver.age,cmver.phone,cmver.id_card,cmver.create_at,cmv.name as vaccines from com_mng_vaccines_enroll_record as cmver " +
+            " left join com_mng_vaccines as cmv on cmv.id = cmver.type " +
             " <where>" +
             "<if test='vaccinesByAdminDTO.communityId != null'>" +
             " and cmver.community_id = #{vaccinesByAdminDTO.communityId} "+
+            " </if> " +
+            "<if test='vaccinesByAdminDTO.ids != null and vaccinesByAdminDTO.ids.size > 0'>" +
+            " and cmver.id in " +
+            "<foreach item=\"item\" collection=\"vaccinesByAdminDTO.ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" +
+            "#{item}" +
+            "</foreach>" +
+            " </if> " +
+            "<if test='vaccinesByAdminDTO.vaccines != null and vaccinesByAdminDTO.vaccines != &quot;&quot;'>" +
+            " and cmv.name = #{vaccinesByAdminDTO.vaccines} "+
             " </if> " +
             "<if test='vaccinesByAdminDTO.name != null and vaccinesByAdminDTO.name != &quot;&quot;'>" +
             " and cmver.name like concat('%',#{vaccinesByAdminDTO.name},'%') "+
@@ -78,6 +93,7 @@
             " AND cmver.create_at <![CDATA[<=]]> #{vaccinesByAdminDTO.endTime}  " +
             " </if> \n" +
             " </where>" +
+            " order by cmver.create_at desc"+
             " </script>")
     List<ComMngVaccinesEnrollExcelVo> exportVaccinesEnrollListByAdmin(@Param("vaccinesByAdminDTO") VaccinesEnrollByAdminDTO vaccinesByAdminDTO);
 }

--
Gitblit v1.7.1