OrganizationInfoMapper.xml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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.OrganizationInfoMapper">
  4. <!-- 开启二级缓存 -->
  5. <!--<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>-->
  6. <select id="getInterviewListByUserid"
  7. resultType="cn.ubitech.ttc.model.datatools.interview.InterviewListModel">
  8. SELECT
  9. a.*
  10. FROM (SELECT
  11. oi.id,
  12. oi.name,
  13. oi.orgtype,
  14. c.id as connid,
  15. c.creator as userid,
  16. c.createtime,
  17. c.pagecode,
  18. c.node,
  19. oi.district as address,
  20. c.templettype
  21. FROM connectioninfo c,
  22. conn_org_lk col,
  23. organization_info oi,
  24. sys_page sp
  25. WHERE c.id = col.connid
  26. AND col.orgid = oi.id
  27. AND c.templettype = sp.id
  28. AND c.isresourcelibrarydata = 0
  29. AND c.by1 = 0
  30. AND c.node = #{node}
  31. AND sp.funid = #{funid}
  32. AND c.creator = #{userid}
  33. AND c.templettype IN
  34. <foreach collection="funlist" item="id" index="index"
  35. open="(" close=")" separator=",">
  36. #{id}
  37. </foreach>
  38. ORDER BY c.createtime DESC) a
  39. WHERE a.name LIKE #{keyword}
  40. GROUP BY a.name order by a.createtime desc
  41. </select>
  42. <select id="getInterviewListByUid"
  43. resultType="cn.ubitech.ttc.model.datatools.interview.InterviewListModel">
  44. SELECT
  45. a.*
  46. FROM (SELECT
  47. oi.id,
  48. oi.name,
  49. oi.orgtype,
  50. c.id as connid,
  51. c.creator as userid,
  52. c.createtime,
  53. c.pagecode,
  54. c.node,
  55. oi.district as address,
  56. c.templettype
  57. FROM connectioninfo c,
  58. conn_org_lk col,
  59. organization_info oi,
  60. sys_page sp
  61. WHERE c.id = col.connid
  62. AND col.orgid = oi.id
  63. AND c.templettype = sp.id
  64. AND c.isresourcelibrarydata = 0
  65. AND c.by1 = 0
  66. AND c.node = #{node}
  67. AND sp.funid = #{funid}
  68. AND c.creator = #{userid}
  69. AND c.templettype IN
  70. <foreach collection="funlist" item="id" index="index"
  71. open="(" close=")" separator=",">
  72. #{id}
  73. </foreach>
  74. ORDER BY c.createtime DESC) a
  75. GROUP BY a.name order by a.createtime desc
  76. </select>
  77. <select id="getInterviewListByUseridCount" resultType="java.lang.Integer">
  78. SELECT COUNT(*) AS total FROM (
  79. SELECT
  80. a.*
  81. FROM (SELECT
  82. oi.id,
  83. oi.name,
  84. c.creator as userid,
  85. c.createtime,
  86. c.pagecode,
  87. c.node,
  88. oi.district as address,
  89. c.templettype
  90. FROM connectioninfo c,
  91. conn_org_lk col,
  92. organization_info oi,
  93. sys_page sp
  94. WHERE c.id = col.connid
  95. AND col.orgid = oi.id
  96. AND c.templettype = sp.id
  97. AND c.by1 = 0
  98. AND c.isresourcelibrarydata = 0
  99. AND c.node = #{node}
  100. AND sp.funid = #{funid}
  101. AND c.creator = #{userid}
  102. AND c.templettype IN
  103. <foreach collection="funlist" item="id" index="index"
  104. open="(" close=")" separator=",">
  105. #{id}
  106. </foreach>
  107. ORDER BY c.createtime DESC) a
  108. WHERE a.name LIKE #{keyword} GROUP BY a.name) b
  109. </select>
  110. <select id="getInterviewList" resultType="cn.ubitech.ttc.model.datatools.interview.InterviewListModel">
  111. SELECT
  112. a.*
  113. FROM (SELECT
  114. oi.id,
  115. oi.name,
  116. c.creator AS userid,
  117. c.createtime,
  118. oi.district AS address
  119. FROM (SELECT
  120. ci.*
  121. FROM connectioninfo ci,
  122. coninfo_classification cc,
  123. conninfoclassrelation ccr
  124. WHERE ci.id = ccr.infoId
  125. AND cc.id = ccr.claid
  126. AND cc.id = #{claid}) c,
  127. conn_org_lk col,
  128. organization_info oi
  129. WHERE c.id = col.connid
  130. AND col.orgid = oi.id
  131. ORDER BY c.createtime DESC) a
  132. WHERE a.name LIKE #{keyword}
  133. GROUP BY a.name
  134. ORDER BY a.createtime DESC
  135. </select>
  136. <select id="getInterviewListCount" resultType="java.lang.Integer">
  137. SELECT COUNT(*) AS total
  138. FROM (
  139. SELECT
  140. a.*
  141. FROM (SELECT
  142. oi.id,
  143. oi.name,
  144. c.creator AS userid,
  145. c.createtime,
  146. oi.district AS address
  147. FROM (SELECT
  148. ci.*
  149. FROM connectioninfo ci,
  150. coninfo_classification cc,
  151. conninfoclassrelation ccr
  152. WHERE ci.id = ccr.infoId
  153. AND cc.id = ccr.claid
  154. AND cc.id = #{claid}) c,
  155. conn_org_lk col,
  156. organization_info oi
  157. WHERE c.id = col.connid
  158. AND col.orgid = oi.id
  159. ORDER BY c.createtime DESC) a
  160. WHERE a.name LIKE #{keyword}
  161. GROUP BY a.name ) b
  162. </select>
  163. <select id="getInterviewListTwo" resultType="cn.ubitech.ttc.model.datatools.interview.InterviewListModel">
  164. SELECT
  165. a.*
  166. FROM (SELECT
  167. oi.id,
  168. oi.name,
  169. c.id as connid,
  170. c.creator as userid,
  171. c.createtime,
  172. c.pagecode,
  173. c.node,
  174. c.templettype,
  175. oi.district as address,
  176. oi.orgtype
  177. FROM connectioninfo c,
  178. conn_org_lk col,
  179. organization_info oi,
  180. sys_page sp
  181. WHERE c.id = col.connid
  182. AND col.orgid = oi.id
  183. AND c.by1 =0
  184. AND c.templettype = sp.id
  185. AND c.isresourcelibrarydata = 0
  186. AND sp.funid = #{funid}
  187. AND c.templettype IN
  188. <foreach collection="funlist" item="id" index="index"
  189. open="(" close=")" separator=",">
  190. #{id}
  191. </foreach>
  192. AND c.node IN
  193. <foreach collection="nodeList" item="id" index="index"
  194. open="(" close=")" separator=",">
  195. #{id}
  196. </foreach>
  197. ORDER BY c.createtime DESC) a
  198. WHERE a.name LIKE #{keyword}
  199. GROUP BY a.name order by a.createtime desc
  200. </select>
  201. <select id="getInterviewListCountTwo" resultType="java.lang.Integer">
  202. SELECT COUNT(*) AS total
  203. FROM (
  204. SELECT a.*
  205. FROM (SELECT
  206. oi.id,
  207. oi.name,
  208. c.creator as userid,
  209. c.createtime,
  210. c.pagecode,
  211. c.node,
  212. c.templettype,
  213. oi.orgtype,
  214. oi.district as address
  215. FROM connectioninfo c,
  216. conn_org_lk col,
  217. organization_info oi,
  218. sys_page sp
  219. WHERE c.id = col.connid
  220. AND col.orgid = oi.id
  221. AND c.by1 =0
  222. AND c.templettype = sp.id
  223. AND c.isresourcelibrarydata = 0
  224. AND sp.funid = #{funid}
  225. AND c.templettype IN
  226. <foreach collection="funlist" item="id" index="index"
  227. open="(" close=")" separator=",">
  228. #{id}
  229. </foreach>
  230. AND c.node IN
  231. <foreach collection="nodeList" item="id" index="index"
  232. open="(" close=")" separator=",">
  233. #{id}
  234. </foreach>
  235. ORDER BY c.createtime DESC) a
  236. WHERE a.name LIKE #{keyword}
  237. GROUP BY a.name) b
  238. </select>
  239. <select id="getViceOrgByOrgname" resultType="cn.ubitech.ttc.entity.OrganizationInfo">
  240. select * from organization_info where id in(
  241. select otherorg from union_org_lk u
  242. inner join organization_info o on u.unionorg = o.id
  243. where o.name = #{orgname}
  244. )
  245. </select>
  246. <select id="getOrgListByNode" resultType="cn.ubitech.ttc.entity.OrganizationInfo">
  247. select * from organization_info where id in (
  248. select companyid from company_node_lk where companyid in(
  249. select id from organization_info where name = #{orgname}) AND comefrom = #{node})
  250. </select>
  251. <select id="getOrgListByCodeAndNameAndNode" resultType="cn.ubitech.ttc.entity.OrganizationInfo">
  252. select * from organization_info where id in (
  253. select companyid from company_node_lk where companyid in(
  254. select id from organization_info where name = #{orgname} and orgcode = #{orgcode}) AND comefrom = #{node})
  255. </select>
  256. </mapper>