From b039abae18bbd3b94e9b995b4f274f6f0ec7fb91 Mon Sep 17 00:00:00 2001 From: manailin <261030956@qq.com> Date: 星期一, 13 九月 2021 14:58:28 +0800 Subject: [PATCH] [新增]将user 模块下dao层的sql 全部转化到xml 中执行。 --- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysMenuDAO.xml | 31 + springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngStructHouseDAO.xml | 14 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngUserTagDAO.xml | 33 + springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysOperLogDAO.xml | 35 + springcloud_k8s_panzhihuazhihuishequ/service_user/src/test/java/com/panzhihua/service_user/dao/UserDaoTest.java | 47 ++ springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/RoleDAO.xml | 47 ++ springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/ComMngUserTagDAO.java | 10 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserNoticeDAO.xml | 39 + springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserFeedbackDAO.xml | 67 ++ springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserInputDAO.java | 119 ---- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysOperLogDAO.java | 3 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml | 425 ++++++++++++++++++ springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/EventGridMemberBuildingRelationMapper.xml | 18 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngFamilyInfoDAO.xml | 26 + springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserNoticeDAO.java | 7 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java | 226 +-------- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserAgreementDAO.xml | 19 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml | 14 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserInputDAO.xml | 166 +++++++ springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserRoleDAO.xml | 14 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/LcCompareMemberCodeMapper.xml | 20 21 files changed, 1,067 insertions(+), 313 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/ComMngUserTagDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/ComMngUserTagDAO.java index 98af594..af8d2a8 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/ComMngUserTagDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/ComMngUserTagDAO.java @@ -2,7 +2,6 @@ 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; @@ -26,11 +25,6 @@ * @param comMngUserTagDTO * @return */ - @Select("<script> " + " SELECT " + " t.* " + "FROM " + " com_mng_user_tag t " + "WHERE " - + " community_id IN ( 0, #{comMngUserTagDTO.communityId} ) " - + "<if test='comMngUserTagDTO.tagName != null and comMngUserTagDTO.tagName.trim() != ""'>" - + " and t.tag_name like concat('%',#{comMngUserTagDTO.tagName},'%') \n" + " </if> " + "ORDER BY " - + " t.sys_flag DESC" + "</script> ") IPage<ComMngTagVO> pageSpecialInputUserTags(Page page, @Param(value = "comMngUserTagDTO") ComMngUserTagDTO comMngUserTagDTO); @@ -40,9 +34,5 @@ * @param comMngTagVO * @return */ - @Select("<script> " + " SELECT " + " t.* " + "FROM " + " com_mng_user_tag t " + "WHERE " - + " community_id = #{comMngTagVO.communityId} " - + "<if test='comMngTagVO.tagName != null and comMngTagVO.tagName.trim() != ""'>" - + " and t.tag_name = #{comMngTagVO.tagName} " + " </if> " + "</script> ") ComMngUserTagDO getSpecialInputUserTagsByVO(@Param(value = "comMngTagVO") ComMngTagVO comMngTagVO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysOperLogDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysOperLogDAO.java index 8fc071a..c5814ab 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysOperLogDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysOperLogDAO.java @@ -2,7 +2,6 @@ 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; @@ -18,6 +17,6 @@ **/ @Mapper public interface SysOperLogDAO extends BaseMapper<SysOperLogDO> { - @Select("select * from sys_oper_log where community_id=#{sysOperLogVO.communityId} order by oper_time desc ") + IPage<SysOperLogVO> pageOperLog(Page page, @Param("sysOperLogVO") SysOperLogVO sysOperLogVO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserInputDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserInputDAO.java index 593b0be..0a39ce2 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserInputDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserInputDAO.java @@ -4,7 +4,6 @@ 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; @@ -27,130 +26,30 @@ **/ @Mapper public interface SysUserInputDAO extends BaseMapper<SysUserInputDO> { - // @Select("<script> " + - // " <where>" + - // "<if test='nameCn != null and nameCn.trim() != ""'>" + - // " </if> " + - // "<if test='nameCn != null and nameCn.trim() != ""'>" + - // " </if> " + - // "<if test='nameCn != null and nameCn.trim() != ""'>" + - // " </if> " + - // " </where>" + - // "</script>") - @Select("select a.id,a.community_id from com_mng_struct_area a where a.area_name=#{areaName}") + ComMngStructAreaVO selectByAreaName(String areaName); - @Select("SELECT " - + "REPLACE(REPLACE(REPLACE(REPLACE(h.house_name,a.address_detail,''),'栋','-'),'单元','-'),'层','-')houseName, " - + "h.house_code " + "FROM " + " com_mng_struct_area a " - + " join com_mng_struct_house h on h.house_name like CONCAT(a.address_detail,'%') and h.type=5 " + "WHERE " - + " a.area_name = #{areaName}") + List<ComMngStructHouseVO> selectHouserByareaName(String areaName); - @Select("SELECT " + "p.name, " + "p.id, " + "if(p.is_rent=1,'合租','家人')relationship, " + "p.id_card, " + "p.phone, " - + "year(curdate())-if(length(p.id_card)=18,substring(p.id_card,7,4),if(length(p.id_card)=15,concat('19',substring(p.id_card,7,2)),null)) as age, " - + "p.create_at " + "FROM " + " sys_user_input p " + "WHERE " + " p.door_number = #{doorNumber} " - + " AND p.id !=#{userId}") + List<ComMngFamilyInfoVO> selectListFamily(@Param("doorNumber") String doorNumber, @Param("userId") Long userId); - @Select("<script> " + "SELECT " + " t.id, " + " t.`name`, " + "CASE " + " IF " + " ( " - + " length( t.id_card ) = 18, " + " cast( substring( t.id_card, 17, 1 ) AS UNSIGNED ) % 2, " + " IF " - + " ( " + " length( t.id_card ) = 15, " + " cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, " - + " 3 " + " ) " + " ) " + " WHEN 1 THEN " + " 1 " + " WHEN 0 THEN " + " 2 ELSE 0 " - + " END AS sex, " + " t.phone, " + " YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) age, " - + " t1.area_name as areaName, " + " t.political_outlook politicalOutlook, " + " CONCAT( " + " IF " - + " ( t.soldier = 1, '军人,', '' ), " + " IF " + " ( t.lowIncome_households = 1, '低保户,', '' ), " + " IF " - + " ( t.lowIncome_people = 1, '低收入,', '' ), " + " IF " + " ( t.old_people = 1, '特服家庭,', '' ), " + " IF " - + " ( t.key_personnel = 1, '重点人员,', '' ) " + " ) tags, " + " t.create_at as createAt " + "FROM " - + " sys_user_input t " + " LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id " + "WHERE " - + " t.community_id = #{pageInputUserDTO.communityId}" - + "<if test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'>" - + " and t.`name` like concat(#{pageInputUserDTO.name},'%') " + " </if> " - + "<if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'>" - + " and t.phone like concat(#{pageInputUserDTO.phone},'%') " + " </if> " - + "<if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'>" - + "AND t1.`area_name` like concat(#{pageInputUserDTO.areaName},'%') " + " </if> " + " group by t.id_card " - + "</script>") + IPage<InputUserInfoVO> pageInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO); - @Select("select a.id,a.community_id,a.area_name,address_detail from com_mng_struct_area a where a.community_id=#{communityId}") + List<ComMngStructAreaVO> selectComMngStructArea(@Param("communityId") Long communityId); - @Select("<script> " + "SELECT * FROM ( " + " SELECT " + " t.id, " + " t.`name`, " + "CASE " + " IF " + " ( " - + " length( t.id_card ) = 18, " + " cast( substring( t.id_card, 17, 1 ) AS UNSIGNED ) % 2, " + " IF " - + " ( " + " length( t.id_card ) = 15, " + " cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, " - + " 3 " + " ) " + " ) " + " WHEN 1 THEN " + " 1 " + " WHEN 0 THEN " + " 2 ELSE 0 " - + " END AS sex, " + " t.phone, " + " YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) age, " - + " t1.area_name as areaName, " + " t.political_outlook politicalOutlook, " + " CONCAT( " + " IF " - + " ( t.soldier = 1, '军人,', '' ), " + " IF " + " ( t.lowIncome_households = 1, '低保户,', '' ), " + " IF " - + " ( t.lowIncome_people = 1, '低收入,', '' ), " + " IF " + " ( t.old_people = 1, '特服家庭,', '' ), " + " IF " - + " ( t.key_personnel = 1, '重点人员,', '' ), " + " IFNULL(t.tags,'') " + " ) tags, " - + " t2.house_name as address, " + " t.create_at as createAt " + "FROM " + " sys_user_input t " - + " LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id " - + " LEFT JOIN com_mng_struct_house t2 ON t.house_code = t2.house_code " + "WHERE " - + " t.community_id = #{pageInputUserDTO.communityId}" + " AND " - + "(t.soldier=1 OR t.lowIncome_households=1 OR t.lowIncome_people=1 or t.old_people=1 OR t.special_service_family=1 OR t.key_personnel=1 OR (t.tags IS NOT NULL AND TRIM(t.tags)!=''))" - + "<if test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'>" - + " and t.`name` like concat(#{pageInputUserDTO.name},'%') " + " </if> " - + "<if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'>" - + " and t.phone like concat(#{pageInputUserDTO.phone},'%') " + " </if> " - + "<if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'>" - + "AND t1.`area_name` like concat(#{pageInputUserDTO.areaName},'%') " + " </if> " + " group by t.id_card " - + " ) tt WHERE 1=1 " - + "<if test='pageInputUserDTO.tags != null and pageInputUserDTO.tags.trim() != ""'>" - + " and tt.tags like concat('%',#{pageInputUserDTO.tags},'%') " + " </if> " + "</script>") + IPage<InputUserInfoVO> specialInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO); - @Select("" + "SELECT " + " t1.house_code houseCode, " + " t1.house_name houseName, " + " t1.square, " + " t1.state " - + "FROM " + " sys_user_input t " + " LEFT JOIN com_mng_struct_house t1 ON t.house_code = t1.house_code " - + " WHERE" + " t.id_card = #{idCard}") + List<ComMngStructHouseVO> selectUserHouseList(@Param("idCard") String idCard); - @Select("<script> " + "SELECT " + "u.id 'order', " + "c.`area_name` areaName, " + "u.door_number doorNumber, " - + "if(u.is_rent=1,'租住','自主')isRent, " + "u.name, " + "u.nation, " - + "case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, " - + "if(u.marital_status=1,'已婚','未婚')maritalStatus, " + "u.phone, " + "u.education, " + "u.id_card, " - + "u.company, " + "u.residence, " + "if(u.is_panzhiHua=1,'是','否') isPanZhiHua, " + "u.situation, " - + "if(is_contact=1,'是','否') isContact, " + "if(u.major=1,'是','否') major, " + "if(u.soldier=1,'是','否') soldier, " - + "if(u.disability=1,'是','否') disability, " + "if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, " - + "if(u.lowIncome_people=1,'是','否') lowIncomePeople, " + "if(u.old_people=1,'是','否') oldPeople, " - + "if(u.special_service_family=1,'是','否') specialServiceFamily, " - + "if(u.key_personnel=1,'是','否') keyPersonnel, " + "u.tags " + "FROM " + " sys_user_input u " - + " where u.community_id=#{exportUserDTO.communityId} " - + "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" - + " JOIN com_mng_struct_area c ON u.area_id = c.id " + " </if> " - + "<if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>" - + "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id " + " </if> " - + "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" - + "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%') " + " </if> " - + "<if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>" - + "AND u.phone like concat(#{exportUserDTO.phone},'%') " + " </if> " - + "<if test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>" - + " and u.`name` like concat(#{exportUserDTO.name},'%') " + " </if> " + "</script>") + List<EexcelUserDTO> selectExport(@Param("exportUserDTO") ExportUserDTO exportUserDTO); - @Select("<script> " + "SELECT " + "u.id 'order', " + "c.`area_name` areaName, " + "u.door_number doorNumber, " - + "if(u.is_rent=1,'租住','自主')isRent, " + "u.name, " + "u.nation, " - + "case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, " - + "if(u.marital_status=1,'已婚','未婚')maritalStatus, " + "u.phone, " + "u.education, " + "u.id_card, " - + "u.company, " + "u.residence, " + "if(u.is_panzhiHua=1,'是','否') isPanZhiHua, " + "u.situation, " - + "if(is_contact=1,'是','否') isContact, " + "if(u.major=1,'是','否') major, " + "if(u.soldier=1,'是','否') soldier, " - + "if(u.disability=1,'是','否') disability, " + "if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, " - + "if(u.lowIncome_people=1,'是','否') lowIncomePeople, " + "if(u.old_people=1,'是','否') oldPeople, " - + "if(u.special_service_family=1,'是','否') specialServiceFamily, " - + "if(u.key_personnel=1,'是','否') keyPersonnel, " + "u.tags " + "FROM " + " sys_user_input u " - + " JOIN com_mng_struct_area c ON u.area_id = c.id " - + " where u.community_id=#{exportSpecialUserDTO.communityId} " - + "<if test='exportSpecialUserDTO.areaName != null and exportSpecialUserDTO.areaName.trim() != ""'>" - + "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%') " + " </if> " - + "<if test='exportSpecialUserDTO.name != null and exportSpecialUserDTO.name.trim() != ""'>" - + " and u.`name` like concat(#{exportSpecialUserDTO.name},'%') " + " </if> " - + "<if test='exportSpecialUserDTO.name != null and exportSpecialUserDTO.name.trim() != ""'>" - + " and u.`name` like concat(#{exportSpecialUserDTO.name},'%') " + " </if> " - + "<if test='exportSpecialUserDTO.tags != null and exportSpecialUserDTO.tags.trim() != ""'>" - + " CONCAT( " + " IF " + " ( t.soldier = 1, '军人,', '' ), " + " IF " - + " ( t.lowIncome_households = 1, '低保户,', '' ), " + " IF " + " ( t.lowIncome_people = 1, '低收入,', '' ), " - + " IF " + " ( t.old_people = 1, '特服家庭,', '' ), " + " IF " + " ( t.key_personnel = 1, '重点人员,', '' ), " - + " IFNULL(t.tags,'') " + " ) like concat(#{exportSpecialUserDTO.tags},'%')" + " </if> " + "</script>") + List<EexcelUserDTO> specialUserExport(@Param("exportSpecialUserDTO") ExportSpecialUserDTO exportSpecialUserDTO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserNoticeDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserNoticeDAO.java index 64e93f9..33e1dee 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserNoticeDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserNoticeDAO.java @@ -1,7 +1,6 @@ package com.panzhihua.service_user.dao; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.common.model.vos.user.NoticeUnReadVO; @@ -16,10 +15,6 @@ @Mapper public interface SysUserNoticeDAO extends BaseMapper<SysUserNoticeDO> { - @Select("SELECT \n" + "COUNT(case WHEN type=1 then id else null end )activityUnread,\n" - + "COUNT(case WHEN type=2 then id else null end )serviceUnread,\n" - + "COUNT(case WHEN type=3 then id else null end )systemUnread,\n" - + "COUNT(case WHEN type=4 then id else null end )scoreUnread\n" + "FROM\n" + "sys_user_notice \n" + "WHERE\n" - + "user_id =#{userId} and `status`=0") + NoticeUnReadVO noticeUnreadNum(Long userId); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java index d6d6c67..acba7d8 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java @@ -4,7 +4,8 @@ import java.util.List; import java.util.Map; -import org.apache.ibatis.annotations.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.springframework.web.bind.annotation.RequestParam; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -41,273 +42,128 @@ **/ @Mapper public interface UserDao extends BaseMapper<SysUserDO> { - // @Select("<script> " + - // " <where>" + - // "<if test='nameCn != null and nameCn.trim() != ""'>" + - // " </if> " + - // "<if test='nameCn != null and nameCn.trim() != ""'>" + - // " </if> " + - // "<if test='nameCn != null and nameCn.trim() != ""'>" + - // " </if> " + - // " </where>" + - // "</script>") - @Select("<script> " + "SELECT\n" + "u.user_id,\n" + "u.face_url,\n" + "u.nick_name,\n" + "u.`name`,\n" - + "u.phone,\n" + "u.id_card,\n" + "u.face_state,\n" + "c.area_name communityName,\n" + "u.create_at \n" - + "FROM\n" + "sys_user u\n" + "JOIN com_mng_struct_area c ON u.area_id = c.id \n" - + "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" - + "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%') \n" + " </if> " - + " where u.face_state is not null and u.type=1 and u.community_id=#{loginUserInfoVO.communityId} " - + "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != ""'>" - + "and u.`name` like concat(#{loginUserInfoVO.name},'%') \n" + " </if> " - + "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != ""'>" - + "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " + " </if> " - + " order by u.face_state asc,u.create_at asc " + "</script>") + IPage<LoginUserInfoVO> pageUserFace(Page page, @Param("loginUserInfoVO") LoginUserInfoVO loginUserInfoVO); - // @Select("<script> " + - // "SELECT\n" + - // "u.user_id,\n" + - // "u.`name`,\n" + - // "u.`sex`,\n" + - // "u.nick_name,\n" + - // "u.phone,\n" + - // "YEAR (now()) - YEAR (substring(u.id_card, 7, 8)) age,\n"+ - // "1 isRegister,\n"+ - // "v.political_face political_outlook,\n"+ - // "u.id_card,\n" + - // "u.job,\n" + - // "c.area_name communityName,\n" + - // "u.tags,\n" + - // "u.create_at \n" + - // "FROM\n" + - // "sys_user u\n" + - // "left join com_mng_volunteer_mng v on u.phone=v.phone \n"+ - // "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" + - // " JOIN com_mng_struct_area c ON u.area_id = c.id \n" + - // " </if> " + - // "<if test='loginUserInfoVO.communityName == null or loginUserInfoVO.communityName.trim() == ""'>" + - // "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" + - // " </if> " + - // "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" + - // "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%') \n" + - // " </if> " + - // " where u.community_id=#{loginUserInfoVO.communityId} and u.type=1 " + - // "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != ""'>" + - // " and u.`name` like concat(#{loginUserInfoVO.name},'%') \n" + - // " </if> " + - // "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != ""'>" + - // "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " + - // " </if> " + - // " order by u.user_id desc " + - // "</script>") + IPage<AppletUserInfoVO> pageUser(Page page, @Param("loginUserInfoVO") AppletUserInfoVO userInfoVO); - @Select("<script> " + "SELECT\n" + "u.user_id,\n" + "u.account,\n" + "u.`name`,\n" + "u.`password`,\n" - + "u.phone,\n" + "e.role_name,\n" + "e.role_id ,\n" + "u.`status`,\n" + "u.create_at,\n" - + "u.last_login_time \n" + "FROM\n" + "sys_user u\n" + "JOIN sys_user_role r ON u.user_id = r.user_id\n" - + "JOIN sys_role e ON r.role_id = e.role_id \n" - + "<if test='administratorsUserVO.roleId != null and administratorsUserVO.roleId!=0'>" - + " and e.role_id=#{administratorsUserVO.roleId}" + " </if> " + " <where>" - + "<if test='administratorsUserVO.communityId != null '>" - + "AND u.community_id = #{administratorsUserVO.communityId} \n" + " </if> " - + "<if test='administratorsUserVO.name != null and administratorsUserVO.name.trim() != ""'>" - + "AND u.name like concat (#{administratorsUserVO.name},'%') \n" + " </if> " - + "<if test='administratorsUserVO.phone != null and administratorsUserVO.phone.trim() != ""'>" - + "AND u.phone like concat(#{administratorsUserVO.phone},'%') " + " </if> " - + "<if test='administratorsUserVO.account != null and administratorsUserVO.account.trim() != ""'>" - + "AND u.account like concat(#{administratorsUserVO.account},'%') " + " </if> " + " </where>" + "</script>") + IPage<AdministratorsUserVO> pageUserBackstage(Page page, @Param("administratorsUserVO") AdministratorsUserVO administratorsUserVO); - @Select("<script> " + "select \n" + "u.user_id,\n" + "u.phone,\n" + "u.nick_name,\n" + "u.name,\n" + "u.tags,\n" - + "a.name communityName,\n" + "u.status,\n" + "u.create_at,\n" + "u.last_login_time\n" + "from sys_user u\n" - + "left join com_act a on u.community_id=a.community_id\n" + " where\n" - + "u.type=1 and u.community_id is not null \n" - + "<if test='pageUserAppletsBackstageDTO.phone != null and pageUserAppletsBackstageDTO.phone.trim() != ""'>" - + "and u.phone=#{pageUserAppletsBackstageDTO.phone}\n" + " </if> " - + "<if test='pageUserAppletsBackstageDTO.communityId != null and pageUserAppletsBackstageDTO.communityId != 0'>" - + "and u.community_id=#{pageUserAppletsBackstageDTO.communityId}\n" + " </if> " - + "<if test='pageUserAppletsBackstageDTO.status != null and pageUserAppletsBackstageDTO.status != 0'>" - + "and u.status=#{pageUserAppletsBackstageDTO.status}\n" + " </if> " - + "<if test='pageUserAppletsBackstageDTO.createAtBegin != null '>" - + "and u.create_at between #{pageUserAppletsBackstageDTO.createAtBegin} and #{pageUserAppletsBackstageDTO.createAtEnd}\n" - + " </if> " + "<if test='pageUserAppletsBackstageDTO.lastLoginTimeBegin != null '>" - + "and u.last_login_time between #{pageUserAppletsBackstageDTO.lastLoginTimeBegin} and #{pageUserAppletsBackstageDTO.lastLoginTimeEnd}\n" - + " </if> " + "order by u.create_at desc \n" + "</script>") + IPage<SysUserVO> pageUserAppletsBackstage(Page page, @Param("pageUserAppletsBackstageDTO") PageUserAppletsBackstageDTO pageUserAppletsBackstageDTO); - @Update("update sys_user set nick_name=null ,community_id=null,area_id=null where user_id=#{userId}") + int deleteUserTest(Long userId); - @Select("<script> " + "select * from \n" + "sys_user_notice \n" + "where \n" + "user_id=#{pageDTO.userId} \n" - + "<if test='pageDTO.type != null and pageDTO.type != 0'>" + "and type=#{pageDTO.type}\n" + " </if> " - + "order by create_at desc\n" + "</script>") + IPage<SysUserNoticeVO> pageNotice(Page page, @Param("pageDTO") PageDTO pageDTO); - @Select("SELECT \n" + "COUNT(user_id)allUser,\n" - + "COUNT(case WHEN DATE_FORMAT(create_at,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )addUser,\n" - + "COUNT(case WHEN DATE_FORMAT(last_login_time,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )activeDayUser,\n" - + "(SELECT count(user_id) FROM sys_user WHERE type = 1 AND last_login_time > date_sub(SYSDATE(), INTERVAL 7 DAY))activeWeekUser\n" - + "FROM\n" + "sys_user\n" + "where type=1 and community_id is not null") + IndexDataKanbanVO selectIndexDataKanban(); - @Select("select t.* from (\n" + "SELECT \n" + "a.`name`,\n" + "COUNT(u.user_id)num\n" + "FROM\n" + "com_act a\n" - + "LEFT JOIN sys_user u ON a.community_id = u.community_id and u.type=1\n" - + "GROUP BY a.community_id)t ORDER BY t.num desc ") + List<DataKanbanDTO> selectCommunityUserOrder(); - @Select("SELECT\n" + "\tCOUNT( a.id ) num \n" + "FROM\n" + "\tcom_act_activity a \n" + "WHERE\n" - + "\tDATE_FORMAT( #{date1}, '%Y-%m-%d' )= DATE_FORMAT(\n" + "\t\ta.create_at,\n" + "\t'%Y-%m-%d')\n" + "\t") + DataKanbanDTO selectCommunityActiveUserOrder(Date date1); - @Select("SELECT \n" + "COUNT(DISTINCT u.user_id)allUser,\n" - + "(select COUNT(m.id) from com_mng_volunteer_mng m where m.community_id=#{communityId} and m.`state`=2)volunteerUser,\n" - + " (select count(id) from com_pb_member cpm where cpm.audit_result = 1 and cpm.community_id = #{communityId}) partymemberUser,\n" - + "COUNT(h.id)house\n" + "FROM\n" + "sys_user u\n" + "JOIN com_act c ON u.community_id = c.community_id \n" - + "LEFT JOIN com_mng_struct_house_user h on u.user_id=h.user_id\n" + "WHERE\n" - + "u.community_id =#{communityId} and u.type=1") + IndexDataVO indexDataCommunityBackstage(Long communityId); - @Update("UPDATE sys_user u \n" + "SET u.continuous_landing_days =\n" + "IF\n" + "(\n" - + "DATE_FORMAT( u.last_login_time, '%m-%d-%Y' )= DATE_FORMAT( SYSDATE(), '%m-%d-%Y' ),\n" - + "u.continuous_landing_days + 1,\n" + "0)") + int timedTaskContinuousLandingDays(); - @Select("select id,create_at,state,name,phone,photo_path,political_face,reject_reson,apply_reson,address,age,job,integral,community_id,submit_user_id " - + " from com_mng_volunteer_mng where phone=#{phone} order by create_at desc limit 1") + ComMngVolunteerMngVO selectVolunteerMngByPhone(String phone); - @Update("update sys_user set face_state=null where user_id=#{userId}") + int updateFaceState(Long userId); - @Select("select name from com_act where community_id=#{communityId}") + ComActVO selectCommunity(Long communityId); - @Select("select COUNT(a.id) from com_mng_struct_area a where a.area_name=#{areaName}") + Integer selectCountArea(String areaName); - @Select("SELECT\n" + "\tCOUNT(h.id)\n" + "FROM\n" + "\tcom_mng_struct_area a \n" - + "\tLEFT JOIN com_mng_struct_house h on h.parent_code=a.area_code\n" + "WHERE\n" - + "\ta.area_name = #{areaName}") + Integer selectCountHouse(String areaName); - @Select("<script> " + "SELECT\n" + "u.user_id 'order',\n" + "h.house_name doorNumber,\n" - + "if(h.state=2,'租住','自主')isRent,\n" + "u.`name`,\n" + "'汉' nation,\n" - + "if(u.is_partymember=1,'党员','群众')politicalOutlook,\n" + "'未知' maritalStatus,\n" + "u.phone,\n" - + "'未知' education,\n" + "u.id_card,\n" + "'未知' company,\n" + "'未知' residence,\n" + "'未知' isPanZhiHua,\n" - + "'未知' situation,\n" + "'未知' isContact,\n" + "'未知' major,\n" + "'未知' soldier,\n" + "'未知' disability,\n" - + "'未知' lowIncomeHouseholds,\n" + "'未知' lowIncomePeople,\n" + "'未知' oldPeople,\n" - + "'未知' specialServiceFamily,\n" + "'未知' keyPersonnel\n" + "FROM\n" + "sys_user u\n" - + "left join com_mng_struct_house_user hu on hu.user_id=u.user_id\n" - + "left join com_mng_struct_house h on hu.house_code=h.house_code\n" - + "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" - + " JOIN com_mng_struct_area c ON u.area_id = c.id \n" + " </if> " - + "<if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>" - + "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" + " </if> " - + "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" - + "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%') \n" + " </if> " - + " where u.community_id=#{exportUserDTO.communityId} and u.type=1 " - + "<if test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>" - + " and u.`name` like concat(#{exportUserDTO.name},'%') \n" + " </if> " - + "<if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>" - + "AND u.phone like concat(#{exportUserDTO.phone},'%') " + " </if> " + " group by u.user_id " + "</script>") + List<EexcelUserDTO> selectExport(@Param("exportUserDTO") ExportUserDTO exportUserDTO); - @Select("SELECT\n" + "\t COUNT(a.id)\n" + "FROM\n" + "\t com_pb_member_role a \n" + "WHERE\n" - + "\t a.phone = #{phone} and community_id=#{userCommunityId} ") + Integer selectCountMemberRole(@Param("phone") String phone, @Param("userCommunityId") Long userCommunityId); - @Select("SELECT\n" + "\t COUNT(a.id)\n" + "FROM\n" + "\t com_pb_service_team a \n" + "WHERE\n" - + "\t a.phone = #{phone} and community_id=#{userCommunityId} ") + Integer selectCountTeam(@Param("phone") String phone, @Param("userCommunityId") Long userCommunityId); - @Update("update com_pb_member_role u set u.phone=#{newphone},is_reg=1 where u.phone=#{oldphone}") + void updateMemberRole(@Param("newphone") String newphone, @Param("oldphone") String oldphone); - @Update("update com_pb_service_team u set u.phone=#{newphone},is_reg=1 where u.phone=#{oldphone}") + void updateServiceTeam(@Param("newphone") String newphone, @Param("oldphone") String oldphone); - @Select("SELECT\n" + "\t COUNT(ur.role_id) \n" + "FROM\n" - + "\t sys_user u LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id \n" - + "\t LEFT JOIN sys_role r ON ur.role_id = r.role_id \n" - + "WHERE ur.role_id IS NOT NULL AND u.phone = #{phone} and r.community_id=#{userCommunityId} ") + Integer selectCountSysUser(@Param("phone") String phone, @Param("userCommunityId") Long userCommunityId); - @Select("update com_shop_store set sys_user_id = #{sysUserId} where phone = #{phone}") + void updateStoreByPhone(@Param("phone") String phone, @Param("sysUserId") Long sysUserId); - @Select("delete from com_shop_store where delete_status = 1 and phone = #{phone}") + void deleteStoreByPhoneAndStatus(@RequestParam("phone") String phone); - @Select("update sys_user set" + " card_photo_front = #{userArchivesVO.cardPhotoFront} \n" - + ", card_photo_back = #{userArchivesVO.cardPhotoBack} \n" + ",family_book = #{userArchivesVO.familyBook} \n" - + ",job = #{userArchivesVO.job} \n" + " where user_id = #{userArchivesVO.userId}") + void updateUserArchives(@Param("userArchivesVO") UpdateUserArchivesVO userArchivesVO); - @Select("update com_pb_member set user_id = #{userId} where audit_result = 1 and id_card = #{idCard}") + void updateComPbMemberUserId(@Param("idCard") String idCard, @Param("userId") Long userId); - @Select("select id from com_pb_member where audit_result = 1 and id_card = #{idCard}") + Long getPartyBuildingByIdCard(@Param("idCard") String idCard); - @Select("<script>" + "select su.user_id,su.image_url,su.nick_name,su.account,su.phone,su.work_status,su.`status`" - + ",ca.name as communityName,su.work_start_time,su.work_end_time from sys_user su" - + " left join com_act as ca on ca.community_id = su.community_id" + " where su.type = 6 " - + "<if test='memberRelationDTO.status != null'>" + "AND su.status = #{memberRelationDTO.status} " + " </if> " - + "<if test='memberRelationDTO.gridCommunityId != null'>" - + "AND ca.community_id = #{memberRelationDTO.gridCommunityId} " + " </if> " - + "<if test='memberRelationDTO.gridStreetId != null'>" + "AND ca.street_id = #{memberRelationDTO.gridStreetId} " - + " </if> " + "<if test='memberRelationDTO.workStatus != null'>" - + "AND su.work_status = #{memberRelationDTO.workStatus} " + " </if> " - + "<if test='memberRelationDTO.keyWord != null and memberRelationDTO.keyWord != ""'>" - + "and (su.nick_name like concat(#{memberRelationDTO.keyWord},'%') OR su.user_id = #{memberRelationDTO.keyWord} OR su.account like concat(#{memberRelationDTO.keyWord},'%') OR su.phone like concat(#{memberRelationDTO.keyWord},'%'))" - + " </if> " + " order by su.create_at desc" + "</script>") + IPage<GridMemberVO> getGridMemberList(Page page, @Param("memberRelationDTO") PageEventGridMemberRelationDTO memberRelationDTO); - @Select("<script>" + "update sys_user" + " set status = #{gridMemberEditDTO.status}" + " where user_id in " - + "<foreach item=\"item\" collection=\"gridMemberEditDTO.ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" - + "#{item}\n" + "</foreach>\n" + "</script>") + void gridMemberEditStatus(@Param("gridMemberEditDTO") EventGridMemberEditStatusDTO gridMemberEditDTO); - @Select("<script>" + "update sys_user" + " set password = #{gridMemberDTO.password}" + " where user_id in " - + "<foreach item=\"item\" collection=\"gridMemberDTO.ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" - + "#{item}\n" + "</foreach>\n" + "</script>") + void passResetUser(@Param("gridMemberDTO") EventGridMemberPassResetDTO gridMemberDTO); - @Update("update lc_compare_code_member set local_grid_member_id = #{userId},grid_member_name = #{userName} where id = #{lcMemberId}") + void addLcMember(@Param("lcMemberId") Long lcMemberId, @Param("userId") Long userId, @Param("userName") String userName); - @Delete("delete from lc_compare_code_member where local_grid_member_id = #{gridMemberId}") + void delLcMember(@Param("gridMemberId") Long gridMemberId); - @Select("select id,village_id,act_id from com_mng_building where id = #{buildingId}") + Map<String, Long> getBuilding(@Param("buildingId") Long buildingId); - @Delete("delete from event_grid_member_building_relation where grid_member_id = #{gridMemberId}") + void delGridMemberRelation(@Param("gridMemberId") Long gridMemberId); - @Select("select lc_grid_member_id,lc_grid_member_name,lc_bind_user_id from lc_compare_code_member where local_grid_member_id = #{gridMemberId}") + Map<String, String> getLcMemberId(@Param("gridMemberId") Long gridMemberId); - @Select("select count(id) from event_grid_member_relation where grid_member_id = #{userId}") + Integer getGridIsOk(@Param("userId") Long userId); - @Select("select user_id,nick_name,phone from sys_user where type = 6 and community_id = #{communityId} limit 3") List<EventGridMemberVO> getGridsMemberList(@Param("communityId") Long communityId); - @Select("<script>" + "select id as managerId,`name` from com_pb_service_team where community_id = #{communityId}" - + "<if test='param != null and param != ""'>" + "AND `name` like concat(#{param},'%') " + " </if> " - + "</script>") + List<ComPbServiceTeamWishVO> getServiceTeamList(@Param("param") String param, @Param("communityId") Long communityId); - @Select("select user_id,`name` from sys_user as su where type = 3 and community_id = #{communityId}") + List<SysUserVO> getUserListByCommunityId(@Param("communityId") Long communityId); - @Update("update sys_user set tags = #{sysUserDO.tags} where user_id = #{sysUserDO.userId}") + int putUserTag(@Param("sysUserDO") SysUserDO sysUserDO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngFamilyInfoDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngFamilyInfoDAO.xml new file mode 100644 index 0000000..00ebaf8 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngFamilyInfoDAO.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.ComMngFamilyInfoDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.ComMngFamilyInfoDO"> + <id property="id" column="id"/> + <result property="userId" column="user_id"/> + <result property="relationship" column="relationship"/> + <result property="name" column="name"/> + <result property="idCard" column="id_card"/> + <result property="phone" column="phone"/> + <result property="age" column="age"/> + <result property="health" column="health"/> + <result property="job" column="job"/> + <result property="cardPhotoFront" column="card_photo_front"/> + <result property="cardPhotoBack" column="card_photo_back"/> + <result property="familyBook" column="family_book"/> + <result property="createAt" column="create_at"/> + <result property="updateAt" column="update_at"/> + + </resultMap> + <sql id="columns"> + `id`,`user_id`,`relationship`,`name`,`id_card`,`phone`,`age`,`health`,`job`,`card_photo_front`,`card_photo_back`,`family_book`,`create_at`,`update_at` + </sql> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngStructHouseDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngStructHouseDAO.xml new file mode 100644 index 0000000..8288b0f --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngStructHouseDAO.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.ComMngStructHouseDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.ComMngStructHouseDO"> + <id property="id" column="id"/> + <result property="houseCode" column="house_code"/> + <result property="createAt" column="create_at"/> + </resultMap> + <sql id="columns"> + `id`,`user_id`,`house_code`,`create_at`,`area_code`,`identity` + </sql> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngUserTagDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngUserTagDAO.xml new file mode 100644 index 0000000..547da11 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/ComMngUserTagDAO.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.ComMngUserTagDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.ComMngUserTagDO"> + <id property="id" column="id"/> + <result property="tagName" column="tag_name"/> + <result property="communityId" column="community_id"/> + <result property="createAt" column="create_at"/> + <result property="sysFlag" column="sys_flag"/> + + </resultMap> + <sql id="columns"> + `id`,`tag_name`,`community_id`,`create_at`,`sys_flag` + </sql> + + + <select id="getSpecialInputUserTagsByVO" resultType="com.panzhihua.service_user.model.dos.ComMngUserTagDO"> + SELECT t.* FROM com_mng_user_tag t WHERE community_id = #{comMngTagVO.communityId} + <if test='comMngTagVO.tagName != null and comMngTagVO.tagName.trim() != ""'> + and t.tag_name =#{comMngTagVO.tagName} + </if> + </select> + + <select id="pageSpecialInputUserTags" resultType="com.panzhihua.common.model.vos.user.ComMngTagVO"> + SELECT t.* FROM com_mng_user_tag t WHERE community_id IN ( 0, #{comMngUserTagDTO.communityId} ) + <if test='comMngUserTagDTO.tagName != null and comMngUserTagDTO.tagName.trim() != ""'> + and t.tag_name like concat('%',#{comMngUserTagDTO.tagName},'%') + </if> + ORDER BY t.sys_flag DESC + </select> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/EventGridMemberBuildingRelationMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/EventGridMemberBuildingRelationMapper.xml new file mode 100644 index 0000000..62b2cd5 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/EventGridMemberBuildingRelationMapper.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.EventGridMemberBuildingRelationMapper"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.EventGridMemberBuildingRelationDO"> + <id property="id" column="id"/> + <result property="gridMemberId" column="grid_member_id"/> + <result property="communityId" column="community_id"/> + <result property="villageId" column="village_id"/> + <result property="buildingId" column="building_id"/> + <result property="createAt" column="create_at"/> + + </resultMap> + <sql id="columns"> + `id`,`grid_member_id`,`community_id`,`village_id`,`building_id`,`create_at` + </sql> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/LcCompareMemberCodeMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/LcCompareMemberCodeMapper.xml new file mode 100644 index 0000000..ef542cd --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/LcCompareMemberCodeMapper.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.LcCompareMemberCodeMapper"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.LcCompareCodeMemberDO"> + <id property="id" column="id"/> + <result property="localGridMemberId" column="local_grid_member_id"/> + <result property="gridMemberName" column="grid_member_name"/> + <result property="lcGridMemberId" column="lc_grid_member_id"/> + <result property="lcGridMemberName" column="lc_grid_member_name"/> + <result property="lcBindUserId" column="lc_bind_user_id"/> + <result property="createAt" column="create_at"/> + <result property="updateAt" column="update_at"/> + + </resultMap> + <sql id="columns"> + `id`,`local_grid_member_id`,`grid_member_name`,`lc_grid_member_id`,`lc_grid_member_name`,`lc_bind_user_id`,`create_at`,`update_at` + </sql> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/RoleDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/RoleDAO.xml new file mode 100644 index 0000000..4453511 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/RoleDAO.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.RoleDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysRoleDO"> + <id property="roleId" column="role_id"/> + <result property="roleName" column="role_name"/> + <result property="roleKey" column="role_key"/> + <result property="roleSort" column="role_sort"/> + <result property="dataScope" column="data_scope"/> + <result property="menuCheckStrictly" column="menu_check_strictly"/> + <result property="deptCheckStrictly" column="dept_check_strictly"/> + <result property="status" column="status"/> + <result property="createBy" column="create_by"/> + <result property="createAt" column="create_at"/> + <result property="updateBy" column="update_by"/> + <result property="updateAt" column="update_at"/> + <result property="remark" column="remark"/> + <result property="communityId" column="community_id"/> + + </resultMap> + <sql id="columns"> + `role_id`,`role_name`,`role_key`,`role_sort`,`data_scope`,`menu_check_strictly`,`dept_check_strictly`,`status`,`create_by`,`create_at`,`update_by`,`update_at`,`remark`,`community_id` + </sql> + + + <select id="selectAllMenuUrl" resultType="com.panzhihua.common.model.vos.MenuVO"> + select r.role_key role,m.component url from sys_role r join sys_role_menu rm on r.role_id=rm.role_id join sys_menu m on rm.menu_id=m.menu_id WHERE m.component is not null + </select> + + <select id="selectRoles" resultType="java.lang.String"> + select r.role_key from sys_user_role ur join sys_role r on ur.role_id = r.role_id where ur.user_id=#{username} + </select> + + <select id="selectByUserId" resultType="com.panzhihua.service_user.model.dos.SysRoleDO"> + select r.* from sys_user_role u join sys_role r on u.role_id=r.role_id where u.user_id=#{userId} + </select> + + <select id="selectMaxRole" resultType="java.lang.Long"> + + </select> + + <select id="deleteByRoleKey"> + delete from sys_role where role_key =#{roleKey} + </select> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysMenuDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysMenuDAO.xml new file mode 100644 index 0000000..3f100f6 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysMenuDAO.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.SysMenuDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysMenuDO"> + <id property="menuId" column="menu_id"/> + <result property="menuName" column="menu_name"/> + <result property="parentId" column="parent_id"/> + <result property="orderNum" column="order_num"/> + <result property="path" column="path"/> + <result property="component" column="component"/> + <result property="isFrame" column="is_frame"/> + <result property="isCache" column="is_cache"/> + <result property="menuType" column="menu_type"/> + <result property="visible" column="visible"/> + <result property="status" column="status"/> + <result property="perms" column="perms"/> + <result property="icon" column="icon"/> + <result property="createBy" column="create_by"/> + <result property="createAt" column="create_at"/> + <result property="updateBy" column="update_by"/> + <result property="updateAt" column="update_at"/> + <result property="remark" column="remark"/> + <result property="communityId" column="community_id"/> + + </resultMap> + <sql id="columns"> + `menu_id`,`menu_name`,`parent_id`,`order_num`,`path`,`component`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_at`,`update_by`,`update_at`,`remark`,`community_id` + </sql> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysOperLogDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysOperLogDAO.xml new file mode 100644 index 0000000..0a036c1 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysOperLogDAO.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.SysOperLogDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysOperLogDO"> + <id property="operId" column="oper_id"/> + <result property="title" column="title"/> + <result property="businessType" column="business_type"/> + <result property="method" column="method"/> + <result property="requestMethod" column="request_method"/> + <result property="operatorType" column="operator_type"/> + <result property="operName" column="oper_name"/> + <result property="deptName" column="dept_name"/> + <result property="operUrl" column="oper_url"/> + <result property="operIp" column="oper_ip"/> + <result property="operLocation" column="oper_location"/> + <result property="operParam" column="oper_param"/> + <result property="jsonResult" column="json_result"/> + <result property="status" column="status"/> + <result property="errorMsg" column="error_msg"/> + <result property="operTime" column="oper_time"/> + <result property="communityId" column="community_id"/> + <result property="account" column="account"/> + + </resultMap> + <sql id="columns"> + `oper_id`,`title`,`business_type`,`method`,`request_method`,`operator_type`,`oper_name`,`dept_name`,`oper_url`,`oper_ip`,`oper_location`,`oper_param`,`json_result`,`status`,`error_msg`,`oper_time`,`community_id`,`account` + </sql> + + + <select id="pageOperLog" resultType="com.panzhihua.common.model.vos.user.SysOperLogVO"> +select * from sys_oper_log where community_id=#{sysOperLogVO.communityId} order by oper_time desc + </select> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml new file mode 100644 index 0000000..da7ee28 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.SysRoleMenuDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysRoleMenuDO"> + <id property="roleId" column="role_id"/> + <result property="menuId" column="menu_id"/> + + </resultMap> + <sql id="columns"> + `role_id`,`menu_id` + </sql> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserAgreementDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserAgreementDAO.xml new file mode 100644 index 0000000..e46f51a --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserAgreementDAO.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.SysUserAgreementDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserAgreementDO"> + <id property="id" column="id"/> + <result property="type" column="type"/> + <result property="content" column="content"/> + <result property="createAt" column="create_at"/> + <result property="updateAt" column="update_at"/> + <result property="name" column="name"/> + <result property="communityId" column="community_id"/> + + </resultMap> + <sql id="columns"> + `id`,`type`,`content`,`create_at`,`update_at`,`name`,`community_id` + </sql> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserFeedbackDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserFeedbackDAO.xml new file mode 100644 index 0000000..ae47d9d --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserFeedbackDAO.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.SysUserFeedbackDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserFeedbackDO"> + <id property="id" column="id"/> + <result property="content" column="content"/> + <result property="photoPath" column="photo_path"/> + <result property="createAt" column="create_at"/> + <result property="updateAt" column="update_at"/> + <result property="userId" column="user_id"/> + <result property="areaId" column="area_id"/> + <result property="communityId" column="community_id"/> + <result property="status" column="status"/> + + </resultMap> + <sql id="columns"> + `id`,`content`,`photo_path`,`create_at`,`update_at`,`user_id`,`area_id`,`community_id`,`status` + </sql> + + + <select id="detailFeedback" resultType="com.panzhihua.common.model.vos.user.SysUserFeedbackVO"> + select + u.name, + u.nick_name, + f.id, + f.content, + f.photo_path, + u.phone, + f.create_at, + c.name communityName + from sys_user_feedback f + join sys_user u on f.user_id=u.user_id + join com_act c on u.community_id=c.community_id + where f.id=#{id} + + </select> + + <select id="pageFeedback" resultType="com.panzhihua.common.model.vos.user.SysUserFeedbackVO"> + select + u.name, + u.nick_name, + f.id, + u.phone, + f.create_at, + f.content, + f.photo_path, + c.name communityName + from sys_user_feedback f + left join sys_user u on f.user_id=u.user_id + left join com_act c on u.community_id=c.community_id + <where> + <if test='pageFeedBackDTO.phone != null and pageFeedBackDTO.phone.trim() != ""'> + and u.phone like concat('%',#{pageFeedBackDTO.phone},'%') + </if> + <if test='pageFeedBackDTO.name != null and pageFeedBackDTO.name.trim() != ""'> + and u.name like concat('%',#{pageFeedBackDTO.name},'%') + </if> + <if test='pageFeedBackDTO.nickName != null and pageFeedBackDTO.nickName.trim() != ""'> + and u.nick_name like concat('%',#{pageFeedBackDTO.nickName},'%') + </if> + </where> + order by f.create_at desc + + </select> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserInputDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserInputDAO.xml new file mode 100644 index 0000000..04486e3 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserInputDAO.xml @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.SysUserInputDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserInputDO"> + <id property="id" column="id"/> + <result property="doorNumber" column="door_number"/> + <result property="isRent" column="is_rent"/> + <result property="name" column="name"/> + <result property="nation" column="nation"/> + <result property="politicalOutlook" column="political_outlook"/> + <result property="maritalStatus" column="marital_status"/> + <result property="phone" column="phone"/> + <result property="education" column="education"/> + <result property="idCard" column="id_card"/> + <result property="company" column="company"/> + <result property="residence" column="residence"/> + <result property="isPanzhihua" column="is_panzhiHua"/> + <result property="situation" column="situation"/> + <result property="isContact" column="is_contact"/> + <result property="major" column="major"/> + <result property="soldier" column="soldier"/> + <result property="lowincomeHouseholds" column="lowIncome_households"/> + <result property="lowincomePeople" column="lowIncome_people"/> + <result property="oldPeople" column="old_people"/> + <result property="specialServiceFamily" column="special_service_family"/> + <result property="keyPersonnel" column="key_personnel"/> + <result property="communityId" column="community_id"/> + <result property="areaId" column="area_id"/> + <result property="createAt" column="create_at"/> + <result property="updateAt" column="update_at"/> + <result property="houseCode" column="house_code"/> + <result property="disability" column="disability"/> + <result property="tags" column="tags"/> + + </resultMap> + <sql id="columns"> + `id`,`door_number`,`is_rent`,`name`,`nation`,`political_outlook`,`marital_status`,`phone`,`education`,`id_card`,`company`,`residence`,`is_panzhiHua`,`situation`,`is_contact`,`major`,`soldier`,`lowIncome_households`,`lowIncome_people`,`old_people`,`special_service_family`,`key_personnel`,`community_id`,`area_id`,`create_at`,`update_at`,`house_code`,`disability`,`tags` + </sql> + + + <select id="selectUserHouseList" resultType="com.panzhihua.common.model.vos.community.ComMngStructHouseVO"> + SELECT t1.house_code houseCode, t1.house_name houseName, t1.square, t1.state FROM sys_user_input t LEFT JOIN com_mng_struct_house t1 ON t.house_code = t1.house_code WHERE t.id_card = #{idCard} + </select> + + <select id="selectHouserByareaName" resultType="com.panzhihua.common.model.vos.community.ComMngStructHouseVO"> + SELECT REPLACE(REPLACE(REPLACE(REPLACE(h.house_name,a.address_detail,''),'栋','-'),'单元','-'),'层','-')houseName, h.house_code FROM com_mng_struct_area a join com_mng_struct_house h on h.house_name like CONCAT(a.address_detail,'%') and h.type=5 WHERE a.area_name = #{areaName} + </select> + + <select id="selectComMngStructArea" resultType="com.panzhihua.common.model.vos.community.ComMngStructAreaVO"> + select a.id,a.community_id,a.area_name,address_detail from com_mng_struct_area a where a.community_id=#{communityId} + </select> + + <select id="specialUserExport" resultType="com.panzhihua.common.model.dtos.user.EexcelUserDTO"> + SELECT u.id 'order', c.`area_name` areaName, u.door_number doorNumber, if(u.is_rent=1,'租住','自主')isRent, u.name, + u.nation, case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, + if(u.marital_status=1,'已婚','未婚')maritalStatus, u.phone, u.education, u.id_card, u.company, u.residence, + if(u.is_panzhiHua=1,'是','否') isPanZhiHua, u.situation, if(is_contact=1,'是','否') isContact, if(u.major=1,'是','否') + major, if(u.soldier=1,'是','否') soldier, if(u.disability=1,'是','否') disability, + if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, if(u.lowIncome_people=1,'是','否') lowIncomePeople, + if(u.old_people=1,'是','否') oldPeople, if(u.special_service_family=1,'是','否') specialServiceFamily, + if(u.key_personnel=1,'是','否') keyPersonnel, u.tags FROM sys_user_input u JOIN com_mng_struct_area c ON u.area_id + = c.id where u.community_id=#{exportSpecialUserDTO.communityId} + <if + test='exportSpecialUserDTO.areaName != null and exportSpecialUserDTO.areaName.trim() != ""'> + AND + c.`area_name` like concat(#{exportUserDTO.areaName},'%') + </if> + <if test='exportSpecialUserDTO.name != null and exportSpecialUserDTO.name.trim() != ""'>and u.`name` + like concat(#{exportSpecialUserDTO.name},'%') + </if> + <if test='exportSpecialUserDTO.name != null and exportSpecialUserDTO.name.trim() != ""'>and u.`name` + like concat(#{exportSpecialUserDTO.name},'%') + </if> + <if test='exportSpecialUserDTO.tags != null and exportSpecialUserDTO.tags.trim() != ""'>CONCAT( IF ( + t.soldier = 1, '军人,', '' ), IF ( t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, + '低收入,', '' ), IF ( t.old_people = 1, '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ), + IFNULL(t.tags,'') ) like concat(#{exportSpecialUserDTO.tags},'%') + </if> + </select> + + <select id="selectExport" resultType="com.panzhihua.common.model.dtos.user.EexcelUserDTO"> + SELECT u.id 'order', c.`area_name` areaName, u.door_number doorNumber, if(u.is_rent=1,'租住','自主')isRent, u.name, + u.nation, case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, + if(u.marital_status=1,'已婚','未婚')maritalStatus, u.phone, u.education, u.id_card, u.company, u.residence, + if(u.is_panzhiHua=1,'是','否') isPanZhiHua, u.situation, if(is_contact=1,'是','否') isContact, if(u.major=1,'是','否') + major, if(u.soldier=1,'是','否') soldier, if(u.disability=1,'是','否') disability, + if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, if(u.lowIncome_people=1,'是','否') lowIncomePeople, + if(u.old_people=1,'是','否') oldPeople, if(u.special_service_family=1,'是','否') specialServiceFamily, + if(u.key_personnel=1,'是','否') keyPersonnel, u.tags FROM sys_user_input u where + u.community_id=#{exportUserDTO.communityId} + <if + test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>JOIN + com_mng_struct_area c ON u.area_id = c.id + </if> + <if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>LEFT JOIN + com_mng_struct_area c ON u.area_id = c.id + </if> + <if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>AND c.`area_name` + like concat(#{exportUserDTO.areaName},'%') + </if> + <if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>AND u.phone like + concat(#{exportUserDTO.phone},'%') + </if> + <if test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>and u.`name` like + concat(#{exportUserDTO.name},'%') + </if> + </select> + + <select id="pageInputUser" resultType="com.panzhihua.common.model.vos.user.InputUserInfoVO"> + SELECT t.id, t.`name`, CASE IF ( length( t.id_card ) = 18, cast( substring( t.id_card, 17, 1 ) AS UNSIGNED ) % + 2, IF ( length( t.id_card ) = 15, cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, 3 ) ) WHEN 1 THEN 1 + WHEN 0 THEN 2 ELSE 0 END AS sex, t.phone, YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) age, + t1.area_name as areaName, t.political_outlook politicalOutlook, CONCAT( IF ( t.soldier = 1, '军人,', '' ), IF ( + t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, '低收入,', '' ), IF ( t.old_people = 1, + '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ) ) tags, t.create_at as createAt FROM sys_user_input t + LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id WHERE t.community_id = #{pageInputUserDTO.communityId} + <if + test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'>and t.`name` like + concat(#{pageInputUserDTO.name},'%') + </if> + <if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'>and t.phone like + concat(#{pageInputUserDTO.phone},'%') + </if> + <if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'>AND + t1.`area_name` like concat(#{pageInputUserDTO.areaName},'%') + </if> + group by t.id_card + </select> + + <select id="specialInputUser" resultType="com.panzhihua.common.model.vos.user.InputUserInfoVO"> + SELECT * FROM ( SELECT t.id, t.`name`, CASE IF ( length( t.id_card ) = 18, cast( substring( t.id_card, 17, 1 ) + AS UNSIGNED ) % 2, IF ( length( t.id_card ) = 15, cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, 3 ) ) + WHEN 1 THEN 1 WHEN 0 THEN 2 ELSE 0 END AS sex, t.phone, YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) + age, t1.area_name as areaName, t.political_outlook politicalOutlook, CONCAT( IF ( t.soldier = 1, '军人,', '' ), IF + ( t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, '低收入,', '' ), IF ( t.old_people = 1, + '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ), IFNULL(t.tags,'') ) tags, t2.house_name as address, + t.create_at as createAt FROM sys_user_input t LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id LEFT JOIN + com_mng_struct_house t2 ON t.house_code = t2.house_code WHERE t.community_id = #{pageInputUserDTO.communityId} + AND (t.soldier=1 OR t.lowIncome_households=1 OR t.lowIncome_people=1 or t.old_people=1 OR + t.special_service_family=1 OR t.key_personnel=1 OR + (t.tags IS NOT NULL AND TRIM(t.tags)!='')) + <if test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'> + and t.`name` like concat(#{pageInputUserDTO.name},'%') + </if> + <if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'> + and t.phone like concat(#{pageInputUserDTO.phone},'%') + </if> + <if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'> + AND t1.`area_name` like concat(#{pageInputUserDTO.areaName},'%') + </if> + group by t.id_card ) tt WHERE 1=1 + <if test='pageInputUserDTO.tags != null and pageInputUserDTO.tags.trim() != ""'> + and tt.tags like concat('%',#{pageInputUserDTO.tags},'%') + </if> + </select> + + <select id="selectListFamily" resultType="com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO"> + SELECT p.name, p.id, if(p.is_rent=1,'合租','家人')relationship, p.id_card, p.phone, year(curdate())-if(length(p.id_card)=18,substring(p.id_card,7,4),if(length(p.id_card)=15,concat('19',substring(p.id_card,7,2)),null)) as age, p.create_at FROM sys_user_input p WHERE p.door_number = #{doorNumber} AND p.id !=#{userId} + </select> + + <select id="selectByAreaName" resultType="com.panzhihua.common.model.vos.community.ComMngStructAreaVO"> + select a.id,a.community_id from com_mng_struct_area a where a.area_name=#{areaName} + </select> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserNoticeDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserNoticeDAO.xml new file mode 100644 index 0000000..8987086 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserNoticeDAO.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.SysUserNoticeDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserNoticeDO"> + <id property="id" column="id"/> + <result property="userId" column="user_id"/> + <result property="type" column="type"/> + <result property="title" column="title"/> + <result property="businessType" column="business_type"/> + <result property="businessTitle" column="business_title"/> + <result property="businessContent" column="business_content"/> + <result property="businessTime" column="business_time"/> + <result property="businessStatus" column="business_status"/> + <result property="createAt" column="create_at"/> + <result property="updateAt" column="update_at"/> + <result property="status" column="status"/> + <result property="businessId" column="business_id"/> + <result property="activityType" column="activity_type"/> + + </resultMap> + <sql id="columns"> + `id`,`user_id`,`type`,`title`,`business_type`,`business_title`,`business_content`,`business_time`,`business_status`,`create_at`,`update_at`,`status`,`business_id`,`activity_type` + </sql> + + + <select id="noticeUnreadNum" resultType="com.panzhihua.common.model.vos.user.NoticeUnReadVO"> + SELECT + COUNT(case WHEN type=1 then id else null end )activityUnread, + COUNT(case WHEN type=2 then id else null end )serviceUnread, + COUNT(case WHEN type=3 then id else null end )systemUnread, + COUNT(case WHEN type=4 then id else null end )scoreUnread + FROM + sys_user_notice + WHERE + user_id =#{userId} and `status`=0 + </select> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserRoleDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserRoleDAO.xml new file mode 100644 index 0000000..85f0b07 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserRoleDAO.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.SysUserRoleDAO"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserRoleDO"> + <id property="userId" column="user_id"/> + <result property="roleId" column="role_id"/> + + </resultMap> + <sql id="columns"> + `user_id`,`role_id` + </sql> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml new file mode 100644 index 0000000..58f5691 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml @@ -0,0 +1,425 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.panzhihua.service_user.dao.UserDao"> + <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserDO"> + <id property="userId" column="user_id"/> + <result property="account" column="account"/> + <result property="password" column="password"/> + <result property="openid" column="openid"/> + <result property="sessionKey" column="session_key"/> + <result property="unionid" column="unionid"/> + <result property="phone" column="phone"/> + <result property="nickName" column="nick_name"/> + <result property="name" column="name"/> + <result property="communityId" column="community_id"/> + <result property="sex" column="sex"/> + <result property="idCard" column="id_card"/> + <result property="birthday" column="birthday"/> + <result property="imageUrl" column="image_url"/> + <result property="type" column="type"/> + <result property="job" column="job"/> + <result property="isVolunteer" column="is_volunteer"/> + <result property="isPartymember" column="is_partymember"/> + <result property="status" column="status"/> + <result property="createAt" column="create_at"/> + <result property="lastLoginTime" column="last_login_time"/> + <result property="tags" column="tags"/> + <result property="familyId" column="family_id"/> + <result property="faceUrl" column="face_url"/> + <result property="faceState" column="face_state"/> + <result property="rejectReson" column="reject_reson"/> + <result property="areaId" column="area_id"/> + <result property="cardPhotoFront" column="card_photo_front"/> + <result property="cardPhotoBack" column="card_photo_back"/> + <result property="familyBook" column="family_book"/> + <result property="continuousLandingDays" column="continuous_landing_days"/> + <result property="isTips" column="is_tips"/> + <result property="workStatus" column="work_status"/> + <result property="workStartTime" column="work_start_time"/> + <result property="workEndTime" column="work_end_time"/> + <result property="bigAgeTips" column="big_age_tips"/> + + </resultMap> + <sql id="columns"> + `user_id`,`account`,`password`,`openid`,`session_key`,`unionid`,`phone`,`nick_name`,`name`,`community_id`,`sex`,`id_card`,`birthday`,`image_url`,`type`,`job`,`is_volunteer`,`is_partymember`,`status`,`create_at`,`last_login_time`,`tags`,`family_id`,`face_url`,`face_state`,`reject_reson`,`area_id`,`card_photo_front`,`card_photo_back`,`family_book`,`continuous_landing_days`,`is_tips`,`work_status`,`work_start_time`,`work_end_time`,`big_age_tips` + </sql> + + + <select id="indexDataCommunityBackstage" resultType="com.panzhihua.common.model.vos.IndexDataVO"> + SELECT + COUNT(DISTINCT u.user_id)allUser, + (select COUNT(m.id) from com_mng_volunteer_mng m where m.community_id=#{communityId} and m.`state`=2)volunteerUser, + (select count(id) from com_pb_member cpm where cpm.audit_result = 1 and cpm.community_id = #{communityId}) partymemberUser, + COUNT(h.id)house + FROM + sys_user u + JOIN com_act c ON u.community_id = c.community_id + LEFT JOIN com_mng_struct_house_user h on u.user_id=h.user_id + WHERE u.community_id =#{communityId} and u.type=1 + </select> + + <update id="timedTaskContinuousLandingDays"> + UPDATE sys_user u + SET u.continuous_landing_days = + IF + ( + DATE_FORMAT( u.last_login_time, '%m-%d-%Y' )= DATE_FORMAT( SYSDATE(), '%m-%d-%Y' ), + u.continuous_landing_days + 1, + 0) + </update> + + <select id="selectVolunteerMngByPhone" resultType="com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO"> + select id,create_at,state,name,phone,photo_path,political_face,reject_reson,apply_reson,address,age,job,integral,community_id,submit_user_id from com_mng_volunteer_mng where phone=#{phone} order by create_at desc limit 1 + </select> + + <select id="selectCountMemberRole" resultType="java.lang.Integer"> + SELECT + COUNT(a.id) + FROM + com_pb_member_role a + WHERE + a.phone = #{phone} and community_id=#{userCommunityId} + </select> + + <select id="pageUserAppletsBackstage" resultType="com.panzhihua.common.model.vos.user.SysUserVO"> + select + u.user_id, + u.phone, + u.nick_name, + u.name, + u.tags, + a.name communityName, + u.status, + u.create_at, + u.last_login_time + from sys_user u + left join com_act a on u.community_id=a.community_id + where + u.type=1 and u.community_id is not null + <if test='pageUserAppletsBackstageDTO.phone != null and pageUserAppletsBackstageDTO.phone.trim() != ""'> + and u.phone=#{pageUserAppletsBackstageDTO.phone} + </if> + <if test='pageUserAppletsBackstageDTO.communityId != null and pageUserAppletsBackstageDTO.communityId != 0'>and + u.community_id=#{pageUserAppletsBackstageDTO.communityId} + </if> + <if test='pageUserAppletsBackstageDTO.status != null and pageUserAppletsBackstageDTO.status != 0'>and + u.status=#{pageUserAppletsBackstageDTO.status} + </if> + <if test='pageUserAppletsBackstageDTO.createAtBegin != null '>and u.create_at between + #{pageUserAppletsBackstageDTO.createAtBegin} and #{pageUserAppletsBackstageDTO.createAtEnd} + </if> + <if test='pageUserAppletsBackstageDTO.lastLoginTimeBegin != null '>and u.last_login_time between + #{pageUserAppletsBackstageDTO.lastLoginTimeBegin} and #{pageUserAppletsBackstageDTO.lastLoginTimeEnd} + </if> + order by u.create_at desc + + </select> + + <select id="selectIndexDataKanban" resultType="com.panzhihua.common.model.vos.IndexDataKanbanVO"> + SELECT + COUNT(user_id)allUser, + COUNT(case WHEN DATE_FORMAT(create_at,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )addUser, + COUNT(case WHEN DATE_FORMAT(last_login_time,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )activeDayUser, + (SELECT count(user_id) FROM sys_user WHERE type = 1 AND last_login_time > date_sub(SYSDATE(), INTERVAL 7 DAY))activeWeekUser + FROM + sys_user + where type=1 and community_id is not null + </select> + + <select id="selectCommunityUserOrder" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO"> + select t.* from ( + SELECT + a.`name`, + COUNT(u.user_id)num + FROM + com_act a + LEFT JOIN sys_user u ON a.community_id = u.community_id and u.type=1 + GROUP BY a.community_id)t ORDER BY t.num desc + </select> + + <select id="pageUserBackstage" resultType="com.panzhihua.common.model.vos.user.AdministratorsUserVO"> + SELECT + u.user_id, + u.account, + u.`name`, + u.`password`, + u.phone, + e.role_name, + e.role_id , + u.`status`, + u.create_at, + u.last_login_time + FROM + sys_user u + JOIN sys_user_role r ON u.user_id = r.user_id + JOIN sys_role e ON r.role_id = e.role_id + <if test='administratorsUserVO.roleId != null and administratorsUserVO.roleId!=0'>and + e.role_id=#{administratorsUserVO.roleId} + </if> + <where> + <if test='administratorsUserVO.communityId != null '>AND u.community_id = + #{administratorsUserVO.communityId} + </if> + <if test='administratorsUserVO.name != null and administratorsUserVO.name.trim() != ""'>AND u.name + like concat (#{administratorsUserVO.name},'%') + </if> + <if test='administratorsUserVO.phone != null and administratorsUserVO.phone.trim() != ""'>AND + u.phone like concat(#{administratorsUserVO.phone},'%') + </if> + <if test='administratorsUserVO.account != null and administratorsUserVO.account.trim() != ""'>AND + u.account like concat(#{administratorsUserVO.account},'%') + </if> + </where> + </select> + + <select id="selectCommunityActiveUserOrder" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO"> + SELECT + COUNT( a.id ) num + FROM + com_act_activity a + WHERE + DATE_FORMAT( #{date1}, '%Y-%m-%d' )= DATE_FORMAT( a.create_at,'%Y-%m-%d') + </select> + + <update id="gridMemberEditStatus"> + update sys_user set status = #{gridMemberEditDTO.status} where user_id in + <foreach item="item" collection="gridMemberEditDTO.ids" separator="," open="(" close=")" index=""> + #{item} + </foreach> + + </update> + + <select id="getGridMemberList" resultType="com.panzhihua.common.model.vos.grid.GridMemberVO"> + select su.user_id,su.image_url,su.nick_name,su.account,su.phone,su.work_status,su.`status`,ca.name as + communityName,su.work_start_time,su.work_end_time from sys_user su left join com_act as ca on ca.community_id = + su.community_id where su.type = 6 + <if test='memberRelationDTO.status != null'>AND su.status = + #{memberRelationDTO.status} + </if> + <if test='memberRelationDTO.gridCommunityId != null'>AND ca.community_id = + #{memberRelationDTO.gridCommunityId} + </if> + <if test='memberRelationDTO.gridStreetId != null'>AND ca.street_id = #{memberRelationDTO.gridStreetId}</if> + <if test='memberRelationDTO.workStatus != null'>AND su.work_status = #{memberRelationDTO.workStatus}</if> + <if test='memberRelationDTO.keyWord != null and memberRelationDTO.keyWord != ""'>and (su.nick_name + like concat(#{memberRelationDTO.keyWord},'%') OR su.user_id = #{memberRelationDTO.keyWord} OR su.account + like concat(#{memberRelationDTO.keyWord},'%') OR su.phone like concat(#{memberRelationDTO.keyWord},'%')) + </if> + order by su.create_at desc + </select> + + <update id="updateServiceTeam"> + update com_pb_service_team u set u.phone=#{newphone},is_reg=1 where u.phone=#{oldphone} + </update> + + <delete id="deleteStoreByPhoneAndStatus"> + delete from com_shop_store where delete_status = 1 and phone = #{phone} + </delete> + + <select id="getPartyBuildingByIdCard" resultType="java.lang.Long"> + select id from com_pb_member where audit_result = 1 and id_card = #{idCard} + </select> + + <select id="getGridsMemberList" + resultType="com.panzhihua.common.model.vos.community.screen.event.EventGridMemberVO"> + select user_id,nick_name,phone from sys_user where type = 6 and community_id = #{communityId} limit 3 + </select> + + <update id="updateUserArchives"> + update sys_user set card_photo_front = #{userArchivesVO.cardPhotoFront} + , card_photo_back = #{userArchivesVO.cardPhotoBack} + ,family_book = #{userArchivesVO.familyBook} + ,job = #{userArchivesVO.job} + where user_id = #{userArchivesVO.userId} + </update> + + <select id="selectCountSysUser" resultType="java.lang.Integer"> + SELECT + COUNT(ur.role_id) + FROM + sys_user u LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id + LEFT JOIN sys_role r ON ur.role_id = r.role_id + WHERE ur.role_id IS NOT NULL AND u.phone = #{phone} and r.community_id=#{userCommunityId} + </select> + + <delete id="delGridMemberRelation"> + delete from event_grid_member_building_relation where grid_member_id = #{gridMemberId} + </delete> + + <update id="updateStoreByPhone"> + update com_shop_store set sys_user_id = #{sysUserId} where phone = #{phone} + </update> + + <update id="updateComPbMemberUserId"> + update com_pb_member set user_id = #{userId} where audit_result = 1 and id_card = #{idCard} + </update> + + <select id="getServiceTeamList" resultType="com.panzhihua.common.model.vos.partybuilding.ComPbServiceTeamWishVO"> + select id as managerId,`name` from com_pb_service_team where community_id = #{communityId} + <if test='param != null and param != ""'>AND `name` like concat(#{param},'%')</if> + </select> + + <select id="getUserListByCommunityId" resultType="com.panzhihua.common.model.vos.user.SysUserVO"> + select user_id,`name` from sys_user as su where type = 3 and community_id = #{communityId} + </select> + + <select id="pageUserFace" resultType="com.panzhihua.common.model.vos.LoginUserInfoVO"> + SELECT + u.user_id, + u.face_url, + u.nick_name, + u.`name`, + u.phone, + u.id_card, + u.face_state, + c.area_name communityName, + u.create_at + FROM + sys_user u + JOIN com_mng_struct_area c ON u.area_id = c.id + <if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'> + AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%') + </if> + where u.face_state is not null and u.type=1 and u.community_id=#{loginUserInfoVO.communityId} + <if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != ""'> + and u.`name` like concat(#{loginUserInfoVO.name},'%') + </if> + <if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != ""'> + AND u.phone like concat(#{loginUserInfoVO.phone},'%') + </if> + order by u.face_state asc,u.create_at asc + </select> + + <update id="putUserTag"> + update sys_user set tags = #{sysUserDO.tags} where user_id = #{sysUserDO.userId} + </update> + + <update id="updateMemberRole"> + update com_pb_member_role u set u.phone=#{newphone},is_reg=1 where u.phone=#{oldphone} + </update> + + <select id="selectCountTeam" resultType="java.lang.Integer"> + SELECT + COUNT(a.id) + FROM + com_pb_service_team a + WHERE + a.phone = #{phone} and community_id=#{userCommunityId} + </select> + + <select id="selectExport" resultType="com.panzhihua.common.model.dtos.user.EexcelUserDTO"> + SELECT + u.user_id 'order', + h.house_name doorNumber, + if(h.state=2,'租住','自主')isRent, + u.`name`, + '汉' nation, + if(u.is_partymember=1,'党员','群众')politicalOutlook, + '未知' maritalStatus, + u.phone, + '未知' education, + u.id_card, + '未知' company, + '未知' residence, + '未知' isPanZhiHua, + '未知' situation, + '未知' isContact, + '未知' major, + '未知' soldier, + '未知' disability, + '未知' lowIncomeHouseholds, + '未知' lowIncomePeople, + '未知' oldPeople, + '未知' specialServiceFamily, + '未知' keyPersonnel + FROM + sys_user u + left join com_mng_struct_house_user hu on hu.user_id=u.user_id + left join com_mng_struct_house h on hu.house_code=h.house_code + <if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>JOIN + com_mng_struct_area c ON u.area_id = c.id + </if> + <if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>LEFT JOIN + com_mng_struct_area c ON u.area_id = c.id + </if> + <if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>AND c.`area_name` + like concat(#{exportUserDTO.areaName},'%') + </if> + where u.community_id=#{exportUserDTO.communityId} and u.type=1 + <if + test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>and u.`name` like + concat(#{exportUserDTO.name},'%') + </if> + <if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>AND u.phone like + concat(#{exportUserDTO.phone},'%') + </if> + group by u.user_id + </select> + + <select id="pageNotice" resultType="com.panzhihua.common.model.vos.user.SysUserNoticeVO"> + select * from + sys_user_notice + where + user_id=#{pageDTO.userId} + <if test='pageDTO.type != null and pageDTO.type != 0'>and type=#{pageDTO.type} + </if> + order by create_at desc + + </select> + + <select id="selectCountHouse" resultType="java.lang.Integer"> + SELECT + COUNT(h.id) + FROM + com_mng_struct_area a + LEFT JOIN com_mng_struct_house h on h.parent_code=a.area_code + WHERE + a.area_name = #{areaName} + </select> + + <update id="passResetUser"> + update sys_user set password = #{gridMemberDTO.password} where user_id in + <foreach item="item" collection="gridMemberDTO.ids" separator="," open="(" close=")" index=""> + #{item} + </foreach> + + </update> + + <update id="deleteUserTest"> + update sys_user set nick_name=null ,community_id=null,area_id=null where user_id=#{userId} + </update> + + <select id="selectCountArea" resultType="java.lang.Integer"> + select COUNT(a.id) from com_mng_struct_area a where a.area_name=#{areaName} + </select> + + <update id="addLcMember"> + update lc_compare_code_member set local_grid_member_id = #{userId},grid_member_name = #{userName} where id = #{lcMemberId} + </update> + + <update id="updateFaceState"> + update sys_user set face_state=null where user_id=#{userId} + </update> + + <select id="selectCommunity" resultType="com.panzhihua.common.model.vos.community.ComActVO"> + select name from com_act where community_id=#{communityId} + </select> + + <delete id="delLcMember"> + delete from lc_compare_code_member where local_grid_member_id = #{gridMemberId} + </delete> + + <select id="getBuilding" resultType="java.util.Map"> + select id,village_id,act_id from com_mng_building where id = #{buildingId} + </select> + + <select id="getLcMemberId" resultType="java.util.Map"> + select lc_grid_member_id,lc_grid_member_name,lc_bind_user_id from lc_compare_code_member where local_grid_member_id = #{gridMemberId} + </select> + + <select id="getGridIsOk" resultType="java.lang.Integer"> + select count(id) from event_grid_member_relation where grid_member_id = #{userId} + </select> + + +</mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/test/java/com/panzhihua/service_user/dao/UserDaoTest.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/test/java/com/panzhihua/service_user/dao/UserDaoTest.java new file mode 100644 index 0000000..fa78f8a --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/test/java/com/panzhihua/service_user/dao/UserDaoTest.java @@ -0,0 +1,47 @@ +package com.panzhihua.service_user.dao; + +import javax.annotation.Resource; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.panzhihua.common.model.vos.user.AdministratorsUserVO; +import com.panzhihua.service_user.ServiceUserApplication; + +import lombok.extern.slf4j.Slf4j; + +/** + * 应用模块名称 + * <p> + * 代码描述 + * <p> + * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. + * <p> + * Company: 成都呐喊信息技术有限公司 + * <p> + * + * @author manailin + * @since 2021/9/13 10:27 + */ +@Slf4j +@SpringBootTest(classes = ServiceUserApplication.class) +class UserDaoTest { + + @Resource + private UserDao userDao; + + @Test + void pageUserBackstage() { + Page page = new Page(1, 20); + AdministratorsUserVO administratorsUserVO = new AdministratorsUserVO(); + administratorsUserVO.setName("班长"); + IPage<AdministratorsUserVO> result = userDao.pageUserBackstage(page, administratorsUserVO); + String pretty = JSONArray.toJSONString(result, SerializerFeature.PrettyFormat, + SerializerFeature.WriteMapNullValue, SerializerFeature.WriteDateUseDateFormat); + log.info(pretty); + } +} \ No newline at end of file -- Gitblit v1.7.1