LabelIntelligentConnectionMapper.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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="cn.ubitech.ttc.dao.LabelIntelligentConnectionMapper">
  4. <select id="getLabelListByOrgid" resultType="java.lang.String">
  5. SELECT c.labelname
  6. FROM label_intelligent_connection c
  7. left join resourcelibrary r on c.backup = r.id
  8. left join organization_info o on o.name = r.title
  9. where r.restype = 6
  10. And o.id = #{orgid}
  11. </select>
  12. <select id="getOrgListByOrgType" resultType="java.lang.String">
  13. select DISTINCT o.name
  14. from organization_info o, label_intelligent_connection conn, resourcelibrary r
  15. where conn.node = #{node}
  16. and r.comefrom = #{node}
  17. and o.name = r.title
  18. and r.id = conn.backup
  19. and o.name in
  20. <foreach collection="orgnamelist" item="id" index="index"
  21. open="(" close=")" separator=",">
  22. #{id}
  23. </foreach>
  24. and conn.labelname in
  25. <foreach collection="orgtypelist" item="id" index="index"
  26. open="(" close=")" separator=",">
  27. #{id}
  28. </foreach>
  29. </select>
  30. <select id="getOrgListByOrgTypeLow" resultType="java.lang.String">
  31. select DISTINCT o.name
  32. from organization_info o, label_intelligent_connection conn, resourcelibrary r
  33. where conn.node = #{node}
  34. and r.comefrom = #{node}
  35. and o.name = r.title
  36. and r.id = conn.backup
  37. and o.name in
  38. <foreach collection="orgnamelist" item="id" index="index"
  39. open="(" close=")" separator=",">
  40. #{id}
  41. </foreach>
  42. <if test='orgtypelist.size() > 0 '>
  43. and conn.labelname in
  44. <foreach collection="orgtypelist" item="id" index="index"
  45. open="(" close=")" separator=",">
  46. #{id}
  47. </foreach>
  48. </if>
  49. and r.id not in (
  50. select conn.backup
  51. from label_intelligent_connection conn
  52. where conn.labelname = "规上"
  53. and conn.node = #{node}
  54. )
  55. </select>
  56. </mapper>