From d132ccb2e8e8d92088b9c452a00087b1a8518417 Mon Sep 17 00:00:00 2001 From: Null <281575458@qq.com> Date: 星期四, 18 三月 2021 16:56:43 +0800 Subject: [PATCH] 居民管理 --- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserInputDAO.java | 74 +++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) 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 2f62962..380f0a1 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 @@ -1,9 +1,13 @@ package com.panzhihua.service_user.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.panzhihua.common.model.dtos.user.PageInputUserDTO; import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; +import com.panzhihua.common.model.vos.user.InputUserInfoVO; import com.panzhihua.service_user.model.dos.SysUserInputDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -54,4 +58,74 @@ "\tp.door_number = #{doorNumber} \n" + "\tAND p.id !=#{userId}") List<ComMngFamilyInfoVO> selectListFamily(@Param("doorNumber") String doorNumber, @Param("userId")Long userId); + + @Select("<script> " + + "SELECT " + + " 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, " + + " 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 " + + "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.areaId != null and pageInputUserDTO.areaId.trim() != ""'>" + + " and t.area_id = #{pageInputUserDTO.areaId} " + + " </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("" + + "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); } -- Gitblit v1.7.1