XzqMapper.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.onemap.apply.mapper.yzt.XzqMapper">
  6. <select id="GetXzq" resultType="com.onemap.apply.domain.yzt.XzqSqlDTO">
  7. select t.id as "value",
  8. t.name as "label",
  9. t.pid as "parent",
  10. case when (select count(*) from xzqh p where p.pid = t.id) > 0 then '1'
  11. else '0' end as "isparent"
  12. from xzqh t where 1 = 1
  13. <if test="city == null or city == false">
  14. and t.pid is not null
  15. </if>
  16. <if test="xzqCode != null and xzqCode != ''">
  17. and t.id like #{xzqCode}||'%'
  18. </if>
  19. </select>
  20. <select id="GetXzqList" parameterType="java.lang.Boolean" resultType="com.onemap.apply.domain.yzt.XzqSqlDTO">
  21. select t.id as "value",
  22. t.name as "label",
  23. t.pid as "parent",
  24. case when (select count(1) from xzqh p where p.pid = t.id) > 0 then '1'
  25. else '0' end as "isparent"
  26. from xzqh t where 1 = 1
  27. order by t.pid
  28. <!-- <if test="city == null or city == false">-->
  29. <!-- and t.pid is not null and length(t.id) &lt;= (select case (select length(t.id) from xzqh t where-->
  30. <!-- t.pid is null)-->
  31. <!-- when 2 then 4-->
  32. <!-- when 4 then 6-->
  33. <!-- when 6 then 9-->
  34. <!-- when 9 then 12-->
  35. <!-- end)-->
  36. <!-- </if>-->
  37. <!-- <if test="city != null or city == true">-->
  38. <!-- and length(t.id) &lt;= (select case (select length(t.id) from xzqh t where t.pid-->
  39. <!-- is null)-->
  40. <!-- when 2 then 4-->
  41. <!-- when 4 then 6-->
  42. <!-- when 6 then 9-->
  43. <!-- when 9 then 12-->
  44. <!-- end )-->
  45. <!-- </if>-->
  46. </select>
  47. <select id="GetGeom" resultType="java.lang.String" parameterType="java.lang.String">
  48. select public.st_asewkt(t.geom) from xzqh t where t.id = #{id}
  49. </select>
  50. </mapper>