From 54ad966d0b142c97fc659263b51d1ea5d7b5c7c6 Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期五, 28 五月 2021 16:17:08 +0800 Subject: [PATCH] 修改bug --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java | 98 ++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 84 insertions(+), 14 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java index 15b6e14..69a4333 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java @@ -4,10 +4,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; +import com.panzhihua.common.model.dtos.user.PageInputUserDTO; +import com.panzhihua.common.model.vos.area.AreaAddressVO; import com.panzhihua.common.model.vos.community.ComActMessageVO; +import com.panzhihua.common.model.vos.community.ComMngPopulationTotalVO; import com.panzhihua.common.model.vos.community.ComMngPopulationVO; import com.panzhihua.common.model.vos.community.PageComActMessageVO; +import com.panzhihua.common.model.vos.user.ComHouseMemberVo; import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; +import com.panzhihua.common.model.vos.user.InputUserInfoVO; +import com.panzhihua.common.model.vos.user.UserElectronicFileVO; import com.panzhihua.service_community.model.dos.ComMngPopulationDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -85,12 +91,18 @@ "AND cmp.remark = #{comMngPopulationVO.remark} " + " </if> " + " </where>" + + " order by cmp.create_at desc " + "</script>") List<ComMngPopulationVO> listPopulation(ComMngPopulationDTO populationVO); - @Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at from com_mng_family_info where user_id=#{userId}") + @Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at,card_photo_front,card_photo_back,family_book from com_mng_family_info where user_id=#{userId} order by create_at desc ") List<ComMngFamilyInfoVO> listFamilyByUserId(Long userId); + + @Select("select cmphu.popul_id,cmp.name,cmp.relation,cmp.age,cmp.phone,cmp.healthy,cmp.card_no,cmp.work_company from com_mng_population_house_user cmphu " + + " left join com_mng_population cmp on cmp.id = cmphu.popul_id " + + " where cmphu.house_id = #{houseId} and cmphu.popul_id != #{populId}") + List<ComHouseMemberVo> listHouseMermberByUserId(@Param("houseId") Long houseId, @Param("populId") Long populId); @Select("<script> " + "SELECT\n" + @@ -116,52 +128,110 @@ "cmp.native_place,\n" + "cmp.nation, \n" + "cmp.label, \n" + + "cmp.relation, \n" + + "cmp.marriage, \n" + + "cmp.culture_level, \n" + + "cmp.out_or_local, \n" + + "cmp.census_register, \n" + + "cmp.healthy, \n" + + "cmp.birthday, \n" + "cmp.is_rent \n" + "FROM \n" + "com_mng_population AS cmp " + "LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id " + "<where>" + - "<if test='comMngPopulationVO.name != null and comMngPopulationVO.name.trim() != ""'>" + + "<if test='comMngPopulationVO.name != null and comMngPopulationVO.name != ""'>" + "AND cmp.`name` LIKE concat(#{comMngPopulationVO.name},'%') " + " </if> " + - "<if test='comMngPopulationVO.road != null and comMngPopulationVO.road.trim() != ""'>" + - "AND cmp.road LIKE concat(#{comMngPopulationVO.road},'%') " + + "<if test='comMngPopulationVO.actId != null'>" + + " and cmp.act_id = #{comMngPopulationVO.actId} " + " </if> " + - "<if test='comMngPopulationVO.doorNo != null and comMngPopulationVO.doorNo.trim() != ""'>" + + "<if test='comMngPopulationVO.villageId != null'>" + + " and cmp.village_id = #{comMngPopulationVO.villageId} " + + " </if> " + + "<if test='comMngPopulationVO.road != null and comMngPopulationVO.road != ""'>" + + "AND cmp.road = #{comMngPopulationVO.road} " + + " </if> " + + "<if test='comMngPopulationVO.doorNo != null and comMngPopulationVO.doorNo != ""'>" + "AND cmp.door_no = #{comMngPopulationVO.doorNo} " + " </if> " + - "<if test='comMngPopulationVO.alley != null and comMngPopulationVO.alley.trim() != ""'>" + + "<if test='comMngPopulationVO.floor != null and comMngPopulationVO.floor != ""'>" + + "AND cmp.floor = #{comMngPopulationVO.floor} " + + " </if> " + + "<if test='comMngPopulationVO.unitNo != null and comMngPopulationVO.unitNo != ""'>" + + "AND cmp.unit_no = #{comMngPopulationVO.unitNo} " + + " </if> " + + "<if test='comMngPopulationVO.houseNo != null and comMngPopulationVO.houseNo != ""'>" + + "AND cmp.house_no = #{comMngPopulationVO.houseNo} " + + " </if> " + + "<if test='comMngPopulationVO.alley != null and comMngPopulationVO.alley != ""'>" + "AND cmv.alley LIKE concat(#{comMngPopulationVO.alley},'%') " + " </if> " + - "<if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex.trim() != ""'>" + + "<if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex != ""'>" + "AND cmp.sex = #{comMngPopulationVO.sex} " + " </if> " + - "<if test='comMngPopulationVO.ageStart != null'>" + + "<if test='comMngPopulationVO.ageStart != null and comMngPopulationVO.ageStart != ""'>" + "AND cmp.age <![CDATA[ >= ]]> #{comMngPopulationVO.ageStart} " + " </if> " + - "<if test='comMngPopulationVO.ageEnd != null'>" + + "<if test='comMngPopulationVO.ageEnd != null and comMngPopulationVO.ageEnd != ""'>" + "AND cmp.age <![CDATA[ <= ]]> #{comMngPopulationVO.ageEnd} " + " </if> " + - "<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace.trim() != ""'>" + + "<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace != ""'>" + "AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " + " </if> " + - "<if test='comMngPopulationVO.nation != null and comMngPopulationVO.nation.trim() != ""'>" + + "<if test='comMngPopulationVO.nation != null and comMngPopulationVO.nation != ""'>" + "AND cmp.nation = #{comMngPopulationVO.nation} " + " </if> " + - "<if test='comMngPopulationVO.politicalOutlook != null and comMngPopulationVO.politicalOutlook.trim() != ""'>" + + "<if test='comMngPopulationVO.politicalOutlook != null and comMngPopulationVO.politicalOutlook != ""'>" + "AND cmp.political_outlook = #{comMngPopulationVO.politicalOutlook} " + " </if> " + - "<if test='comMngPopulationVO.cardNo != null and comMngPopulationVO.cardNo.trim() != ""'>" + + "<if test='comMngPopulationVO.cardNo != null and comMngPopulationVO.cardNo != ""'>" + "AND cmp.card_no = #{comMngPopulationVO.cardNo} " + " </if> " + - "<if test='comMngPopulationVO.remark != null and comMngPopulationVO.remark.trim() != ""'>" + + "<if test='comMngPopulationVO.remark != null and comMngPopulationVO.remark != ""'>" + "AND cmp.remark = #{comMngPopulationVO.remark} " + " </if> " + " </where>" + + " order by cmp.create_at desc" + "</script>") IPage<ComMngPopulationVO> pagePopulation(Page page, @Param("comMngPopulationVO") ComMngPopulationDTO comMngPopulationVO); + @Select("<script> " + + "select cmp.id,cmv.`alley` as areaName,cmp.`name`,cmp.phone,cmp.label as tags,cmp.create_at from com_mng_population as cmp " + + "left join com_mng_village as cmv on cmv.village_id = cmp.village_id where cmp.act_id = #{pageInputUserDTO.communityId} and cmp.label is not null " + + "<if test='pageInputUserDTO.name != null and pageInputUserDTO.name != ""'>" + + " AND cmp.`name` LIKE concat(#{pageInputUserDTO.name},'%') " + + " </if> " + + "<if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName != ""'>" + + " AND cmv.`alley` LIKE concat(#{pageInputUserDTO.areaName},'%') " + + " </if> " + + "<if test='pageInputUserDTO.tags != null and pageInputUserDTO.tags != ""'>" + + " AND cmp.label like concat('%',#{pageInputUserDTO.tags},'%') " + + " </if> " + + " order by cmp.create_at desc " + + "</script>") + IPage<InputUserInfoVO> specialInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO); + @Select("select user_id,card_photo_front,card_photo_back,family_book from sys_user where id_card=#{idCard}") + UserElectronicFileVO getSysUserElectronicFile(@Param("idCard") String idCard); + @Select("select user_id,card_photo_front,card_photo_back,family_book from sys_user where user_id=#{userId}") + UserElectronicFileVO getSysUserById(@Param("userId") Long userId); + @Select("update sys_user set card_photo_front=#{vo.cardPhotoFront},card_photo_back=#{vo.cardPhotoBack},family_book=#{vo.familyBook} where user_id=#{vo.userId}") + void updateSysUserElectronicFile(@Param("vo") UserElectronicFileVO vo); + + @Select("<script> " + + "select (select province_name from com_mng_struct_area_province where province_adcode = #{provinceCode}) as province," + + "(select city_name from com_mng_struct_area_city where city_adcode = #{cityCode}) as city," + + "(select district_name from com_mng_struct_area_district where district_adcode = #{districtCode}) as district" + + "</script>") + AreaAddressVO getAreaAddress(@Param("provinceCode") String provinceCode,@Param("cityCode") String cityCode,@Param("districtCode") String districtCode); + + @Select("select count(id) as populationTotal " + + ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 1) as localTotal " + + ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 2) as outTotal " + + ",(select count(id) from com_mng_population where act_id = #{communityId} and label is null) as specialTotal " + + " from com_mng_population as cmp where act_id = #{communityId}") + ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId); } -- Gitblit v1.7.1