| | |
| | | @ApiModelProperty(value = "小区地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "网格id") |
| | | private Long gridId; |
| | | |
| | | public String getSortColumns() { |
| | | // String dbColumn = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortAttr); |
| | | return sortAttr; |
| | |
| | | @ApiModelProperty(value = "特殊人员标签") |
| | | private String label; |
| | | |
| | | @ApiModelProperty(value = "网格id") |
| | | private Long gridId; |
| | | |
| | | private Integer outOrLocal; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty("养老金人员") |
| | | private Integer pensionTotal; |
| | | |
| | | @ApiModelProperty("楼栋数") |
| | | private Integer buildNum; |
| | | |
| | | } |
| | |
| | | R getGridVillageList(@RequestBody ComMngVillageListAppDTO villageListAppDTO); |
| | | |
| | | /** |
| | | * 综治app-小区列表 |
| | | * @param villageListAppDTO 请求参数 |
| | | * @return 小区列表 |
| | | */ |
| | | @PostMapping("/village/grid/list/app") |
| | | R getGridVillageListApp(@RequestBody ComMngVillageListAppDTO villageListAppDTO); |
| | | |
| | | /** |
| | | * 综治app-根据小区id查询小区下楼栋列表 |
| | | * |
| | | * @param villageId |
| | |
| | | public R list(@RequestBody ComMngVillageListAppDTO villageListAppDTO) { |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | villageListAppDTO.setCommunityId(loginUserInfoVO.getCommunityId()); |
| | | return communityService.getGridVillageList(villageListAppDTO); |
| | | return communityService.getGridVillageListApp(villageListAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "小区楼栋列表@lyq", response = ComMngVillageBuildingVO.class) |
| | |
| | | return comMngVillageService.getGridVillageList(villageListAppDTO); |
| | | } |
| | | |
| | | @PostMapping("/village/grid/list/app") |
| | | public R getGridPopulationAdminListApp(@RequestBody ComMngVillageListAppDTO villageListAppDTO) { |
| | | return comMngVillageService.getGridVillageList(villageListAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 综治app-根据小区id查询小区下楼栋列表 |
| | | * |
| | |
| | | + "WHERE " + "d.id =#{id} " + "GROUP BY d.id") |
| | | ComActDiscussVO selectHaveSignAndHaveVote(@Param("id") Long id, @Param("loginUserId") Long loginUserId); |
| | | |
| | | @Select(" SELECT COUNT(id) AS totalNum," |
| | | + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND create_at between date_sub(curdate() - day(curdate()) +1,interval 1 month) and now())AS currentNum," |
| | | + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND TYPE = 1)AS imgNum," + "(" |
| | | + "SELECT " + " count(distinct cadc.user_id) " + "FROM " + " com_act_discuss_comment AS cadc " |
| | | + " LEFT JOIN com_act_discuss AS cad ON cad.id = cadc.discuss_id " |
| | | + " where cad.type = 1 and cad.community_id = #{communityId} " + ")AS imgPeopleNum," + "(" |
| | | + "select count(user_id) from ( " + "SELECT " + " distinct cadc.user_id " + "FROM " |
| | | + " com_act_discuss_comment AS cadc " + " LEFT JOIN com_act_discuss AS cad ON cad.id = cadc.discuss_id " |
| | | + " where cad.type = 2 and cad.community_id = #{communityId} " + " union all " |
| | | + " SELECT DISTINCT cadou.user_id FROM com_act_discuss_option_user AS cadou LEFT JOIN com_act_discuss_option AS cado ON cado.id = cadou.discuss_option_id left join com_act_discuss as cad on cad.id = cado.discuss_id where cad.community_id = #{communityId}" |
| | | + ") t" + ")AS votePeopleNum " + " FROM com_act_discuss") |
| | | |
| | | Map<String, Long> countByCommunityId(@Param("communityId") Long communityId, @Param("date") String date); |
| | | |
| | | @Select(" SELECT id,discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = #{communityId} ORDER BY create_at DESC LIMIT #{pageSize}") |
| | |
| | | IPage<PageComMngVillageVO> getGridVillageList(Page page, |
| | | @Param("villageListAppDTO") ComMngVillageListAppDTO villageListAppDTO); |
| | | |
| | | IPage<PageComMngVillageVO> getGridVillageListApp(Page page, |
| | | @Param("villageListAppDTO") ComMngVillageListAppDTO villageListAppDTO); |
| | | |
| | | @Select("<script> " + "SELECT " + " alley, " + " house_num as doorNum, " + " `name` AS userName, " + " build_sum, " |
| | | + " address, " + " create_at as createAt, " |
| | | + " ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id ) AS userSum, " |
| | |
| | | + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmp.out_or_local = 2) as outTotal " |
| | | + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmpct.label is not null) as specialTotal " |
| | | + ",(select count(DISTINCT `name`) from com_mng_village where community_id = #{communityId}) as villageTotal " |
| | | + ",(select count(id) from com_mng_building where act_id = #{communityId}) as buildNum " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','吸毒人员','%')) as drugTotal " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','社区矫正','%')) as correctTotal " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','精神障碍患者','%')) as majorTotal " |
| | |
| | | List<PopulationListVO> getGridVillageBuildingPopulationList(@Param("houseId") Long houseId, |
| | | @Param("relation") Integer relation, @Param("relationId") Integer relationId); |
| | | |
| | | @Select("select id as houseId,floor from com_mng_population_house where village_id = #{villageId} and floor is not null order by create_at asc") |
| | | @Select("select id as houseId,floor from com_mng_population_house where village_id = #{villageId} and floor is not null group by floor order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByFloors(@Param("villageId") Long villageId); |
| | | |
| | | @Select("select id as houseId,unit_no from com_mng_population_house where village_id = #{villageId} and floor = #{floor} order by create_at asc") |
| | | @Select("select id as houseId,unit_no from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no is not null group by unit_no order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByUnitNos(@Param("villageId") Long villageId, @Param("floor") String floor); |
| | | |
| | | @Select("select id as houseId,house_no from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unitNo} order by create_at asc") |
| | | @Select("select id as houseId,house_no from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unitNo} and house_no is not null group by house_no order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByHouseNos(@Param("villageId") Long villageId, @Param("floor") String floor, |
| | | @Param("unitNo") String unitNo); |
| | | |
| | |
| | | */ |
| | | R getGridVillageList(ComMngVillageListAppDTO villageListAppDTO); |
| | | |
| | | |
| | | R getGridVillageListApp(ComMngVillageListAppDTO villageListAppDTO); |
| | | |
| | | /** |
| | | * 小区下楼栋列表 |
| | | * |
| | |
| | | // subordinateList = |
| | | // subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new |
| | | // TreeSet<>(Comparator.comparing(o -> o.getFloor()))), ArrayList::new)); |
| | | subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getFloor)) |
| | | .collect(Collectors.toList()); |
| | | // subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getFloor)) |
| | | // .collect(Collectors.toList()); |
| | | subordinateList.forEach(cascade -> { |
| | | if (cascade.getFloor().contains("栋")) { |
| | | cascade.setName(cascade.getFloor()); |
| | |
| | | if (houseDO != null) { |
| | | subordinateList = |
| | | this.baseMapper.getHouseLevelByUnitNos(houseDO.getVillageId(), houseDO.getFloor()); |
| | | subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getUnitNo)) |
| | | .collect(Collectors.toList()); |
| | | // subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getUnitNo)) |
| | | // .collect(Collectors.toList()); |
| | | // subordinateList = |
| | | // subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new |
| | | // TreeSet<>(Comparator.comparing(o -> o.getUnitNo()))), ArrayList::new)); |
| | |
| | | if (houseDO != null) { |
| | | subordinateList = this.baseMapper.getHouseLevelByHouseNos(houseDO.getVillageId(), |
| | | houseDO.getFloor(), houseDO.getUnitNo()); |
| | | subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getHouseNo)) |
| | | .collect(Collectors.toList()); |
| | | // subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getHouseNo)) |
| | | // .collect(Collectors.toList()); |
| | | // subordinateList = |
| | | // subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new |
| | | // TreeSet<>(Comparator.comparing(o -> o.getHouseNo()))), ArrayList::new)); |
| | |
| | | new Page(villageListAppDTO.getPageNum(), villageListAppDTO.getPageSize()), villageListAppDTO)); |
| | | } |
| | | |
| | | @Override |
| | | public R getGridVillageListApp(ComMngVillageListAppDTO villageListAppDTO) { |
| | | return R.ok(this.baseMapper.getGridVillageList( |
| | | new Page(villageListAppDTO.getPageNum(), villageListAppDTO.getPageSize()), villageListAppDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 综治app-根据小区id查询小区下楼栋列表 |
| | | * |
| | |
| | | int half = day / 2; |
| | | String month = DateUtil.format(date, moth_format_str); |
| | | DynamicWorkVO dynamicWorkVO = new DynamicWorkVO(); |
| | | dynamicWorkVO.setMonth(monthStr[m] + "月上旬"); |
| | | dynamicWorkVO.setMonth(monthStr[m-1] + "月上旬"); |
| | | dynamicWorkVO.setStart(month + "-01 00:00:00"); |
| | | dynamicWorkVO.setEnd(month + "-" + half + " 23:59:58"); |
| | | dateList.add(dynamicWorkVO); |
| | | DynamicWorkVO dynamicWorkVO1 = new DynamicWorkVO(); |
| | | dynamicWorkVO1.setMonth(monthStr[m] + "月下旬"); |
| | | dynamicWorkVO1.setMonth(monthStr[m-1] + "月下旬"); |
| | | dynamicWorkVO1.setStart(month + "-" + half + " 23:59:58"); |
| | | dynamicWorkVO1.setEnd(DateUtils.getDateFormatString(endDay, "yyyy-MM-dd HH:mm:ss")); |
| | | dateList.add(dynamicWorkVO1); |
| | | } |
| | | return dateList; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | limit 10 |
| | | </select> |
| | | |
| | | <select id="countByCommunityId" resultType="Map"> |
| | | SELECT |
| | | COUNT( id ) AS totalNum, |
| | | ( |
| | | SELECT |
| | | COUNT( id ) |
| | | FROM |
| | | com_act_discuss |
| | | WHERE |
| | | community_id = #{communityId} |
| | | AND create_at BETWEEN DATE_ADD(curdate(),interval -day(curdate())+1 day) |
| | | AND now()) AS currentNum, |
| | | ( SELECT COUNT( id ) FROM com_act_discuss WHERE community_id = #{communityId} AND TYPE = 1 ) AS imgNum, |
| | | ( |
| | | SELECT |
| | | count( DISTINCT cadc.user_id ) |
| | | FROM |
| | | com_act_discuss_comment AS cadc |
| | | LEFT JOIN com_act_discuss AS cad ON cad.id = cadc.discuss_id |
| | | WHERE |
| | | cad.type = 1 |
| | | AND cad.community_id = #{communityId} |
| | | ) AS imgPeopleNum, |
| | | ( |
| | | SELECT |
| | | count( user_id ) |
| | | FROM |
| | | ( |
| | | SELECT DISTINCT |
| | | cadc.user_id |
| | | FROM |
| | | com_act_discuss_comment AS cadc |
| | | LEFT JOIN com_act_discuss AS cad ON cad.id = cadc.discuss_id |
| | | WHERE |
| | | cad.type = 2 |
| | | AND cad.community_id = #{communityId} UNION ALL |
| | | SELECT DISTINCT |
| | | cadou.user_id |
| | | FROM |
| | | com_act_discuss_option_user AS cadou |
| | | LEFT JOIN com_act_discuss_option AS cado ON cado.id = cadou.discuss_option_id |
| | | LEFT JOIN com_act_discuss AS cad ON cad.id = cado.discuss_id |
| | | WHERE |
| | | cad.community_id = #{communityId} |
| | | ) t |
| | | ) AS votePeopleNum |
| | | FROM |
| | | com_act_discuss |
| | | WHERE |
| | | community_id = #{communityId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | com_mng_population AS cmp |
| | | LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id |
| | | LEFT JOIN com_mng_population_community_tags AS cmpct ON cmp.id = cmpct.population_id |
| | | LEFT JOIN event_grid_data as egd on egd.grid_community_id = cmpct.community_id |
| | | WHERE |
| | | cmpct.community_id = #{populationListDTO.communityId} |
| | | egd.id = #{populationListDTO.gridId} |
| | | <if test = 'populationListDTO.keyWord != null and populationListDTO.keyWord != ""' > |
| | | AND (cmp.`name` LIKE concat (#{populationListDTO.keyWord},'%') or cmp.card_no_str like concat (#{populationListDTO.keyWord},'%')) |
| | | </if> |
New file |
| | |
| | | <?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_community.dao.ComActVillageDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComMngVillageDO"> |
| | | <id column="village_id" property="villageId" /> |
| | | <result column="street_id" property="streetId" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="alley" property="alley" /> |
| | | <result column="house_num" property="houseNum" /> |
| | | <result column="group_at" property="groupAt" /> |
| | | <result column="type" property="type" /> |
| | | <result column="name" property="name" /> |
| | | <result column="build_sum" property="buildSum" /> |
| | | <result column="build_year" property="buildYear" /> |
| | | <result column="build_type" property="buildType" /> |
| | | <result column="property" property="property" /> |
| | | <result column="developers" property="developers" /> |
| | | <result column="user_sum" property="userSum" /> |
| | | <result column="village_images" property="villageImages" /> |
| | | <result column="address" property="address" /> |
| | | <result column="path" property="path" /> |
| | | <result column="lng" property="lng" /> |
| | | <result column="lat" property="lat" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | village_id, street_id, community_id, alley, house_num, group_at, type, name, build_sum, build_year, build_type, property, developers, user_sum, village_images, address, path, lng, lat, create_at, update_at |
| | | </sql> |
| | | |
| | | <select id="getGridVillageListApp" resultType="com.panzhihua.common.model.vos.grid.PageComMngVillageVO"> |
| | | SELECT cmv.village_id, cmv.`name` AS userName, IFNULL((select count(id) from com_mng_building where village_id = cmv.village_id),0) as buildSum, address, |
| | | cmv.create_at as createAt, cmv.lng, cmv.lat, |
| | | ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id ) AS userSum, |
| | | ( SELECT count( id ) FROM com_mng_population_house WHERE village_id = cmv.village_id ) AS houseNum, |
| | | ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id AND out_or_local = 1 ) AS registerNum, |
| | | ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id AND is_rent = 2 ) AS rentNum |
| | | FROM com_mng_village AS cmv |
| | | LEFT JOIN event_grid_data as egd on egd.grid_community_id = cmv.community_id |
| | | where 1=1 |
| | | <if test='villageListAppDTO.gridId != null'> |
| | | and egd.id = #{villageListAppDTO.gridId} |
| | | </if> |
| | | <if test='villageListAppDTO.address != null and villageListAppDTO.address != ""'> |
| | | and cmv.address like concat(#{villageListAppDTO.address},'%') |
| | | </if> |
| | | <if test='villageListAppDTO.alley != null and villageListAppDTO.alley != ""'> |
| | | and cmv.alley like concat(#{villageListAppDTO.alley},'%') |
| | | </if> |
| | | <if test='villageListAppDTO.houseNum != null and villageListAppDTO.houseNum != ""'> |
| | | and cmv.house_num like concat(#{villageListAppDTO.houseNum},'%') |
| | | </if> |
| | | <if test='villageListAppDTO.groupAt != null and villageListAppDTO.groupAt != ""'> |
| | | and cmv.group_at like concat(#{villageListAppDTO.groupAt},'%') |
| | | </if> |
| | | <if test='villageListAppDTO.name != null and villageListAppDTO.name != ""'> |
| | | and cmv.name like concat(#{villageListAppDTO.name},'%') |
| | | </if> |
| | | <if test='villageListAppDTO.sortColumns!=null'> |
| | | ORDER BY ${villageListAppDTO.sortColumns} ${villageListAppDTO.sortType} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="query.keyWord != null and query.keyWord != ''"> |
| | | and( |
| | | p.card_no_str like concat('%',#{query.keyWord},'%') or |
| | | p.`name` like concat('%',#{query.keyWord},'%') or |
| | | vt.visiter_address like concat('%',#{query.keyWord},'%') |
| | | ) |
| | | </if> |