From 5d55062d003a17e197523f37d68d0e88ba727219 Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期四, 20 五月 2021 19:13:48 +0800
Subject: [PATCH] Merge branch 'test' into 'master'

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVaccinesEnrollRecordDAO.java |   48 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 43 insertions(+), 5 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 5bb9aff..49030a6 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
@@ -4,6 +4,7 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollByAdminDTO;
+import com.panzhihua.common.model.vos.vaccines.ComMngVaccinesEnrollExcelVo;
 import com.panzhihua.common.model.vos.vaccines.VaccinesEnrollByAdminVO;
 import com.panzhihua.common.model.vos.vaccines.VaccinesEnrollUserByAppVO;
 import com.panzhihua.service_community.model.dos.ComMngVaccinesEnrollRecordDO;
@@ -21,18 +22,25 @@
 @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},'%') "+
             " </if> " +
@@ -42,14 +50,44 @@
             "<if test='vaccinesByAdminDTO.phone != null and vaccinesByAdminDTO.phone != &quot;&quot;'>" +
             " and cmver.phone = #{vaccinesByAdminDTO.phone} "+
             " </if> " +
-            "<if test='vaccinesByAdminDTO.startTime != null '>\n" +
+            "<if test='vaccinesByAdminDTO.startTime != null and vaccinesByAdminDTO.startTime != &quot;&quot;  '>\n" +
             " AND cmver.create_at <![CDATA[>=]]> #{vaccinesByAdminDTO.startTime}  \n" +
             "</if>" +
-            "<if test='vaccinesByAdminDTO.endTime != null '>\n" +
+            "<if test='vaccinesByAdminDTO.endTime != null and vaccinesByAdminDTO.endTime != &quot;&quot;  '>\n" +
             " 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,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},'%') "+
+            " </if> " +
+            "<if test='vaccinesByAdminDTO.idCard != null and vaccinesByAdminDTO.idCard != &quot;&quot;'>" +
+            " and cmver.id_card = #{vaccinesByAdminDTO.idCard} "+
+            " </if> " +
+            "<if test='vaccinesByAdminDTO.phone != null and vaccinesByAdminDTO.phone != &quot;&quot;'>" +
+            " and cmver.phone = #{vaccinesByAdminDTO.phone} "+
+            " </if> " +
+            "<if test='vaccinesByAdminDTO.startTime != null and vaccinesByAdminDTO.startTime != &quot;&quot; '>\n" +
+            " AND cmver.create_at <![CDATA[>=]]> #{vaccinesByAdminDTO.startTime}  \n" +
+            "</if>" +
+            "<if test='vaccinesByAdminDTO.endTime != null and vaccinesByAdminDTO.endTime != &quot;&quot; '>\n" +
+            " 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