TdCityMapper.xml 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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="com.huiju.estateagents.mapper.TdCityMapper">
  4. <select id="selectCity" resultType="com.huiju.estateagents.entity.TdCity">
  5. SELECT
  6. *,
  7. LEFT(pinyin,1) AS initial
  8. FROM
  9. td_city
  10. <where>
  11. 1=1
  12. <if test="null != status and status != '' ">
  13. and status = #{status}
  14. </if>
  15. <if test="leveltype != null and leveltype != ''">
  16. and leveltype = #{leveltype}
  17. </if>
  18. </where>
  19. ORDER BY
  20. pinyin
  21. </select>
  22. <select id="selectWxCity" resultType="com.huiju.estateagents.entity.TdCity">
  23. SELECT
  24. c.id,
  25. c.name,
  26. c.parentid,
  27. c.shortname,
  28. c.leveltype,
  29. c.citycode,
  30. c.zipcode,
  31. c.lng,
  32. c.lat,
  33. c.pinyin,
  34. oc.org_id,
  35. oc.`status`,
  36. LEFT (c.pinyin, 1) AS initial
  37. FROM
  38. ta_org_city oc
  39. INNER JOIN td_city c ON oc.city_id = c.id
  40. WHERE
  41. oc.org_id = #{orgId}
  42. and oc.parentid !=100000
  43. and oc.status = 1
  44. ORDER BY
  45. c.pinyin
  46. </select>
  47. </mapper>