yanghui
2022-12-08 45ea6bea2b4f555d6cfef66fd331966d581f17b9
#feat 新增接口
5个文件已修改
46 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BcRegionApi.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BcRegionDao.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BcRegionService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/BcRegionMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BcRegionApi.java
@@ -40,7 +40,17 @@
     */
    @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){
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BcRegionDao.java
@@ -29,6 +29,16 @@
     */
    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);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BcRegionService.java
@@ -21,6 +21,8 @@
     */
    R pageList(String province, String city, String country,String town);
    R selectCommunityCodeByName( String city, String country,String town,String villagetr);
    /**
     * 四级联动列表
     * @return
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java
@@ -35,6 +35,11 @@
    }
    @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();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/BcRegionMapper.xml
@@ -35,6 +35,23 @@
        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>