| | |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestParam("province") String province, @RequestParam("city") String city, @RequestParam("county")String country,@RequestParam("town")String town) { |
| | | return this.bcRegionService.pageList(province,city,country,town); |
| | | return this.bcRegionService.pageList(province, city, country, town); |
| | | } |
| | | /** |
| | | * 关键字查询 |
| | | * |
| | | * @param province 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("selectCommunityCodeByName") |
| | | public R selectCommunityCodeByName( @RequestParam("city") String city, @RequestParam("county")String country,@RequestParam("town")String town,@RequestParam("villagetr") String villagetr) { |
| | | return this.bcRegionService.selectCommunityCodeByName(city,country,town,villagetr); |
| | | } |
| | | @GetMapping("levelList") |
| | | public R levelList(@RequestParam("level")Integer level,@RequestParam("code")String code){ |
| | |
| | | */ |
| | | String selectByName(@Param("province") String province,@Param("city") String city,@Param("county")String country,@Param("town")String town); |
| | | |
| | | /** |
| | | * 通过名称查询社区编码 |
| | | * @param city |
| | | * @param country |
| | | * @param town |
| | | * @param villagetr |
| | | * @return |
| | | */ |
| | | String selectCommunityCodeByName(@Param("city") String city,@Param("county")String country,@Param("town")String town,@Param("villagetr") String villagetr); |
| | | |
| | | List<ProvinceCityReturnVO> selectFirst(); |
| | | |
| | | List<ProvinceCityReturnVO> selectSecond(String name); |
| | |
| | | */ |
| | | R pageList(String province, String city, String country,String town); |
| | | |
| | | R selectCommunityCodeByName( String city, String country,String town,String villagetr); |
| | | |
| | | /** |
| | | * 四级联动列表 |
| | | * @return |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R selectCommunityCodeByName( String city, String country,String town,String villagetr) { |
| | | return R.ok(this.baseMapper.selectCommunityCodeByName(city,country,town,villagetr)); |
| | | } |
| | | |
| | | @Override |
| | | public R levelList(Integer level,String code) { |
| | | if(level==1){ |
| | | List<ProvinceCityReturnVO> firstLevel=this.baseMapper.selectFirst(); |
| | |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="selectCommunityCodeByName" resultType="string"> |
| | | SELECT distinct code FROM area_index_2022 where 1=1 |
| | | <if test="city !=null and city!=''"> |
| | | and city =#{city} |
| | | </if> |
| | | <if test="county !=null and county!=''"> |
| | | and county like concat(#{county},'%') |
| | | </if> |
| | | <if test="town !=null and town!=''"> |
| | | and town = #{town} |
| | | </if> |
| | | <if test="villagetr !=null and villagetr!=''"> |
| | | and villagetr like concat(#{villagetr},'%') |
| | | </if> |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="selectFirst" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO"> |
| | | select distinct name,code from area_code_2022 where level=1 |
| | | </select> |