zhongrj
2023-12-20 38bd9b02ce6d784718d170a0d8d7a64629b0475e
小区,房屋,人员,场所查询新增街道,社区,网格信息返回
16 files modified
210 ■■■■ changed files
src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml 14 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/district/service/impl/DistrictServiceImpl.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/district/vo/DistrictVO.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridMapper.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridMapper.xml 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/IGridService.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/impl/GridServiceImpl.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml 38 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml 7 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/service/impl/HouseServiceImpl.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/vo/HouseVO.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/vo/HouseholdVO.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/vo/PlaceVO.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml
@@ -5,7 +5,7 @@
    <!-- 通用查询映射结果 -->
    <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"/>
@@ -21,13 +21,17 @@
    <!--自定义分页-->
    <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>
src/main/java/org/springblade/modules/district/service/impl/DistrictServiceImpl.java
@@ -25,6 +25,9 @@
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;
@@ -39,9 +42,28 @@
@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);
    }
    /**
src/main/java/org/springblade/modules/district/vo/DistrictVO.java
@@ -42,4 +42,14 @@
     */
    private String communityName;
    /**
     * 街道名称
     */
    private String townStreetName;
    /**
     * 网格名称
     */
    private String gridName;
}
src/main/java/org/springblade/modules/grid/mapper/GridMapper.java
@@ -103,4 +103,11 @@
     * @return
     */
    List<GridEntity> getGridList(@Param("grid") GridVO grid);
    /**
     * 查询小区网格绑定
     * @param aoiCode 小区aoiCode
     * @return
     */
    List<GridVO> getGridListByAoiCode(@Param("aoiCode") String aoiCode);
}
src/main/java/org/springblade/modules/grid/mapper/GridMapper.xml
@@ -140,4 +140,13 @@
        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>
src/main/java/org/springblade/modules/grid/service/IGridService.java
@@ -109,4 +109,11 @@
     * @return
     */
    Object getGridList(GridVO grid);
    /**
     * 查询小区网格绑定
     * @param aoiCode 小区aoiCode
     * @return
     */
    List<GridVO> getGridListByAoiCode(String aoiCode);
}
src/main/java/org/springblade/modules/grid/service/impl/GridServiceImpl.java
@@ -294,4 +294,14 @@
    public Object getGridList(GridVO grid) {
        return baseMapper.getGridList(grid);
    }
    /**
     * 查询小区网格绑定
     * @param aoiCode 小区aoiCode
     * @return
     */
    @Override
    public List<GridVO> getGridListByAoiCode(String aoiCode) {
        return baseMapper.getGridListByAoiCode(aoiCode);
    }
}
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml
@@ -131,28 +131,32 @@
    <!--自定义分页列表-->
    <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>
    <!--房屋自定义详情查询-->
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -117,9 +117,12 @@
        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},'%')
src/main/java/org/springblade/modules/house/service/impl/HouseServiceImpl.java
@@ -28,6 +28,7 @@
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;
@@ -67,7 +68,16 @@
    @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);
    }
    /**
src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java
@@ -23,6 +23,8 @@
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;
@@ -47,11 +49,24 @@
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);
    }
    /**
src/main/java/org/springblade/modules/house/vo/HouseVO.java
@@ -43,6 +43,19 @@
     * 街道编号
     */
    private String streetCode;
    /**
     * 街道名称
     */
    private String townStreetName;
    /**
     * 社区名称
     */
    private String neiName;
    /**
     * 网格名称
     */
    private String gridName;
    private List<UserHouseLabelVO> userHouseLabelVOList = new ArrayList<>();
}
src/main/java/org/springblade/modules/house/vo/HouseholdVO.java
@@ -49,6 +49,19 @@
     * 地址
     */
    private String address;
    /**
     * 街道名称
     */
    private String townStreetName;
    /**
     * 社区名称
     */
    private String neiName;
    /**
     * 网格名称
     */
    private String gridName;
    /**
     * 标签
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -17,10 +17,12 @@
        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
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
@@ -27,6 +27,7 @@
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;
@@ -90,7 +91,17 @@
                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);
    }
    /**
src/main/java/org/springblade/modules/place/vo/PlaceVO.java
@@ -84,5 +84,19 @@
     */
    private List<PlacePoiLabelVO> placePoiLabelVOList = new ArrayList<>();
    /**
     * 街道名称
     */
    private String townStreetName;
    /**
     * 社区名称
     */
    private String neiName;
    /**
     * 网格名称
     */
    private String gridName;
}