| | |
| | | // 查询对应的区域编号code |
| | | Dept dept = deptService.getById(id); |
| | | if (null != dept) { |
| | | if ( |
| | | (roleName.equals("mj") && dept.getDeptNature()==1) || |
| | | ( |
| | | (roleName.equals("wgy") || roleName.equals("wzcj")) && dept.getDeptNature()==2 |
| | | ) |
| | | ){ |
| | | if ((roleName.equals("mj") && dept.getDeptNature() == 1) || |
| | | ((roleName.equals("wgy") || roleName.equals("wzcj")) && dept.getDeptNature() == 2)) { |
| | | if (!AuthUtil.isAdministrator()) { |
| | | if (dept.getRegionCode() == null) { |
| | | return; |
| | |
| | | } |
| | | |
| | | if (isAdministrator == 2) { |
| | | if (!Strings.isBlank(communityCode)) { |
| | | if (Strings.isNotBlank(communityCode)) { |
| | | // 请求头带了后直接使用过滤 |
| | | regionChildCodesList.add(communityCode); |
| | | }else { |
| | |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | import org.springblade.modules.backblast.entity.BackblastPubRecordEntity; |
| | | import org.springblade.modules.category.dto.CategoryDTO; |
| | | import org.springblade.modules.category.service.ICategoryService; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | |
| | | import org.springblade.modules.doorplateAddress.vo.FuncNode; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridRangeEntity; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.grid.service.IGridRangeService; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | import org.springblade.modules.place.service.IPlacePoiLabelService; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | if (!Strings.isBlank(roleName)) { |
| | | // 如果是网格管理员,系统管理员,民警,无诈场所采集 |
| | | if (roleName.equals("admin") || |
| | | roleName.equals("wzcj") || |
| | | roleName.equals("wgy") || |
| | | roleName.equals("mj")) { |
| | | if (roleName.equals("admin") || roleName.equals("wzcj") || |
| | | roleName.equals("wgy") || roleName.equals("mj")) { |
| | | houseParam.setRoleName(roleName); |
| | | if ((roleName.equals("wgy") || roleName.equals("wzcj")) |
| | | && !userId.equals("1726859808689696770")) { |
| | |
| | | List<TreeStringNode> townList = baseMapper.getRegionListByGroupTwon(houseParam, stringList, communityList); |
| | | // 查询社区 |
| | | List<TreeStringNode> neiList = baseMapper.getRegionListByGroupNei(houseParam, stringList, communityList); |
| | | // 查询网格 |
| | | if (stringList.size() > 0) { |
| | | List<GridEntity> list1 = gridService.list(Wrappers.<GridEntity>lambdaQuery().in(GridEntity::getGridCode, stringList)); |
| | | } |
| | | // 遍历 |
| | | for (TreeStringNode treeNode : townList) { |
| | | // 遍历 |
| | |
| | | */ |
| | | List<GridmanVO> getGridmanList(@Param("gridman") GridmanVO gridman); |
| | | |
| | | Integer getGridStatistics(String code, Long userId, String roleType); |
| | | Integer getGridStatistics(List<String> communityCodeList, Long userId, String roleType); |
| | | |
| | | Integer getCompanyStatistics(String code, Long userId, String roleType); |
| | | Integer getCompanyStatistics(List<String> communityCodeList , Long userId, String roleType); |
| | | |
| | | Integer getOwnersCommitteeStatistics(String code, Long userId, String roleType); |
| | | Integer getOwnersCommitteeStatistics(List<String> communityCodeList, Long userId, String roleType); |
| | | |
| | | /** |
| | | * 网格员表 自定义详情 |
| | |
| | | SELECT count(1) number |
| | | FROM jczz_gridman jgm |
| | | LEFT JOIN jczz_grid jg ON jg.grid_code = jgm.grid_code |
| | | WHERE jg.community_code = #{code} |
| | | AND jg.is_deleted = 0 |
| | | <if test="userId!=null and roleType == '1'"> |
| | | and jgm.user_id= #{userId} |
| | | </if> |
| | | <where> |
| | | jg.community_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | AND jg.is_deleted = 0 |
| | | <if test="userId!=null and roleType == '1'"> |
| | | and jgm.user_id= #{userId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getCompanyStatistics" resultType="java.lang.Integer"> |
| | |
| | | FROM |
| | | jczz_property_company_district jpcd |
| | | LEFT JOIN jczz_district jd ON jd.id = jpcd.district_id |
| | | WHERE |
| | | jd.community_code = #{code} |
| | | and jpcd.is_deleted= 0 |
| | | <if test="userId!=null and roleType == '1'"> |
| | | AND jd.aoi_code in ( |
| | | SELECT distinct |
| | | jda.aoi_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.grid_code = jgm.grid_code |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jg.house_code |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | AND jda.aoi_code IS NOT NULL |
| | | ) |
| | | </if> |
| | | <where> |
| | | jd.community_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | and jpcd.is_deleted= 0 |
| | | <if test="userId!=null and roleType == '1'"> |
| | | AND jd.aoi_code in ( |
| | | SELECT distinct |
| | | jda.aoi_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.grid_code = jgm.grid_code |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jg.house_code |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | AND jda.aoi_code IS NOT NULL |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getOwnersCommitteeStatistics" resultType="java.lang.Integer"> |
| | |
| | | count(1) |
| | | FROM jczz_owners_committee joc LEFT JOIN |
| | | jczz_district jd ON jd.id = joc.area_id |
| | | WHERE |
| | | jd.community_code = #{code} |
| | | and joc.delete_flag= 0 |
| | | <if test="userId!=null and roleType == '1'"> |
| | | AND jd.aoi_code in ( |
| | | SELECT distinct |
| | | jda.aoi_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.grid_code = jgm.grid_code |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jg.house_code |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | AND jda.aoi_code IS NOT NULL |
| | | ) |
| | | </if> |
| | | <where> |
| | | jd.community_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | and joc.delete_flag= 0 |
| | | <if test="userId!=null and roleType == '1'"> |
| | | AND jd.aoi_code in ( |
| | | SELECT distinct |
| | | jda.aoi_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.grid_code = jgm.grid_code |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jg.house_code |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | AND jda.aoi_code IS NOT NULL |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | |
| | | @Override |
| | | public Object getGridStatistics(String code, String roleType) { |
| | | Map<String, Object> objectObjectHashMap = new HashMap<>(); |
| | | List<String> communityCodeList = Func.toStrList(code); |
| | | if (roleType.equals("2")) { |
| | | Integer gridStatistics = baseMapper.getGridStatistics(code, null, roleType); |
| | | Integer companyStatistics = baseMapper.getCompanyStatistics(code, null, roleType); |
| | | Integer ownersCommitteeStatistics = baseMapper.getOwnersCommitteeStatistics(code, null, roleType); |
| | | Integer gridStatistics = baseMapper.getGridStatistics(communityCodeList, null, roleType); |
| | | Integer companyStatistics = baseMapper.getCompanyStatistics(communityCodeList, null, roleType); |
| | | Integer ownersCommitteeStatistics = baseMapper.getOwnersCommitteeStatistics(communityCodeList, null, roleType); |
| | | objectObjectHashMap.put("gridStatistics", gridStatistics); |
| | | objectObjectHashMap.put("companyStatistics", companyStatistics); |
| | | objectObjectHashMap.put("ownersStatistics", ownersCommitteeStatistics); |
| | | } else { |
| | | Integer gridStatistics = baseMapper.getGridStatistics(code, AuthUtil.getUserId(), roleType); |
| | | Integer companyStatistics = baseMapper.getCompanyStatistics(code, AuthUtil.getUserId(), roleType); |
| | | Integer ownersCommitteeStatistics = baseMapper.getOwnersCommitteeStatistics(code, AuthUtil.getUserId(), roleType); |
| | | Integer gridStatistics = baseMapper.getGridStatistics(communityCodeList, AuthUtil.getUserId(), roleType); |
| | | Integer companyStatistics = baseMapper.getCompanyStatistics(communityCodeList, AuthUtil.getUserId(), roleType); |
| | | Integer ownersCommitteeStatistics = baseMapper.getOwnersCommitteeStatistics(communityCodeList, AuthUtil.getUserId(), roleType); |
| | | objectObjectHashMap.put("gridStatistics", gridStatistics); |
| | | objectObjectHashMap.put("companyStatistics", companyStatistics); |
| | | objectObjectHashMap.put("ownersStatistics", ownersCommitteeStatistics); |
| | |
| | | Map<String, HouseTree> getHouseTree(@Param("houseParam") HouseParam houseParam, |
| | | @Param("list") List<String> list); |
| | | |
| | | Integer getHouseStatisticsOne(String code, Long userId, String aoiCode, String buildingCode, String unitCode, String roleType); |
| | | Integer getHouseStatisticsOne(List<String> communityCodeList, Long userId, String aoiCode, String buildingCode, String unitCode, String roleType); |
| | | |
| | | Integer getHouseStatisticsTwo(@Param("code") String code, |
| | | Integer getHouseStatisticsTwo(@Param("communityCodeList") List<String> communityCodeList, |
| | | @Param("aoiCode") String aoiCode, |
| | | @Param("buildingCode") String buildingCode, |
| | | @Param("unitCode") String unitCode, |
| | |
| | | @Param("regionChildCodesList")List<String> regionChildCodesList, |
| | | @Param("gridCodeList")List<String> gridCodeList); |
| | | |
| | | Integer getHouseStatisticsThree(String code, Long userId, String aoiCode, String buildingCode, String unitCode, String roleType); |
| | | Integer getHouseStatisticsThree(List<String> communityCodeList, Long userId, String aoiCode, String buildingCode, String unitCode, String roleType); |
| | | |
| | | Integer getHouseStatisticsFour(String code, Long userId, String aoiCode, String buildingCode, String unitCode, String roleType); |
| | | Integer getHouseStatisticsFour(List<String> communityCodeList, Long userId, String aoiCode, String buildingCode, String unitCode, String roleType); |
| | | |
| | | List<String> getHouseBuilding(String districtCode); |
| | | |
| | |
| | | /** |
| | | * 按房屋标签统计 |
| | | * @param house |
| | | * @param isAdministrator |
| | | * @param regionChildCodesList |
| | | * @param gridCodeList |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getHouseLabelStatistic(@Param("house") HouseVO house, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList")List<String> regionChildCodesList, |
| | | @Param("gridCodeList")List<String> gridCodeList); |
| | | @Param("communityCodeList")List<String> regionChildCodesList); |
| | | |
| | | /** |
| | | * 查询对应的社区编号 |
| | |
| | | FROM |
| | | jczz_house jh |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | AND jh.is_deleted = 0 |
| | | <if test="buildingCode != null and buildingCode != ''"> |
| | | and jda.building_code=#{buildingCode} |
| | | </if> |
| | | <where> |
| | | jda.nei_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | AND jh.is_deleted = 0 |
| | | <if test="buildingCode != null and buildingCode != ''"> |
| | | and jda.building_code=#{buildingCode} |
| | | </if> |
| | | |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and jda.unit_code=#{unitCode} |
| | | </if> |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and jda.unit_code=#{unitCode} |
| | | </if> |
| | | |
| | | <if test="aoiCode != null and aoiCode != ''"> |
| | | and jda.aoi_code=#{aoiCode} |
| | | </if> |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT DISTINCT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <if test="userId != null and roleType == '3'"> |
| | | AND jda.address_code IN (SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code |
| | | WHERE |
| | | jc.res_police_user_id like concat('%',#{userId},'%')) |
| | | ) |
| | | </if> |
| | | ) a |
| | | <if test="aoiCode != null and aoiCode != ''"> |
| | | and jda.aoi_code=#{aoiCode} |
| | | </if> |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT DISTINCT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <if test="userId != null and roleType == '3'"> |
| | | AND jda.address_code IN (SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code |
| | | WHERE |
| | | jc.res_police_user_id like concat('%',#{userId},'%')) |
| | | ) |
| | | </if> |
| | | ) a |
| | | </where> |
| | | |
| | | |
| | | </select> |
| | | |
| | |
| | | LEFT JOIN jczz_house jh ON jda.address_code = jh.house_code AND jh.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg on jg.grid_code = jh.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jh.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | and jda.doorplate_type = '户室牌' |
| | | <choose> |
| | | <when test="(buildingCode != null and buildingCode != '') or |
| | | <where> |
| | | jda.nei_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | and jda.doorplate_type = '户室牌' |
| | | <choose> |
| | | <when test="(buildingCode != null and buildingCode != '') or |
| | | (unitCode != null and unitCode != '') or (aoiCode != null and aoiCode != '')"> |
| | | <if test="buildingCode != null and buildingCode != ''"> |
| | | and jda.building_code=#{buildingCode} |
| | | </if> |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and jda.unit_code=#{unitCode} |
| | | AND jda.unit_code is not null |
| | | </if> |
| | | <if test="aoiCode != null and aoiCode != ''"> |
| | | and jda.aoi_code=#{aoiCode} |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="house.roleName != null and house.roleName != ''"> |
| | | <if test="house.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jh.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jh.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="house.roleName=='mj'"> |
| | | <if test="buildingCode != null and buildingCode != ''"> |
| | | and jda.building_code=#{buildingCode} |
| | | </if> |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and jda.unit_code=#{unitCode} |
| | | AND jda.unit_code is not null |
| | | </if> |
| | | <if test="aoiCode != null and aoiCode != ''"> |
| | | and jda.aoi_code=#{aoiCode} |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="house.roleName != null and house.roleName != ''"> |
| | | <if test="house.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jh.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jh.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="house.roleName=='mj'"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" |
| | | separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jpag.community_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" |
| | | separator=","> |
| | | and ( jg.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and jpag.community_code in ('') |
| | | and |
| | | ( jg.grid_code in ('') or jpag.community_code in ('') ) |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and |
| | | ( |
| | | jg.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and |
| | | ( |
| | | jg.grid_code in ('') |
| | | or |
| | | jpag.community_code in ('') |
| | | ) |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </otherwise> |
| | | </choose> |
| | | </where> |
| | | |
| | | </select> |
| | | |
| | | |
| | |
| | | FROM |
| | | jczz_household jhh |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jhh.house_code |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | AND jhh.is_deleted = 0 |
| | | and jda.doorplate_type = '户室牌' |
| | | <if test="buildingCode != null and buildingCode != ''"> |
| | | and jda.building_code=#{buildingCode} |
| | | </if> |
| | | <where> |
| | | jda.nei_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | AND jhh.is_deleted = 0 |
| | | and jda.doorplate_type = '户室牌' |
| | | <if test="buildingCode != null and buildingCode != ''"> |
| | | and jda.building_code=#{buildingCode} |
| | | </if> |
| | | |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and jda.unit_code=#{unitCode} |
| | | AND jda.unit_code is not null |
| | | </if> |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and jda.unit_code=#{unitCode} |
| | | AND jda.unit_code is not null |
| | | </if> |
| | | |
| | | <if test="aoiCode != null and aoiCode != ''"> |
| | | and jda.aoi_code=#{aoiCode} |
| | | </if> |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT DISTINCT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <if test="userId != null and roleType == '3'"> |
| | | AND jda.address_code IN (SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code |
| | | WHERE |
| | | jc.res_police_user_id like concat('%',#{userId},'%')) |
| | | ) |
| | | </if> |
| | | <if test="aoiCode != null and aoiCode != ''"> |
| | | and jda.aoi_code=#{aoiCode} |
| | | </if> |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT DISTINCT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <if test="userId != null and roleType == '3'"> |
| | | AND jda.address_code IN (SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code |
| | | WHERE |
| | | jc.res_police_user_id like concat('%',#{userId},'%')) |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | |
| | | FROM |
| | | jczz_house jh |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | AND jh.is_deleted = 0 |
| | | AND jda.unit_code is not null |
| | | <if test="buildingCode != null and buildingCode != ''"> |
| | | and jda.building_code=#{buildingCode} |
| | | </if> |
| | | <where> |
| | | jda.nei_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | AND jh.is_deleted = 0 |
| | | AND jda.unit_code is not null |
| | | <if test="buildingCode != null and buildingCode != ''"> |
| | | and jda.building_code=#{buildingCode} |
| | | </if> |
| | | |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and jda.unit_code=#{unitCode} |
| | | </if> |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and jda.unit_code=#{unitCode} |
| | | </if> |
| | | |
| | | <if test="aoiCode != null and aoiCode != ''"> |
| | | and jda.aoi_code=#{aoiCode} |
| | | </if> |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT DISTINCT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <if test="userId != null and roleType == '3'"> |
| | | AND jda.address_code IN (SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code |
| | | WHERE |
| | | jc.res_police_user_id like concat('%',#{userId},'%')) |
| | | ) |
| | | </if> |
| | | ) a |
| | | |
| | | |
| | | <if test="aoiCode != null and aoiCode != ''"> |
| | | and jda.aoi_code=#{aoiCode} |
| | | </if> |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT DISTINCT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <if test="userId != null and roleType == '3'"> |
| | | AND jda.address_code IN (SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code |
| | | WHERE |
| | | jc.res_police_user_id like concat('%',#{userId},'%')) |
| | | ) |
| | | </if> |
| | | ) a |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getHouseBuilding" resultType="java.lang.String"> |
| | |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jh.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | LEFT JOIN jczz_user_house_label juhl ON juhl.house_code = jh.house_code and juhl.lable_type = 2 |
| | | where jda.doorplate_type = '户室牌' |
| | | <if test="house.communityCode != null and house.communityCode != ''"> |
| | | and jda.nei_code = #{house.communityCode} |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="house.roleName != null and house.roleName != ''"> |
| | | <if test="house.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jh.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jh.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="house.roleName=='mj'"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" |
| | | separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jpag.community_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and |
| | | ( |
| | | jg.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and |
| | | ( |
| | | jg.grid_code in ('') |
| | | or |
| | | jpag.community_code in ('') |
| | | ) |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | <if test="communityCodeList != null"> |
| | | and jda.nei_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </if> |
| | | group by juhl.label_name |
| | | ) b on a.label_name =b.labelName |
| | |
| | | SELECT |
| | | jhr.*, |
| | | jh.address as houseName, |
| | | b.tenantName, |
| | | br.town_name as townStreetName, |
| | | br.name as neiName, |
| | | b.phone, |
| | | <if test="vo.tenantInfoFlag != null and vo.tenantInfoFlag != 0"> |
| | | b.tenantName, |
| | | b.phone, |
| | | </if> |
| | | concat(jh.district_name," ",jh.building," ",unit," ",room) as address, |
| | | case when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )>= 8 then 1 |
| | | when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )<4 then 3 |
| | | else 2 end as dldType, |
| | | if(jhr.termination_time is null,if(date_format(jhr.due_time,'%Y-%m-%d') >= date_format(now(),'%Y-%m-%d'),0,1),2) as status |
| | | when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )<4 then 3 |
| | | else 2 end as dldType, |
| | | if(jhr.termination_time is null,if(date_format(jhr.due_time,'%Y-%m-%d') >= date_format(now(),'%Y-%m-%d'),0,1),2) |
| | | as status |
| | | FROM jczz_house_rental jhr |
| | | JOIN jczz_house jh ON jh.house_code = jhr.house_code and jh.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg on jg.grid_code = jh.grid_code and jg.is_deleted = 0 |
| | | left join blade_region br on br.code = jg.community_code |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jh.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | <if test="vo.tenantInfoFlag != null and vo.tenantInfoFlag != 0"> |
| | | LEFT JOIN ( |
| | | SELECT jht.housing_rental_id,jht.name as tenantName,jht.phone_number as phone |
| | | FROM jczz_household jht RIGHT JOIN ( |
| | |
| | | GROUP BY housing_rental_id |
| | | ) a ON a.id = jht.id and a.housing_rental_id is not null |
| | | ) b ON b.housing_rental_id = jhr.id |
| | | </if> |
| | | WHERE jhr.is_deleted = 0 |
| | | <if test="vo.townStreetName!=null and vo.townStreetName!=''"> |
| | | and br.town_name like concat('%',#{vo.townStreetName},'%') |
| | |
| | | */ |
| | | HouseholdOtherVO getSecurity(@Param("household") HouseholdVO household); |
| | | |
| | | List<Map<String, Object>> getHouseHoldStatistics(String code, Long userId, String roleType); |
| | | List<Map<String, Object>> getHouseHoldStatistics(List<String> communityCodeList, Long userId, String roleType); |
| | | |
| | | List<Map<String, Object>> getHouseHoldStatisticsAge(String code, Long userId, String roleType); |
| | | List<Map<String, Object>> getHouseHoldStatisticsAge(List<String> communityCodeList, Long userId, String roleType); |
| | | |
| | | /** |
| | | * 查询所有未入库的业主信息 |
| | |
| | | FROM |
| | | jczz_household jh |
| | | LEFT JOIN jczz_doorplate_address jda ON jh.house_code = jda.address_code |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | AND jh.is_deleted = 0 |
| | | and jda.doorplate_type = '户室牌' |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT DISTINCT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <if test="userId != null and roleType == '3'"> |
| | | AND jda.address_code IN (SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code |
| | | WHERE |
| | | jc.res_police_user_id like concat('%',#{userId},'%')) |
| | | ) |
| | | </if> |
| | | ) a |
| | | GROUP BY |
| | | a.gender |
| | | <where> |
| | | jda.nei_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | AND jh.is_deleted = 0 |
| | | and jda.doorplate_type = '户室牌' |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT DISTINCT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <if test="userId != null and roleType == '3'"> |
| | | AND jda.address_code IN (SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code |
| | | WHERE |
| | | jc.res_police_user_id like concat('%',#{userId},'%')) |
| | | ) |
| | | </if> |
| | | ) a |
| | | GROUP BY |
| | | a.gender |
| | | </where> |
| | | |
| | | </select> |
| | | <select id="getHouseHoldStatisticsAge" resultType="java.util.Map"> |
| | | |
| | |
| | | count(1) as number FROM |
| | | jczz_household jh |
| | | LEFT JOIN jczz_doorplate_address jda ON jh.house_code = jda.address_code |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | and jda.doorplate_type = '户室牌' |
| | | AND jh.is_deleted = 0 |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT |
| | | distinct jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | <where> |
| | | jda.nei_code in |
| | | <foreach collection="communityCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | and jda.doorplate_type = '户室牌' |
| | | AND jh.is_deleted = 0 |
| | | <if test="userId != null and roleType == '1'"> |
| | | AND jda.address_code IN ( |
| | | SELECT |
| | | distinct jgr.house_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | </where> |
| | | |
| | | GROUP BY age |
| | | </select> |
| | | |
| | |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; |
| | | import org.springblade.modules.doorplateAddress.service.IDoorplateAddressService; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | |
| | | if (!Strings.isBlank(roleName) && roleName.equals("mj")){ |
| | | userId = AuthUtil.getUserId(); |
| | | } |
| | | Integer result1 = baseMapper.getHouseStatisticsOne(code, userId, aoiCode, buildingCode, unitCode, roleType); |
| | | Integer result2 = baseMapper.getHouseStatisticsTwo(code, aoiCode, buildingCode, unitCode, house, |
| | | List<String> communityCodeList = Func.toStrList(code); |
| | | Integer result1 = baseMapper.getHouseStatisticsOne(communityCodeList, userId, aoiCode, buildingCode, unitCode, roleType); |
| | | Integer result2 = baseMapper.getHouseStatisticsTwo(communityCodeList, aoiCode, buildingCode, unitCode, house, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList()); |
| | | Integer result3 = baseMapper.getHouseStatisticsThree(code, userId, aoiCode, buildingCode, unitCode, roleType); |
| | | Integer result4 = baseMapper.getHouseStatisticsFour(code, userId, aoiCode, buildingCode, unitCode, roleType); |
| | | Integer result3 = baseMapper.getHouseStatisticsThree(communityCodeList, userId, aoiCode, buildingCode, unitCode, roleType); |
| | | Integer result4 = baseMapper.getHouseStatisticsFour(communityCodeList, userId, aoiCode, buildingCode, unitCode, roleType); |
| | | objectObjectHashMap.put("result1", result1); |
| | | objectObjectHashMap.put("result2", result2); |
| | | objectObjectHashMap.put("result3", result3); |
| | |
| | | public List<Map<String, Object>> getHouseLabelStatistic(HouseVO house) { |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(HouseVO.class, house); |
| | | // 按房屋标签统计 |
| | | List<Map<String, Object>> list = baseMapper.getHouseLabelStatistic(house, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList()); |
| | | List<String> communityCodeList = Func.toStrList(house.getCode()); |
| | | List<Map<String, Object>> list = baseMapper.getHouseLabelStatistic(house,communityCodeList); |
| | | // 返回 |
| | | return list; |
| | | } |
| | |
| | | @Override |
| | | public Object getHouseHoldStatistics(String code, String roleType) { |
| | | Map<String, Object> objectObjectHashMap = new HashMap<>(); |
| | | List<String> communityCodeList = Func.toStrList(code); |
| | | if (roleType.equals("2")) { |
| | | List<Map<String, Object>> result = baseMapper.getHouseHoldStatistics(code, null, roleType); |
| | | List<Map<String, Object>> result1 = baseMapper.getHouseHoldStatisticsAge(code, null, roleType); |
| | | List<Map<String, Object>> result = baseMapper.getHouseHoldStatistics(communityCodeList, null, roleType); |
| | | List<Map<String, Object>> result1 = baseMapper.getHouseHoldStatisticsAge(communityCodeList, null, roleType); |
| | | objectObjectHashMap.put("gender", result); |
| | | objectObjectHashMap.put("age", result1); |
| | | return objectObjectHashMap; |
| | | } else { |
| | | List<Map<String, Object>> result = baseMapper.getHouseHoldStatistics(code, AuthUtil.getUserId(), roleType); |
| | | List<Map<String, Object>> result1 = baseMapper.getHouseHoldStatisticsAge(code, AuthUtil.getUserId(), roleType); |
| | | List<Map<String, Object>> result = baseMapper.getHouseHoldStatistics(communityCodeList, AuthUtil.getUserId(), roleType); |
| | | List<Map<String, Object>> result1 = baseMapper.getHouseHoldStatisticsAge(communityCodeList, AuthUtil.getUserId(), roleType); |
| | | objectObjectHashMap.put("gender", result); |
| | | objectObjectHashMap.put("age", result1); |
| | | return objectObjectHashMap; |
| | |
| | | package org.springblade.modules.house.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springblade.modules.house.entity.HouseRentalEntity; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 房屋租户VO |
| | |
| | | @Data |
| | | public class HouseRentalTenantVO extends HouseRentalEntity { |
| | | |
| | | //租户名 |
| | | @ApiModelProperty(value = "租户名") |
| | | private String tenantName; |
| | | |
| | | //房屋名 |
| | | @ApiModelProperty(value = "房屋名") |
| | | private String houseName; |
| | | |
| | | //电话 |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 租房时间类型 1:长期 2:中期 3:短期 |
| | | */ |
| | | @ApiModelProperty(value = "租房时间类型 1:长期 2:中期 3:短期") |
| | | private Integer dldType; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 拼接地址 |
| | | */ |
| | | @ApiModelProperty(value = "拼接地址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 是否到期 0:未到期 1:已到期 2:已终止 |
| | | */ |
| | | @ApiModelProperty(value = "是否到期 0:未到期 1:已到期 2:已终止") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | @ApiModelProperty(value = "区域编号") |
| | | private String regionCode; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @ApiModelProperty(value = "开始时间") |
| | | private String startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @ApiModelProperty(value = "结束时间") |
| | | private String endTime; |
| | | |
| | | private String neiCode; |
| | | @ApiModelProperty(value = "小区编号") |
| | | private String neiCode; |
| | | |
| | | @ApiModelProperty(value = "用户编号") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | @ApiModelProperty(value = "角色名称") |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | @ApiModelProperty(value = "社区编号") |
| | | private String communityCode; |
| | | |
| | | /** |
| | | * 街道名称 |
| | | */ |
| | | @ApiModelProperty(value = "街道名称") |
| | | private String townStreetName; |
| | | |
| | | /** |
| | | * 社区名称 |
| | | */ |
| | | @ApiModelProperty(value = "社区名称") |
| | | private String neiName; |
| | | |
| | | @ApiModelProperty(value = "租户信息标识 0:未显示 1:显示") |
| | | private Integer tenantInfoFlag = 1; |
| | | |
| | | } |
| | |
| | | * 标签id |
| | | */ |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "编码", example = "") |
| | | private String code; |
| | | } |