@Select("SELECT p.`name` provinceName , p.`province_code` provinceCode , c.`name` cityName, c.`city_code` cityCode, a.`name` areaName, a.area_code areaCode " + " FROM region_area a LEFT JOIN region_city c ON a.city_code = c.city_code" + " LEFT JOIN region_province p ON c.province_code = p.province_code" + " WHERE a.area_code IN(${areaCodes})") List<RegionDistrictDetail> selectDistrictDetailData(@Param("areaCodes") String areaCodes);
以上是正常代码。
areaCodes='110102','110105','110106','110107','110108','110109','110111'
此时用拼接的方式。
原本用了#{areaCodes},怎么查都查不出来,手动拼接SQL在数据库又能查出来。
记录一下。