小区,房屋,人员,场所查询新增街道,社区,网格信息返回
| | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="districtResultMap" type="org.springblade.modules.district.entity.DistrictEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="aoi_cdoe" property="aoiCdoe"/> |
| | | <result column="aoi_code" property="aoiCode"/> |
| | | <result column="community_code" property="communityCode"/> |
| | | <result column="name" property="name"/> |
| | | <result column="address" property="address"/> |
| | |
| | | |
| | | <!--自定义分页--> |
| | | <select id="selectDistrictPage" resultType="org.springblade.modules.district.vo.DistrictVO"> |
| | | select * from jczz_district |
| | | where is_deleted = 0 |
| | | select |
| | | jd.*, |
| | | br.village_name as communityName,br.town_name as townStreetName |
| | | from jczz_district jd |
| | | left join blade_region br on br.code = jd.community_code |
| | | where jd.is_deleted = 0 |
| | | <if test="district.name !=null and district.name !=''"> |
| | | and name like concat('%',#{district.name},'%') |
| | | and jd.name like concat('%',#{district.name},'%') |
| | | </if> |
| | | <if test="district.communityCode !=null and district.communityCode !=''"> |
| | | and community_code = #{district.communityCode} |
| | | and jd.community_code = #{district.communityCode} |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | import org.springblade.modules.district.mapper.DistrictMapper; |
| | | import org.springblade.modules.district.service.IDistrictService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.vo.GridVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | |
| | | @Service |
| | | public class DistrictServiceImpl extends ServiceImpl<DistrictMapper, DistrictEntity> implements IDistrictService { |
| | | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Override |
| | | public IPage<DistrictVO> selectDistrictPage(IPage<DistrictVO> page, DistrictVO district) { |
| | | return page.setRecords(baseMapper.selectDistrictPage(page, district)); |
| | | List<DistrictVO> districtVOS = baseMapper.selectDistrictPage(page, district); |
| | | // 遍历 |
| | | for (DistrictVO districtVO : districtVOS) { |
| | | // 设置对应的网格名称 |
| | | List<GridVO> gridVO = gridService.getGridListByAoiCode(districtVO.getAoiCode()); |
| | | if (gridVO.size()>0) { |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (GridVO vo : gridVO) { |
| | | builder.append(vo.getGridName()).append(","); |
| | | } |
| | | String bui = builder.toString(); |
| | | String substring = bui.substring(0, bui.length() - 1); |
| | | districtVO.setGridName(substring); |
| | | } |
| | | } |
| | | // 返回 |
| | | return page.setRecords(districtVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String communityName; |
| | | |
| | | /** |
| | | * 街道名称 |
| | | */ |
| | | private String townStreetName; |
| | | |
| | | /** |
| | | * 网格名称 |
| | | */ |
| | | private String gridName; |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<GridEntity> getGridList(@Param("grid") GridVO grid); |
| | | |
| | | /** |
| | | * 查询小区网格绑定 |
| | | * @param aoiCode 小区aoiCode |
| | | * @return |
| | | */ |
| | | List<GridVO> getGridListByAoiCode(@Param("aoiCode") String aoiCode); |
| | | } |
| | |
| | | order by sort asc |
| | | </select> |
| | | |
| | | <!--查询小区网格绑定--> |
| | | <select id="getGridListByAoiCode" resultType="org.springblade.modules.grid.vo.GridVO"> |
| | | SELECT jg.id,jg.grid_name from jczz_grid jg |
| | | left join jczz_grid_range jgr on jg.id = jgr.grid_id |
| | | where jg.is_deleted = 0 |
| | | and jgr.district_code = #{aoiCode} |
| | | GROUP BY jg.id,jg.grid_name |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | Object getGridList(GridVO grid); |
| | | |
| | | /** |
| | | * 查询小区网格绑定 |
| | | * @param aoiCode 小区aoiCode |
| | | * @return |
| | | */ |
| | | List<GridVO> getGridListByAoiCode(String aoiCode); |
| | | } |
| | |
| | | public Object getGridList(GridVO grid) { |
| | | return baseMapper.getGridList(grid); |
| | | } |
| | | |
| | | /** |
| | | * 查询小区网格绑定 |
| | | * @param aoiCode 小区aoiCode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<GridVO> getGridListByAoiCode(String aoiCode) { |
| | | return baseMapper.getGridListByAoiCode(aoiCode); |
| | | } |
| | | } |
| | |
| | | |
| | | <!--自定义分页列表--> |
| | | <select id="selectHousePage" resultMap="houseAndHouseLabelMap"> |
| | | select jh.*,concat(building," ",unit," ",room) as address from jczz_house jh |
| | | select |
| | | jh.*, |
| | | concat(building," ",unit," ",room) as address, |
| | | jda.town_street_name as townStreetName,jda.nei_name as neiName |
| | | from jczz_house jh |
| | | left join jczz_doorplate_address jda on jda.address_code = jh.house_code |
| | | where is_deleted = 0 |
| | | <if test="house.id != null "> and id = #{house.id}</if> |
| | | where jh.is_deleted = 0 |
| | | <if test="house.id != null "> and jh.id = #{house.id}</if> |
| | | <if test="house.streetCode != null and house.streetCode != ''"> |
| | | and jda.town_street_code like concat('%',#{house.streetCode},'%') |
| | | and jda.town_street_code like concat('%',#{house.streetCode},'%') |
| | | </if> |
| | | <if test="house.houseCode != null and house.houseCode != ''"> and house_code = #{house.houseCode}</if> |
| | | <if test="house.districtCode != null and house.districtCode != ''"> and district_code = #{house.districtCode}</if> |
| | | <if test="house.houseCode != null and house.houseCode != ''"> and jh.house_code = #{house.houseCode}</if> |
| | | <if test="house.districtCode != null and house.districtCode != ''"> and jh.district_code = #{house.districtCode}</if> |
| | | <if test="house.districtName != null and house.districtName != ''"> |
| | | and district_name like concat('%',#{house.districtName},'%') |
| | | </if> |
| | | and jh.district_name like concat('%',#{house.districtName},'%') |
| | | </if> |
| | | <if test="house.houseName != null and house.houseName != ''"> and jh.house_name like concat('%',#{house.houseName},'%')</if> |
| | | <if test="house.phone != null and house.phone != ''"> and phone = #{house.phone}</if> |
| | | <if test="house.area != null "> and area = #{house.area}</if> |
| | | <if test="house.propertyPrice != null "> and property_price = #{house.propertyPrice}</if> |
| | | <if test="house.serviceDue != null "> and service_due = #{house.serviceDue}</if> |
| | | <if test="house.floor != null "> and floor = #{house.floor}</if> |
| | | <if test="house.building != null and house.building != ''"> and building = #{house.building}</if> |
| | | <if test="house.unit != null and house.unit != ''"> and unit = #{house.unit}</if> |
| | | <if test="house.room != null and house.room != ''"> and room = #{house.room}</if> |
| | | <if test="house.buildingNo != null "> and building_no = #{house.buildingNo}</if> |
| | | <if test="house.phone != null and house.phone != ''"> and jh.phone = #{house.phone}</if> |
| | | <if test="house.area != null "> and jh.area = #{house.area}</if> |
| | | <if test="house.propertyPrice != null "> and jh.property_price = #{house.propertyPrice}</if> |
| | | <if test="house.serviceDue != null "> and jh.service_due = #{house.serviceDue}</if> |
| | | <if test="house.floor != null "> and jh.floor = #{house.floor}</if> |
| | | <if test="house.building != null and house.building != ''"> and jh.building = #{house.building}</if> |
| | | <if test="house.unit != null and house.unit != ''"> and jh.unit = #{house.unit}</if> |
| | | <if test="house.room != null and house.room != ''"> and jh.room = #{house.room}</if> |
| | | <if test="house.buildingNo != null "> and jh.building_no = #{house.buildingNo}</if> |
| | | </select> |
| | | |
| | | <!--房屋自定义详情查询--> |
| | |
| | | select |
| | | jh.*, |
| | | jhs.district_name aoiName, |
| | | concat(jhs.building," ",unit," ",room) as address |
| | | concat(jhs.building," ",unit," ",room) as address, |
| | | jda.town_street_name as townStreetName,jda.nei_name as neiName |
| | | from |
| | | jczz_household jh join jczz_house jhs on jh.house_code = jhs.house_code and jhs.is_deleted = 0 |
| | | jczz_household jh |
| | | join jczz_house jhs on jh.house_code = jhs.house_code and jhs.is_deleted = 0 |
| | | left join jczz_doorplate_address jda on jda.address_code = jh.house_code |
| | | where jh.is_deleted = 0 |
| | | <if test="household.name!=null and household.name !=''"> |
| | | and jh.name like concat('%',#{household.name},'%') |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.vo.GridVO; |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.entity.HouseholdEntity; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | |
| | | |
| | | @Override |
| | | public IPage<HouseVO> selectHousePage(IPage<HouseVO> page, HouseVO house) { |
| | | return page.setRecords(baseMapper.selectHousePage(page, house)); |
| | | List<HouseVO> houseVOS = baseMapper.selectHousePage(page, house); |
| | | // 遍历查询网格 |
| | | for (HouseVO houseVO : houseVOS) { |
| | | // 设置对应的网格名称 |
| | | GridVO gridVO = gridService.getGridDetailByHouseCode(houseVO.getHouseCode()); |
| | | if (null!= gridVO){ |
| | | houseVO.setGridName(gridVO.getGridName()); |
| | | } |
| | | } |
| | | return page.setRecords(houseVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.vo.GridVO; |
| | | import org.springblade.modules.house.entity.HouseholdEntity; |
| | | import org.springblade.modules.house.excel.HouseHoldExcel; |
| | | import org.springblade.modules.house.mapper.HouseholdMapper; |
| | |
| | | public class HouseholdServiceImpl extends ServiceImpl<HouseholdMapper, HouseholdEntity> implements IHouseholdService { |
| | | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Autowired |
| | | private IDictBizService dictBizService; |
| | | |
| | | @Override |
| | | public IPage<HouseholdVO> selectHouseholdPage(IPage<HouseholdVO> page, HouseholdVO household) { |
| | | return page.setRecords(baseMapper.selectHouseholdPage(page, household)); |
| | | List<HouseholdVO> householdVOS = baseMapper.selectHouseholdPage(page, household); |
| | | // 遍历 |
| | | for (HouseholdVO householdVO : householdVOS) { |
| | | // 设置对应的网格名称 |
| | | GridVO gridVO = gridService.getGridDetailByHouseCode(householdVO.getHouseCode()); |
| | | if (null!= gridVO){ |
| | | householdVO.setGridName(gridVO.getGridName()); |
| | | } |
| | | } |
| | | // 返回 |
| | | return page.setRecords(householdVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 街道编号 |
| | | */ |
| | | private String streetCode; |
| | | /** |
| | | * 街道名称 |
| | | */ |
| | | private String townStreetName; |
| | | /** |
| | | * 社区名称 |
| | | */ |
| | | private String neiName; |
| | | |
| | | /** |
| | | * 网格名称 |
| | | */ |
| | | private String gridName; |
| | | |
| | | private List<UserHouseLabelVO> userHouseLabelVOList = new ArrayList<>(); |
| | | } |
| | |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 街道名称 |
| | | */ |
| | | private String townStreetName; |
| | | /** |
| | | * 社区名称 |
| | | */ |
| | | private String neiName; |
| | | |
| | | /** |
| | | * 网格名称 |
| | | */ |
| | | private String gridName; |
| | | |
| | | /** |
| | | * 标签 |
| | |
| | | jp.*, |
| | | bu.real_name as username,bu.phone as phone, |
| | | bx.real_name as createUserName, |
| | | jda.town_street_name as townStreetName,jda.nei_name as neiName, |
| | | jpe.confirm_flag confirmFlag |
| | | from jczz_place jp |
| | | left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0 |
| | | left join blade_user bx on bx.id = jp.create_user and bx.is_deleted = 0 |
| | | left join jczz_doorplate_address jda on jda.address_code = jp.house_code |
| | | LEFT JOIN jczz_place_ext jpe on jpe.place_id=jp.id |
| | | left join ( |
| | | select a.* from jczz_place_poi_label a inner join |
| | |
| | | import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; |
| | | import org.springblade.modules.doorplateAddress.service.IDoorplateAddressService; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.vo.GridVO; |
| | | import org.springblade.modules.place.entity.*; |
| | | import org.springblade.modules.place.excel.PlaceAndRelExcel; |
| | | import org.springblade.modules.place.excel.PlaceExcel; |
| | |
| | | place.setCreateUser(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | return page.setRecords(baseMapper.selectPlacePage(page, place,list)); |
| | | List<PlaceVO> placeVOS = baseMapper.selectPlacePage(page, place, list); |
| | | // 遍历 |
| | | for (PlaceVO placeVO : placeVOS) { |
| | | // 设置对应的网格名称 |
| | | GridVO gridVO = gridService.getGridDetailByHouseCode(placeVO.getHouseCode()); |
| | | if (null!= gridVO){ |
| | | placeVO.setGridName(gridVO.getGridName()); |
| | | } |
| | | } |
| | | // 返回 |
| | | return page.setRecords(placeVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private List<PlacePoiLabelVO> placePoiLabelVOList = new ArrayList<>(); |
| | | |
| | | /** |
| | | * 街道名称 |
| | | */ |
| | | private String townStreetName; |
| | | /** |
| | | * 社区名称 |
| | | */ |
| | | private String neiName; |
| | | |
| | | /** |
| | | * 网格名称 |
| | | */ |
| | | private String gridName; |
| | | |
| | | |
| | | } |