whyczh
2021-12-13 27ea8110fba9bd11a599ba6ea7e1151a62334173
地理天气接口更新
3个文件已修改
17 ■■■■ 已修改文件
src/main/java/com/whyc/pojo/WeatherCity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WeatherService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WeatherCityMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/WeatherCity.java
@@ -11,4 +11,5 @@
    private String province;
    private String city;
    private String district;
    private String districtCode;
}
src/main/java/com/whyc/service/WeatherService.java
@@ -203,10 +203,10 @@
            if (weatherCity1==null){
                return 0;
            }else {
                return weatherCity1.getId();
                return Integer.valueOf(weatherCity1.getDistrictCode());
            }
        }else{
            return weatherCity.getId();
            return Integer.valueOf(weatherCity.getDistrictCode());
        }
    }
src/main/resources/mapper/WeatherCityMapper.xml
@@ -7,13 +7,13 @@
        select district_code from web_site.tb_weather_city2
        <where>
            <if test="city.province !=null and city.province !='' and city.province!='null'">
                and province like CONCAT('%',#{city.province},'%'
                and province like CONCAT('%',#{city.province},'%')
            </if>
            <if test="city.city !=null and city.city !='' and city.city!='null'">
                and city like CONCAT('%',#{city.city},'%'
                and city like CONCAT('%',#{city.city},'%')
            </if>
            <if test="city.district !=null and city.district !='' and city.district!='null'">
                and district like CONCAT('%',#{city.district},'%'
                and district like CONCAT('%',#{city.district},'%')
            </if>
        </where>
        limit 1
@@ -23,13 +23,13 @@
        select district_code from web_site.tb_weather_city
        <where>
            <if test="city.province !=null and city.province !='' and city.province!='null'">
                and province like CONCAT('%',#{city.province},'%'
                and province like CONCAT('%',#{city.province},'%')
            </if>
            <if test="city.city !=null and city.city !='' and city.city!='null'">
                and city like CONCAT('%',#{city.city},'%'
                and city like CONCAT('%',#{city.city},'%')
            </if>
            <if test="city.district !=null and city.district !='' and city.district!='null'">
                and district like CONCAT('%',#{city.district},'%'
                and district like CONCAT('%',#{city.district},'%')
            </if>
        </where>
        limit 1