区域查询修改,场所,房屋,住户,租赁,网格信息区域过滤,机构新增区域字段
| | |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectCommunityPage" resultType="org.springblade.modules.community.vo.CommunityVO"> |
| | | select * from jczz_community |
| | | where is_deleted = 0 |
| | | select |
| | | jc.* |
| | | from jczz_community jc |
| | | left join blade_region br on br.code = jc.code |
| | | where jc.is_deleted = 0 |
| | | <if test="community.name !=null and community.name!=''"> |
| | | and name like concat('%',#{community.name},'%') |
| | | and jc.name like concat('%',#{community.name},'%') |
| | | </if> |
| | | <if test="community.code !=null and community.code!=''"> |
| | | and code like concat('%',#{community.code},'%') |
| | | and jc.code like concat('%',#{community.code},'%') |
| | | </if> |
| | | <if test="community.streetCode !=null and community.streetCode!=''"> |
| | | and street_code like concat('%',#{community.streetCode},'%') |
| | | and jc.street_code like concat('%',#{community.streetCode},'%') |
| | | </if> |
| | | <if test="community.regionCode !=null and community.regionCode !=''"> |
| | | and jc.code like concat('%',#{community.regionCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | package org.springblade.modules.community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.vo.CommunityVO; |
| | | import org.springblade.modules.community.mapper.CommunityMapper; |
| | | import org.springblade.modules.community.service.ICommunityService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | |
| | | @Service |
| | | public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, CommunityEntity> implements ICommunityService { |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Override |
| | | public IPage<CommunityVO> selectCommunityPage(IPage<CommunityVO> page, CommunityVO community) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | community.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | return page.setRecords(baseMapper.selectCommunityPage(page, community)); |
| | | } |
| | | |
| | |
| | | public class CommunityVO extends CommunityEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String regionCode; |
| | | |
| | | } |
| | |
| | | <if test="district.townStreetName !=null and district.townStreetName !=''"> |
| | | and br.town_name like concat('%',#{district.townStreetName},'%') |
| | | </if> |
| | | <if test="district.regionCode !=null and district.regionCode !=''"> |
| | | and jd.community_code like concat('%',#{district.regionCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--小区树查询--> |
| | |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.vo.GridVO; |
| | | import org.springblade.modules.property.service.IPropertyDistrictUserService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Override |
| | | public IPage<DistrictVO> selectDistrictPage(IPage<DistrictVO> page, DistrictVO district) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | district.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | List<DistrictVO> districtVOS = baseMapper.selectDistrictPage(page, district); |
| | | // 遍历 |
| | | for (DistrictVO districtVO : districtVOS) { |
| | |
| | | |
| | | private List<String> districtIdList; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String regionCode; |
| | | |
| | | } |
| | |
| | | <if test="grid.principalPhone!=null and grid.principalPhone!=''"> |
| | | and principal_phone like concat('%',#{grid.principalPhone},'%') |
| | | </if> |
| | | <if test="grid.regionCode != null and grid.regionCode !='' "> |
| | | and community_code like concat('%',#{grid.regionCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据地址编号查询网格数据--> |
| | |
| | | <!--自定义分页查询--> |
| | | <select id="selectGridmanPage" resultType="org.springblade.modules.grid.vo.GridmanVO"> |
| | | select |
| | | jgm.*,jg.community_code communityCode |
| | | jgm.*, |
| | | jg.grid_name gridName,jg.community_code communityCode, |
| | | br.name as communityName, |
| | | br.town_name as townName |
| | | from jczz_gridman jgm |
| | | left join jczz_grid jg on jg.id = jgm.grid_id and jg.is_deleted = 0 |
| | | left join blade_region br on br.code = jg.community_code |
| | | where jgm.is_deleted = 0 |
| | | <if test="gridman.gridmanName!=null and gridman.gridmanName!=''"> |
| | | and jgm.gridman_name like concat('%',#{gridman.gridmanName},'%') |
| | |
| | | <if test="gridman.communityCode!=null and gridman.communityCode!=''"> |
| | | and jg.community_code like concat('%',#{gridman.communityCode},'%') |
| | | </if> |
| | | <if test="gridman.communityName!=null and gridman.communityName!=''"> |
| | | and br.name like concat('%',#{gridman.communityName},'%') |
| | | </if> |
| | | <if test="gridman.townName!=null and gridman.townName!=''"> |
| | | and br.town_name like concat('%',#{gridman.townName},'%') |
| | | </if> |
| | | <if test="gridman.regionCode != null and gridman.regionCode !='' "> |
| | | and jg.community_code like concat('%',#{gridman.regionCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--自定义分页查询--> |
| | |
| | | |
| | | @Override |
| | | public IPage<GridVO> selectGridPage(IPage<GridVO> page, GridVO grid) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | grid.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | return page.setRecords(baseMapper.selectGridPage(page, grid)); |
| | | } |
| | | |
| | |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | | import org.springblade.modules.grid.vo.GridmanVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Override |
| | | public IPage<GridmanVO> selectGridmanPage(IPage<GridmanVO> page, GridmanVO gridman) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | gridman.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | return page.setRecords(baseMapper.selectGridmanPage(page, gridman)); |
| | | } |
| | | |
| | |
| | | */ |
| | | private String townStreetName; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String regionCode; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | @ApiModelProperty(value = "社区编号") |
| | | private String communityCode; |
| | | |
| | | /** |
| | | * 社区名称 |
| | | */ |
| | | private String communityName; |
| | | |
| | | /** |
| | | * 街道名称 |
| | | */ |
| | | private String townName; |
| | | |
| | | /** |
| | | * 网格名称 |
| | | */ |
| | | private String gridName; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String regionCode; |
| | | } |
| | |
| | | <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> |
| | | <if test="house.regionCode != null and house.regionCode !='' "> |
| | | and jda.nei_code like concat('%',#{house.regionCode},'%') |
| | | and jg.community_code like concat('%',#{house.regionCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | FROM jczz_house_rental jhr |
| | | JOIN jczz_doorplate_address jda ON jda.address_code = jhr.house_code |
| | | JOIN jczz_house jh ON jh.house_code = jhr.house_code |
| | | LEFT JOIN jczz_grid_range jgr on jgr.house_code=jda.address_code |
| | | LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0 |
| | | LEFT JOIN ( |
| | | SELECT jht.housing_rental_id,jht.name as tenantName,jht.phone_number as phone |
| | | FROM jczz_household jht RIGHT JOIN ( |
| | |
| | | <if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != '' "> |
| | | AND jhr.create_time BETWEEN #{vo.startTime} and #{vo.endTime} |
| | | </if> |
| | | <if test="vo.regionCode!=null and vo.regionCode!=''"> |
| | | and jg.community_code like concat('%',#{vo.regionCode},'%') |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | </select> |
| | | |
| | |
| | | <if test="household.startTime != null and household.startTime != '' and household.endTime != null and household.endTime != '' "> |
| | | AND jh.create_time BETWEEN #{household.startTime} and #{household.endTime} |
| | | </if> |
| | | <if test="household.regionCode!=null and household.regionCode!=''"> |
| | | and jg.community_code like concat('%',#{household.regionCode},'%') |
| | | </if> |
| | | order by jh.create_time desc |
| | | </select> |
| | | |
| | |
| | | import org.springblade.modules.house.vo.HouseRentalTenantVO; |
| | | import org.springblade.modules.house.vo.HouseRentalVO; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * @param page |
| | |
| | | */ |
| | | @Override |
| | | public IPage<HouseRentalTenantVO> selectHouseRentalPage(IPage<HouseRentalTenantVO> page, HouseRentalTenantVO houseRental) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | houseRental.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | List<String> list = new ArrayList<>(); |
| | | if (null!=houseRental.getRoleName() && !houseRental.getRoleName().equals("")){ |
| | | if (houseRental.getRoleName().equals("网格员")){ |
| | |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Autowired |
| | | private IGridRangeService gridRangeService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Override |
| | | public IPage<HouseVO> selectHousePage(IPage<HouseVO> page, HouseVO house) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | house.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | List<HouseVO> houseVOS = baseMapper.selectHousePage(page, house); |
| | | // 遍历查询网格 |
| | | for (HouseVO houseVO : houseVOS) { |
| | |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.modules.house.vo.HouseholdOtherVO; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Override |
| | | public IPage<HouseholdVO> selectHouseholdPage(IPage<HouseholdVO> page, HouseholdVO household) { |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start(); |
| | | // doInsert(); |
| | | // 执行业务等 |
| | | |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | household.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | List<HouseholdVO> householdVOS = baseMapper.selectHouseholdPage(page, household); |
| | | // 遍历 |
| | | // for (HouseholdVO householdVO : householdVOS) { |
| | |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String regionCode; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private String startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private String endTime; |
| | | |
| | | |
| | | } |
| | |
| | | private String gridName; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String regionCode; |
| | | |
| | | /** |
| | | * 标签 |
| | | */ |
| | | private List<HouseholdLabelVO> householdLabelList = new ArrayList<>(); |
| | |
| | | and bu.real_name != "" |
| | | and bu.phone != "" |
| | | </if> |
| | | <if test="place.regionCode != null and place.regionCode !='' "> |
| | | and jg.community_code like concat('%',#{place.regionCode},'%') |
| | | </if> |
| | | order by jpe.create_time desc |
| | | </select> |
| | | |
| | |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.place.mapper.PlaceMapper; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private IGridmanService gridmanService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | /** |
| | | * 自定义列表查询 |
| | | * @param page |
| | |
| | | */ |
| | | @Override |
| | | public IPage<PlaceVO> selectPlacePage(IPage<PlaceVO> page, PlaceVO place) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | place.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | List<String> list = new ArrayList<>(); |
| | | if (null!=place.getRoleName() && !place.getRoleName().equals("")){ |
| | | if (place.getRoleName().equals("网格员")){ |
| | |
| | | */ |
| | | private String gridName; |
| | | |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String regionCode; |
| | | } |
| | |
| | | return R.data(regionService.getTree(parentCode)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 树列表(获取当前树) |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @GetMapping("/getTownTree") |
| | | @ApiOperation(value = "树列表", notes = "传入menu") |
| | | public R getTownTree(String code) { |
| | | return R.data(regionService.getTownTree(code)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 行政区划表 |
| | | */ |
| | |
| | | private Integer deptCategory; |
| | | |
| | | /** |
| | | * 管辖区域编号 |
| | | */ |
| | | @ApiModelProperty(value = "管辖区域编号") |
| | | private String regionCode; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | @ApiModelProperty(value = "排序") |
| | |
| | | /** |
| | | * 树列表 |
| | | * @param parentCode |
| | | * @param regionCode |
| | | * @return |
| | | */ |
| | | @MapKey(value = "id") |
| | | Map<String, TreeStringNode> getTreeList(@Param("parentCode") String parentCode); |
| | | Map<String, TreeStringNode> getTreeList(@Param("parentCode") String parentCode, |
| | | @Param("regionCode") String regionCode); |
| | | |
| | | /** |
| | | * 树列表(获取当前树) |
| | | * @param regionCode |
| | | * @return |
| | | */ |
| | | @MapKey(value = "id") |
| | | Map<String, TreeStringNode> getTownTree(@Param("regionCode") String regionCode); |
| | | } |
| | |
| | | <if test="parentCode!=null"> |
| | | and parent_code = #{parentCode} |
| | | </if> |
| | | <if test="regionCode!=null and regionCode!=''"> |
| | | and parent_code = #{regionCode} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据当前编号查询--> |
| | | <select id="getTownTree" resultType="org.springblade.common.node.TreeStringNode"> |
| | | SELECT |
| | | code as id, |
| | | parent_code as parentId, |
| | | name |
| | | FROM blade_region where district_code = '361102' |
| | | and region_level = 4 |
| | | <if test="regionCode!=null and regionCode!=''"> |
| | | and code = #{regionCode} |
| | | </if> |
| | | union |
| | | SELECT |
| | | code as id, |
| | | parent_code as parentId, |
| | | name |
| | | FROM blade_region where district_code = '361102' |
| | | and region_level = 4 |
| | | <if test="regionCode!=null and regionCode!=''"> |
| | | and parent_code = #{regionCode} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<TreeStringNode> getTree(String parentCode); |
| | | |
| | | /** |
| | | * 树列表(获取当前树) |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<TreeStringNode> getTownTree(String code); |
| | | } |
| | |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | 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.StringPool; |
| | | import org.springblade.modules.district.vo.DistrictVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.excel.RegionExcel; |
| | | import org.springblade.modules.system.mapper.RegionMapper; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.system.vo.RegionVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | */ |
| | | @Service |
| | | public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements IRegionService { |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Override |
| | | public boolean submit(Region region) { |
| | |
| | | */ |
| | | @Override |
| | | public List<TreeStringNode> getTree(String parentCode) { |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.getTreeList(parentCode)); |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | String regionCode = null; |
| | | if (null!=dept){ |
| | | regionCode = dept.getRegionCode(); |
| | | } |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.getTreeList(parentCode,regionCode)); |
| | | } |
| | | |
| | | /** |
| | | * 树列表(获取当前树) |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TreeStringNode> getTownTree(String code) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | String regionCode = null; |
| | | if (null!=dept){ |
| | | regionCode = dept.getRegionCode(); |
| | | } |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.getTownTree(regionCode)); |
| | | } |
| | | } |