| | |
| | | @ApiOperation(value = "查询所有社区", response = StreetAllAppletsVO.class) |
| | | @GetMapping("/list/noToken") |
| | | public R list() { |
| | | return communityService.communitySwitchList(this.getAreaCode()); |
| | | return communityService.communitySwitchList(this.getAppId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据名字搜索社区", response = CommunitySwitchAllAppletsVO.class) |
| | | @GetMapping("/search/noToken") |
| | | public R search(@RequestParam(value = "name") String name) { |
| | | return communityService.communitySwitchSearchList(name,this.getAreaCode()); |
| | | return communityService.communitySwitchSearchList(name,this.getAppId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据距离搜索社区", response = CommunitySwitchAllAppletsVO.class) |
| | |
| | | private Integer distance; |
| | | |
| | | private String areaCode; |
| | | |
| | | private String appId; |
| | | } |
| | |
| | | * @return 社区列表 |
| | | */ |
| | | @GetMapping("/switch/community/all/list") |
| | | R communitySwitchList(@RequestParam("areaCode") String areaCode); |
| | | R communitySwitchList(@RequestParam("appId") String appId); |
| | | |
| | | /** |
| | | * 根据名字查询所有社区列表 |
| | |
| | | * @return 社区列表 |
| | | */ |
| | | @GetMapping("/switch/community/search/list") |
| | | R communitySwitchSearchList(@RequestParam(value = "name") String name,@RequestParam(value = "areaCode") String areaCode); |
| | | R communitySwitchSearchList(@RequestParam(value = "name") String name,@RequestParam(value = "appId") String appId); |
| | | |
| | | /** |
| | | * 根据经纬度以及距离搜索附近社区列表 |
| | |
| | | * @return 社区列表 |
| | | */ |
| | | @GetMapping("/community/all/list") |
| | | public R getCommunityAllList(@RequestParam("areaCode") String areaCode) { |
| | | return comActService.getCommunityAllList(areaCode); |
| | | public R getCommunityAllList(@RequestParam("appId") String appId) { |
| | | return comActService.getCommunityAllList(appId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 社区列表 |
| | | */ |
| | | @GetMapping("/community/search/list") |
| | | public R communitySwitchSearchList(@RequestParam(value = "name") String name,@RequestParam(value = "areaCode") String areaCode) { |
| | | return comActService.communitySwitchSearchList(name,areaCode); |
| | | public R communitySwitchSearchList(@RequestParam(value = "name") String name,@RequestParam(value = "appId") String appId) { |
| | | return comActService.communitySwitchSearchList(name,appId); |
| | | } |
| | | |
| | | /** |
| | |
| | | + "left join com_street as cs on cs.street_id = ca.street_id\n" + "where ca.community_id = ${communityId}") |
| | | ComPopulationActVO getPopulationActById(@Param("communityId") Long communityId); |
| | | |
| | | @Select("select `name`,street_id from com_street where area_code = #{areaCode}") |
| | | List<StreetAllAppletsVO> getStreetList(String areaCode); |
| | | @Select("select `name`,street_id from com_street where app_id = #{appId}") |
| | | List<StreetAllAppletsVO> getStreetList(String appId); |
| | | |
| | | @Select("select ca.`name`,ca.street_id,ca.community_id,cs.`name` as streetName from com_act as ca left join com_street as cs on cs.street_id = ca.street_id where ca.state = 0 and ca.street_id = #{streetId}") |
| | | List<CommunitySwitchAllAppletsVO> getCommunityListByStreetId(@Param("streetId") Long streetId); |
| | |
| | | @Select("<script> select ca.`name`,ca.street_id,ca.community_id,cs.`name` as streetName " + |
| | | "from com_act as ca " + |
| | | "left join com_street as cs on cs.street_id = ca.street_id " + |
| | | "where ca.state = 0 and ca.name like concat('%',#{name},'%') <if test='areaCode !=null and areaCode !=""'> and cs.area_code = #{areaCode} </if> </script> ") |
| | | List<CommunitySwitchAllAppletsVO> getCommunityListByName(@Param("name") String name,@Param("areaCode") String areaCode); |
| | | "where ca.state = 0 and ca.name like concat('%',#{name},'%') <if test='appId !=null and appId !=""'> and cs.app_id = #{appId} </if> </script> ") |
| | | List<CommunitySwitchAllAppletsVO> getCommunityListByName(@Param("name") String name,@Param("appId") String appId); |
| | | |
| | | @Select("SELECT c.community_id, c.`name`, c.street_id, cs.`name` as streetName," + |
| | | "round( ST_Distance_Sphere ( Point ( #{communityDTO.longitude}, #{communityDTO.latitude} ), Point ( c.lng, c.lat ) )/ 1000, 2 ) AS distance " + |
| | |
| | | * |
| | | * @return 社区列表 |
| | | */ |
| | | R getCommunityAllList(String areaCode); |
| | | R getCommunityAllList(String appId); |
| | | |
| | | /** |
| | | * 根据名字查询所有社区列表 |
| | |
| | | * @return 社区列表 |
| | | */ |
| | | @Override |
| | | public R getCommunityAllList(String areaCode) { |
| | | public R getCommunityAllList(String appId) { |
| | | // 查询街道列表 |
| | | List<StreetAllAppletsVO> streetList = this.comActDAO.getStreetList(areaCode); |
| | | List<StreetAllAppletsVO> streetList = this.comActDAO.getStreetList(appId); |
| | | streetList.forEach(street -> { |
| | | // 查询街道下社区列表 |
| | | List<CommunitySwitchAllAppletsVO> communityList = |
| | |
| | | * @return 社区列表 |
| | | */ |
| | | @Override |
| | | public R communitySwitchSearchList(String name,String areaCode) { |
| | | return R.ok(this.comActDAO.getCommunityListByName(name,areaCode)); |
| | | public R communitySwitchSearchList(String name,String appId) { |
| | | return R.ok(this.comActDAO.getCommunityListByName(name,appId)); |
| | | } |
| | | |
| | | /** |