AreaServiceDaoImplMapper.xml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="areaServiceDaoImpl">
  4. <!--查询地区数据-->
  5. <select id="getAreas" resultType="Map" parameterType="Map">
  6. select
  7. t.id ,
  8. t.area_code areaCode,
  9. t.area_name areaName,
  10. t.area_level areaLevel,
  11. t.parent_area_code parentAreaCode,
  12. t.parent_area_name parentAreaName,
  13. t.lon,
  14. t.lat,
  15. t.create_time createTime
  16. from city_area t
  17. where 1=1
  18. <if test="areaCode != null and areaCode !=''">
  19. and t.area_code = #{areaCode}
  20. </if>
  21. <if test="areaName != null and areaName != ''">
  22. and t.area_name like concat('%',#{areaName},'%')
  23. </if>
  24. <if test="areaLevel != null and areaLevel !=''">
  25. and t.area_level = #{areaLevel}
  26. </if>
  27. <if test="parentAreaCode != null and parentAreaCode !=''">
  28. and t.parent_area_code = #{parentAreaCode}
  29. </if>
  30. <if test="parentAreaName != null and parentAreaName !=''">
  31. and t.parent_area_name like concat('%',#{parentAreaName},'%')
  32. </if>
  33. </select>
  34. </mapper>