ConnectioninfoMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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.ConnectioninfoMapper">
  4. <!-- 开启二级缓存 -->
  5. <!--<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>-->
  6. <select id="getConnectionByOrgidAndUserid" resultType="cn.ubitech.ttc.model.datatools.dataentry.ConnectioninfoModel">
  7. SELECT c.*
  8. FROM conn_org_lk col,
  9. connectioninfo c,
  10. sys_page sp
  11. WHERE col.orgid = #{orgid}
  12. AND col.connid = c.id
  13. AND c.templettype = sp.id
  14. AND sp.funid = #{funid}
  15. AND c.creator = #{userid}
  16. AND c.title LIKE #{keyword}
  17. AND c.node IN
  18. <foreach collection="nodeList" item="id" index="index"
  19. open="(" close=")" separator=",">
  20. #{id}
  21. </foreach>
  22. order by c.createtime desc
  23. </select>
  24. <select id="getConnectionByOrgid" resultType="cn.ubitech.ttc.model.datatools.dataentry.ConnectioninfoModel">
  25. SELECT c.*
  26. FROM conn_org_lk col,
  27. connectioninfo c,
  28. sys_page sp
  29. WHERE col.orgid = #{orgid}
  30. AND col.connid = c.id
  31. AND c.templettype = sp.id
  32. AND sp.funid = #{funid}
  33. AND c.title LIKE #{keyword}
  34. AND c.templettype IN
  35. <foreach collection="funidlist" item="id" index="index"
  36. open="(" close=")" separator=",">
  37. #{id}
  38. </foreach>
  39. AND c.node IN
  40. <foreach collection="nodeList" item="id" index="index"
  41. open="(" close=")" separator=",">
  42. #{id}
  43. </foreach>
  44. order by c.createtime desc
  45. </select>
  46. <select id="getConnectionByKeyword"
  47. resultType="cn.ubitech.ttc.model.datatools.dataentry.ConnectioninfoModel">
  48. select *
  49. from connectioninfo c ,
  50. sys_page sp
  51. where c.templettype = sp.id
  52. AND sp.funid = #{funid}
  53. AND c.title LIKE #{keyword}
  54. order by c.createtime desc
  55. </select>
  56. <select id="getConnectionByOrgidCount" resultType="java.lang.Integer">
  57. select count(*) from (
  58. SELECT c.*
  59. FROM conn_org_lk col,
  60. connectioninfo c,
  61. sys_page sp
  62. WHERE col.orgid = #{orgid}
  63. AND col.connid = c.id
  64. AND c.templettype = sp.id
  65. AND sp.funid = #{funid}
  66. AND c.templettype IN
  67. <foreach collection="funidlist" item="id" index="index"
  68. open="(" close=")" separator=",">
  69. #{id}
  70. </foreach>
  71. AND c.node IN
  72. <foreach collection="nodeList" item="id" index="index"
  73. open="(" close=")" separator=",">
  74. #{id}
  75. </foreach>
  76. AND c.title LIKE #{keyword}) a
  77. </select>
  78. <select id="getCountByGroup" resultType="cn.ubitech.ttc.model.datatools.dataentry.ConnectioninfoModell">
  79. SELECT
  80. p.*, count(p.id) as countvalue
  81. FROM
  82. connectioninfo p
  83. GROUP BY
  84. p.creator;
  85. </select>
  86. <select id="getOrgCreatorByConnid" resultType="cn.ubitech.ttc.entity.OrganizationInfo">
  87. SELECT
  88. oi.*
  89. FROM organization_info oi
  90. INNER JOIN conn_org_lk col
  91. ON oi.id = col.orgid
  92. WHERE col.connid = #{connid}
  93. limit 0,1
  94. </select>
  95. <select id="getConnNameByNode" resultType="java.lang.String">
  96. SELECT
  97. DISTINCT i.title
  98. FROM connectioninfo i
  99. WHERE i.node = #{node}
  100. AND ishighorginspect = "1"
  101. <if test='keyfilter != "0"'>
  102. AND i.title like '%${keyfilter}%'
  103. </if>
  104. </select>
  105. <select id="getConnectionByConnid" resultType="cn.ubitech.ttc.entity.Connectioninfo">
  106. SELECT
  107. *
  108. FROM connectioninfo
  109. WHERE id = #{connid}
  110. AND isresourcelibrarydata = "0"
  111. </select>
  112. <select id="getConnNameByUserid" resultType="cn.ubitech.ttc.entity.Connectioninfo">
  113. SELECT *
  114. FROM connectioninfo i
  115. WHERE i.node = #{node}
  116. AND creator = #{userid}
  117. AND ishighorginspect = "1"
  118. <if test='keyfilter != "0"'>
  119. AND i.title like '%${keyfilter}%'
  120. </if>
  121. <if test='keyfilter == "0"'>
  122. AND i.title = #{title}
  123. </if>
  124. <if test='keyfilter != "0"'>
  125. AND i.title like '%${keyfilter}%'
  126. </if>
  127. <if test='sortKey != "0"'>
  128. order by ${sortKey} desc
  129. </if>
  130. </select>
  131. </mapper>