ConceptMapper.xml 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  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.diagbot.mapper.ConceptMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.diagbot.entity.Concept">
  6. <id column="id" property="id" />
  7. <result column="is_deleted" property="isDeleted" />
  8. <result column="gmt_create" property="gmtCreate" />
  9. <result column="gmt_modified" property="gmtModified" />
  10. <result column="creator" property="creator" />
  11. <result column="modifier" property="modifier" />
  12. <result column="lib_id" property="libId" />
  13. <result column="lib_name" property="libName" />
  14. <result column="lib_type" property="libType" />
  15. </resultMap>
  16. <select id="getConcept" resultType="com.diagbot.dto.ConceptRes" parameterType="com.diagbot.entity.wrapper.ConceptWrapper">
  17. SELECT
  18. t1.id AS startId,
  19. t1.lib_name AS startName,
  20. t3.id AS endId,
  21. t3.lib_name AS endName
  22. FROM
  23. `kl_concept` t1,
  24. `kl_relation` t2,
  25. <if test="startSex != null or startAge != null">
  26. kl_concept_common c1,
  27. </if>
  28. <if test="endSex != null or endAge != null">
  29. kl_concept_common c2,
  30. </if>
  31. `kl_concept` t3
  32. WHERE
  33. t1.is_deleted = 'N'
  34. AND t2.is_deleted = 'N'
  35. AND t3.is_deleted = 'N'
  36. AND t1.id = t2.start_id
  37. AND t3.id = t2.end_id
  38. <if test="startId != null">
  39. AND t2.start_id = #{startId}
  40. </if>
  41. <if test="startName != null and startName != ''">
  42. AND t1.lib_name = #{startName}
  43. </if>
  44. <if test="startSex != null or startAge != null">
  45. AND c1.is_deleted = 'N'
  46. <if test="startSex != null">
  47. <if test="startSex == 3">
  48. and c1.sex_type in ('1','2','3')
  49. </if>
  50. <if test="startSex != 3">
  51. and c1.sex_type in ('3',#{startSex})
  52. </if>
  53. </if>
  54. <if test="startAge != null">
  55. <![CDATA[ AND c1.min_age <= #{startAge} ]]>
  56. <![CDATA[ AND c1.max_age >= #{startAge} ]]>
  57. </if>
  58. AND t2.start_id = c1.concept_id
  59. </if>
  60. <if test="startType != null">
  61. AND t1.lib_type = #{startType}
  62. </if>
  63. <if test="relationType != null">
  64. AND t2.relation_id = #{relationType}
  65. </if>
  66. <if test="endId != null">
  67. AND t2.end_id = #{endId}
  68. </if>
  69. <if test="endName != null and endName != ''">
  70. AND t3.lib_name = #{endName}
  71. </if>
  72. <if test="endSex != null or endAge != null">
  73. AND c2.is_deleted = 'N'
  74. <if test="endSex != null">
  75. <if test="endSex == 3">
  76. and c2.sex_type in ('1','2','3')
  77. </if>
  78. <if test="endSex != 3">
  79. and c2.sex_type in ('3',#{endSex})
  80. </if>
  81. </if>
  82. <if test="endAge != null">
  83. <![CDATA[ AND c2.min_age <= #{endAge} ]]>
  84. <![CDATA[ AND c2.max_age >= #{endAge} ]]>
  85. </if>
  86. AND t2.end_id = c2.concept_id
  87. </if>
  88. <if test="endType != null">
  89. AND t3.lib_type = #{endType}
  90. </if>
  91. </select>
  92. <select id="getConceptWithOrder" resultType="com.diagbot.dto.ConceptWithOrderRes" parameterType="com.diagbot.entity.wrapper.ConceptWrapper">
  93. SELECT
  94. t1.id AS startId,
  95. t1.lib_name AS startName,
  96. t3.id AS endId,
  97. t3.lib_name AS endName,
  98. t4.order_no AS orderNo
  99. FROM
  100. `kl_concept` t1,
  101. `kl_relation` t2,
  102. <if test="startSex != null or startAge != null">
  103. kl_concept_common c1,
  104. </if>
  105. <if test="endSex != null or endAge != null">
  106. kl_concept_common c2,
  107. </if>
  108. `kl_concept` t3,
  109. `kl_relation_order` t4
  110. WHERE
  111. t1.is_deleted = 'N'
  112. AND t2.is_deleted = 'N'
  113. AND t3.is_deleted = 'N'
  114. AND t4.is_deleted = 'N'
  115. AND t1.id = t2.start_id
  116. AND t3.id = t2.end_id
  117. AND t2.id = t4.t_relation_id
  118. <if test="startId != null">
  119. AND t2.start_id = #{startId}
  120. </if>
  121. <if test="startName != null and startName != ''">
  122. AND t1.lib_name = #{startName}
  123. </if>
  124. <if test="startSex != null or startAge != null">
  125. AND c1.is_deleted = 'N'
  126. <if test="startSex != null">
  127. <if test="startSex == 3">
  128. and c1.sex_type in ('1','2','3')
  129. </if>
  130. <if test="startSex != 3">
  131. and c1.sex_type in ('3',#{startSex})
  132. </if>
  133. </if>
  134. <if test="startAge != null">
  135. <![CDATA[ AND c1.min_age <= #{startAge} ]]>
  136. <![CDATA[ AND c1.max_age >= #{startAge} ]]>
  137. </if>
  138. AND t2.start_id = c1.concept_id
  139. </if>
  140. <if test="startNameList != null and startNameList.size() > 0">
  141. AND t1.lib_name in
  142. <foreach collection="startNameList" item="item" open="(" close=")" separator=",">
  143. #{item}
  144. </foreach>
  145. </if>
  146. <if test="startType != null">
  147. AND t1.lib_type = #{startType}
  148. </if>
  149. <if test="relationType != null">
  150. AND t2.relation_id = #{relationType}
  151. </if>
  152. <if test="endId != null">
  153. AND t2.end_id = #{endId}
  154. </if>
  155. <if test="endName != null and endName != ''">
  156. AND t3.lib_name = #{endName}
  157. </if>
  158. <if test="endSex != null or endAge != null">
  159. AND c2.is_deleted = 'N'
  160. <if test="endSex != null">
  161. <if test="endSex == 3">
  162. and c2.sex_type in ('1','2','3')
  163. </if>
  164. <if test="endSex != 3">
  165. and c2.sex_type in ('3',#{endSex})
  166. </if>
  167. </if>
  168. <if test="endAge != null">
  169. <![CDATA[ AND c2.min_age <= #{endAge} ]]>
  170. <![CDATA[ AND c2.max_age >= #{endAge} ]]>
  171. </if>
  172. AND t2.end_id = c2.concept_id
  173. </if>
  174. <if test="endNameList != null and endNameList.size() > 0">
  175. AND t3.lib_name in
  176. <foreach collection="endNameList" item="item" open="(" close=")" separator=",">
  177. #{item}
  178. </foreach>
  179. </if>
  180. <if test="endType != null">
  181. AND t3.lib_type = #{endType}
  182. </if>
  183. ORDER BY t4.order_no
  184. </select>
  185. <select id="retrievalConcept" resultType="com.diagbot.dto.ConceptRetrievalDTO">
  186. SELECT a1.* from (
  187. (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
  188. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  189. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  190. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  191. WHERE
  192. t1.is_deleted = 'N'
  193. AND t2.is_deleted = 'N'
  194. AND t3.is_deleted = 'N'
  195. AND t6.is_deleted = 'N'
  196. <if test="type != null">
  197. AND t1.lib_type = #{type}
  198. </if>
  199. <if test="otherType != null and otherType.size > 0">
  200. and t1.lib_type in
  201. <foreach item="type" collection="otherType" open="(" separator="," close=")">
  202. #{type}
  203. </foreach>
  204. </if>
  205. <if test="sexType == 3">
  206. and t3.sex_type in ('1','2','3')
  207. </if>
  208. <if test="sexType != 3">
  209. and t3.sex_type in ('3',#{sexType})
  210. </if>
  211. <if test="age != null and age != ''">
  212. AND <![CDATA[ t3.min_age <= #{age} ]]>
  213. AND <![CDATA[ t3.max_age >= #{age} ]]>
  214. </if>
  215. <if test="inputIds != null and inputIds.size > 0">
  216. and t1.id not in
  217. <foreach item="id" collection="inputIds" open="(" separator="," close=")">
  218. #{id}
  219. </foreach>
  220. </if>
  221. AND (t2.spell = UPPER(TRIM(#{InputStr})) OR UPPER(t2.name) = UPPER(TRIM(#{InputStr})))
  222. LIMIT 100)
  223. UNION
  224. (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
  225. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  226. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  227. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  228. WHERE
  229. t1.is_deleted = 'N'
  230. AND t2.is_deleted = 'N'
  231. AND t3.is_deleted = 'N'
  232. AND t6.is_deleted = 'N'
  233. <if test="type != null">
  234. AND t1.lib_type = #{type}
  235. </if>
  236. <if test="otherType != null and otherType.size > 0">
  237. and t1.lib_type in
  238. <foreach item="type" collection="otherType" open="(" separator="," close=")">
  239. #{type}
  240. </foreach>
  241. </if>
  242. <if test="sexType == 3">
  243. and t3.sex_type in ('1','2','3')
  244. </if>
  245. <if test="sexType != 3">
  246. and t3.sex_type in ('3',#{sexType})
  247. </if>
  248. <if test="age != null and age != ''">
  249. AND <![CDATA[ t3.min_age <= #{age} ]]>
  250. AND <![CDATA[ t3.max_age >= #{age} ]]>
  251. </if>
  252. <if test="inputIds != null and inputIds.size > 0">
  253. and t1.id not in
  254. <foreach item="id" collection="inputIds" open="(" separator="," close=")">
  255. #{id}
  256. </foreach>
  257. </if>
  258. AND (t2.spell LIKE CONCAT( UPPER(TRIM(#{InputStr})),'%') OR UPPER(t2.name) LIKE CONCAT( UPPER(TRIM(#{InputStr})),'%'))
  259. LIMIT 100)
  260. UNION
  261. (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
  262. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  263. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  264. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  265. WHERE
  266. t1.is_deleted = 'N'
  267. AND t2.is_deleted = 'N'
  268. AND t3.is_deleted = 'N'
  269. AND t6.is_deleted = 'N'
  270. <if test="type != null">
  271. AND t1.lib_type = #{type}
  272. </if>
  273. <if test="otherType != null and otherType.size > 0">
  274. and t1.lib_type in
  275. <foreach item="type" collection="otherType" open="(" separator="," close=")">
  276. #{type}
  277. </foreach>
  278. </if>
  279. <if test="sexType == 3">
  280. and t3.sex_type in ('1','2','3')
  281. </if>
  282. <if test="sexType != 3">
  283. and t3.sex_type in ('3',#{sexType})
  284. </if>
  285. <if test="age != null and age != ''">
  286. AND <![CDATA[ t3.min_age <= #{age} ]]>
  287. AND <![CDATA[ t3.max_age >= #{age} ]]>
  288. </if>
  289. <if test="inputIds != null and inputIds.size > 0">
  290. and t1.id not in
  291. <foreach item="id" collection="inputIds" open="(" separator="," close=")">
  292. #{id}
  293. </foreach>
  294. </if>
  295. AND (t2.spell LIKE CONCAT('%',UPPER(TRIM(#{InputStr})),'%') OR UPPER(t2.name) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})),'%'))
  296. LIMIT 100)
  297. <if test="detailType != null and detailType != ''">
  298. UNION
  299. (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
  300. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  301. LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
  302. LEFT JOIN kl_concept t5 on t5.id = t4.start_id
  303. LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
  304. LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
  305. WHERE
  306. t1.is_deleted = 'N'
  307. AND t2.is_deleted = 'N'
  308. AND t3.is_deleted = 'N'
  309. AND t4.is_deleted = 'N'
  310. AND t5.is_deleted = 'N'
  311. AND t6.is_deleted = 'N'
  312. <if test="detailType != null">
  313. AND t1.lib_type = #{detailType}
  314. </if>
  315. <if test="sexType == 3">
  316. and t3.sex_type in ('1','2','3')
  317. </if>
  318. <if test="sexType != 3">
  319. and t3.sex_type in ('3',#{sexType})
  320. </if>
  321. <if test="age != null and age != ''">
  322. AND <![CDATA[ t3.min_age <= #{age} ]]>
  323. AND <![CDATA[ t3.max_age >= #{age} ]]>
  324. </if>
  325. AND (t2.spell = UPPER(TRIM(#{InputStr})) OR UPPER(t2.name) = UPPER(TRIM(#{InputStr})))
  326. <if test="inputIds != null and inputIds.size > 0">
  327. and t1.id not in
  328. <foreach item="id" collection="inputIds" open="(" separator="," close=")">
  329. #{id}
  330. </foreach>
  331. </if>
  332. AND t4.relation_id = 18
  333. LIMIT 100)
  334. UNION
  335. (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
  336. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  337. LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
  338. LEFT JOIN kl_concept t5 on t5.id = t4.start_id
  339. LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
  340. LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
  341. WHERE
  342. t1.is_deleted = 'N'
  343. AND t2.is_deleted = 'N'
  344. AND t3.is_deleted = 'N'
  345. AND t4.is_deleted = 'N'
  346. AND t5.is_deleted = 'N'
  347. AND t6.is_deleted = 'N'
  348. <if test="detailType != null">
  349. AND t1.lib_type = #{detailType}
  350. </if>
  351. <if test="sexType == 3">
  352. and t3.sex_type in ('1','2','3')
  353. </if>
  354. <if test="sexType != 3">
  355. and t3.sex_type in ('3',#{sexType})
  356. </if>
  357. <if test="age != null and age != ''">
  358. AND <![CDATA[ t3.min_age <= #{age} ]]>
  359. AND <![CDATA[ t3.max_age >= #{age} ]]>
  360. </if>
  361. AND (t2.spell LIKE CONCAT(UPPER(TRIM(#{InputStr})),'%') OR UPPER(t2.name) LIKE CONCAT( UPPER(TRIM(#{InputStr})),'%'))
  362. <if test="inputIds != null and inputIds.size > 0">
  363. and t1.id not in
  364. <foreach item="id" collection="inputIds" open="(" separator="," close=")">
  365. #{id}
  366. </foreach>
  367. </if>
  368. <if test="isStatic != null and isStatic == 1">
  369. GROUP BY t5.id
  370. </if>
  371. AND t4.relation_id = 18
  372. LIMIT 100)
  373. UNION
  374. (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
  375. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  376. LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
  377. LEFT JOIN kl_concept t5 on t5.id = t4.start_id
  378. LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
  379. LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
  380. WHERE
  381. t1.is_deleted = 'N'
  382. AND t2.is_deleted = 'N'
  383. AND t3.is_deleted = 'N'
  384. AND t4.is_deleted = 'N'
  385. AND t5.is_deleted = 'N'
  386. AND t6.is_deleted = 'N'
  387. <if test="detailType != null">
  388. AND t1.lib_type = #{detailType}
  389. </if>
  390. <if test="sexType == 3">
  391. and t3.sex_type in ('1','2','3')
  392. </if>
  393. <if test="sexType != 3">
  394. and t3.sex_type in ('3',#{sexType})
  395. </if>
  396. <if test="age != null and age != ''">
  397. AND <![CDATA[ t3.min_age <= #{age} ]]>
  398. AND <![CDATA[ t3.max_age >= #{age} ]]>
  399. </if>
  400. AND (t2.spell LIKE CONCAT('%',UPPER(TRIM(#{InputStr})),'%') OR UPPER(t2.name) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})),'%'))
  401. <if test="inputIds != null and inputIds.size > 0">
  402. and t1.id not in
  403. <foreach item="id" collection="inputIds" open="(" separator="," close=")">
  404. #{id}
  405. </foreach>
  406. </if>
  407. AND t4.relation_id = 18
  408. LIMIT 100)
  409. </if>
  410. ) a1
  411. LIMIT 100
  412. </select>
  413. <select id="staticKnowledge" resultType="com.diagbot.dto.RetrievalDTO">
  414. SELECT
  415. a1.*
  416. FROM
  417. (
  418. -- 除化验外其他类型标签
  419. <if test="typesNoLis != null and typesNoLis.size() > 0">
  420. (
  421. SELECT
  422. b1.*, 0 uniqueId,
  423. NULL uniqueName
  424. FROM
  425. (
  426. SELECT
  427. t1.id conceptId,
  428. t1.lib_name `name`,
  429. (
  430. CASE t1.lib_type
  431. WHEN 18 THEN
  432. 10
  433. WHEN 10 THEN
  434. 20
  435. WHEN 1 THEN
  436. 25
  437. WHEN 16 THEN
  438. 50
  439. WHEN 25 THEN
  440. 60
  441. ELSE
  442. 100
  443. END
  444. ) + 1 AS orderNo,
  445. t2.`name` retrievalName,
  446. t2.is_concept showType,
  447. t1.lib_type libTypeId,
  448. CASE t6.`name`
  449. when '药品通用名' then '药品'
  450. when '辅检项目' then '辅检'
  451. ELSE t6.`name`
  452. END libTypeName
  453. FROM
  454. kl_concept t1
  455. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  456. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  457. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  458. LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
  459. WHERE
  460. t1.is_deleted = 'N'
  461. AND t2.is_deleted = 'N'
  462. AND t3.is_deleted = 'N'
  463. AND t6.is_deleted = 'N'
  464. AND t7.is_deleted = 'N'
  465. AND t1.lib_type IN
  466. <foreach collection="typesNoLis" item="item" open="(" close=")"
  467. separator=",">
  468. #{item}
  469. </foreach>
  470. AND (
  471. t2.spell = UPPER(#{InputStr})
  472. OR UPPER(TRIM(t2. NAME)) = UPPER((TRIM(#{InputStr})))
  473. )
  474. ) b1
  475. )
  476. UNION
  477. (
  478. SELECT
  479. b1.*, 0 uniqueId,
  480. NULL uniqueName
  481. FROM
  482. (
  483. SELECT
  484. t1.id conceptId,
  485. t1.lib_name `name`,
  486. (
  487. CASE t1.lib_type
  488. WHEN 18 THEN
  489. 10
  490. WHEN 10 THEN
  491. 20
  492. WHEN 1 THEN
  493. 25
  494. WHEN 16 THEN
  495. 50
  496. WHEN 25 THEN
  497. 60
  498. ELSE
  499. 100
  500. END
  501. ) + 2 AS orderNo,
  502. t2.`name` retrievalName,
  503. t2.is_concept showType,
  504. t1.lib_type libTypeId,
  505. CASE t6.`name`
  506. when '药品通用名' then '药品'
  507. when '辅检项目' then '辅检'
  508. ELSE t6.`name`
  509. END libTypeName
  510. FROM
  511. kl_concept t1
  512. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  513. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  514. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  515. LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
  516. WHERE
  517. t1.is_deleted = 'N'
  518. AND t2.is_deleted = 'N'
  519. AND t3.is_deleted = 'N'
  520. AND t6.is_deleted = 'N'
  521. AND t7.is_deleted = 'N'
  522. AND t1.lib_type IN
  523. <foreach collection="typesNoLis" item="item" open="(" close=")"
  524. separator=",">
  525. #{item}
  526. </foreach>
  527. AND (
  528. t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
  529. OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
  530. )
  531. ) b1
  532. )
  533. UNION
  534. (
  535. SELECT
  536. b1.*, 0 uniqueId,
  537. NULL uniqueName
  538. FROM
  539. (
  540. SELECT
  541. t1.id conceptId,
  542. t1.lib_name `name`,
  543. (
  544. CASE t1.lib_type
  545. WHEN 18 THEN
  546. 10
  547. WHEN 10 THEN
  548. 20
  549. WHEN 1 THEN
  550. 25
  551. WHEN 16 THEN
  552. 50
  553. WHEN 25 THEN
  554. 60
  555. ELSE
  556. 100
  557. END
  558. ) + 3 AS orderNo,
  559. t2.`name` retrievalName,
  560. t2.is_concept showType,
  561. t1.lib_type libTypeId,
  562. CASE t6.`name`
  563. when '药品通用名' then '药品'
  564. when '辅检项目' then '辅检'
  565. ELSE t6.`name`
  566. END libTypeName
  567. FROM
  568. kl_concept t1
  569. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  570. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  571. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  572. LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
  573. WHERE
  574. t1.is_deleted = 'N'
  575. AND t2.is_deleted = 'N'
  576. AND t3.is_deleted = 'N'
  577. AND t6.is_deleted = 'N'
  578. AND t7.is_deleted = 'N'
  579. AND t1.lib_type IN
  580. <foreach collection="typesNoLis" item="item" open="(" close=")"
  581. separator=",">
  582. #{item}
  583. </foreach>
  584. AND (
  585. t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
  586. OR UPPER(t2. NAME) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})), '%')
  587. )
  588. ) b1
  589. )
  590. </if>
  591. -- 化验本体标签公表项匹配静态知识
  592. <if test="typesNoLis != null and typesNoLis.size() > 0 and hasLis == true">
  593. UNION
  594. </if>
  595. <if test="hasLis == true">
  596. (
  597. SELECT
  598. b2.id conceptId,
  599. b1.selfName `name`,
  600. 31 AS orderNo,
  601. b1.retrievalName retrievalName,
  602. b1.showType showType,
  603. b1.libTypeId libTypeId,
  604. b1.libTypeName libTypeName,
  605. b2.id uniqueId,
  606. b2.lib_name uniqueName
  607. FROM
  608. (
  609. SELECT
  610. t1.id selfId,
  611. t1.lib_name selfName,
  612. t2.`name` retrievalName,
  613. t2.is_concept showType,
  614. t1.lib_type libTypeId,
  615. t6.`name` libTypeName
  616. FROM
  617. kl_concept t1
  618. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  619. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  620. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  621. WHERE
  622. t1.is_deleted = 'N'
  623. AND t2.is_deleted = 'N'
  624. AND t3.is_deleted = 'N'
  625. AND t6.is_deleted = 'N'
  626. AND t1.lib_type = 12
  627. AND (
  628. t2.spell = UPPER(#{InputStr})
  629. OR UPPER(t2. NAME) = UPPER(TRIM(#{InputStr}))
  630. )
  631. ) b1,
  632. kl_concept b2,
  633. kl_concept_detail b3,
  634. kl_lis_mapping m
  635. WHERE
  636. b2.is_deleted = 'N'
  637. AND b3.is_deleted = 'N'
  638. AND m.is_deleted = 'N'
  639. AND m.item_id = 0
  640. AND m.meal_id = b1.selfId
  641. AND m.unique_id = b2.id
  642. AND b2.lib_type = 46
  643. AND b2.id = b3.concept_id
  644. )
  645. UNION
  646. (
  647. SELECT
  648. b2.id conceptId,
  649. b1.selfName `name`,
  650. 32 AS orderNo,
  651. b1.retrievalName retrievalName,
  652. b1.showType showType,
  653. b1.libTypeId libTypeId,
  654. b1.libTypeName libTypeName,
  655. b2.id uniqueId,
  656. b2.lib_name uniqueName
  657. FROM
  658. (
  659. SELECT
  660. t1.id selfId,
  661. t1.lib_name selfName,
  662. t2.`name` retrievalName,
  663. t2.is_concept showType,
  664. t1.lib_type libTypeId,
  665. t6.`name` libTypeName
  666. FROM
  667. kl_concept t1
  668. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  669. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  670. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  671. WHERE
  672. t1.is_deleted = 'N'
  673. AND t2.is_deleted = 'N'
  674. AND t3.is_deleted = 'N'
  675. AND t6.is_deleted = 'N'
  676. AND t1.lib_type = 12
  677. AND (
  678. t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
  679. OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
  680. )
  681. ) b1,
  682. kl_concept b2,
  683. kl_concept_detail b3,
  684. kl_lis_mapping m
  685. WHERE
  686. b2.is_deleted = 'N'
  687. AND b3.is_deleted = 'N'
  688. AND m.is_deleted = 'N'
  689. AND m.item_id = 0
  690. AND m.meal_id = b1.selfId
  691. AND m.unique_id = b2.id
  692. AND b2.lib_type = 46
  693. AND b2.id = b3.concept_id
  694. )
  695. UNION
  696. (
  697. SELECT
  698. b2.id conceptId,
  699. b1.selfName `name`,
  700. 33 AS orderNo,
  701. b1.retrievalName retrievalName,
  702. b1.showType showType,
  703. b1.libTypeId libTypeId,
  704. b1.libTypeName libTypeName,
  705. b2.id uniqueId,
  706. b2.lib_name uniqueName
  707. FROM
  708. (
  709. SELECT
  710. t1.id selfId,
  711. t1.lib_name selfName,
  712. t2.`name` retrievalName,
  713. t2.is_concept showType,
  714. t1.lib_type libTypeId,
  715. t6.`name` libTypeName
  716. FROM
  717. kl_concept t1
  718. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  719. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  720. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  721. WHERE
  722. t1.is_deleted = 'N'
  723. AND t2.is_deleted = 'N'
  724. AND t3.is_deleted = 'N'
  725. AND t6.is_deleted = 'N'
  726. AND t1.lib_type = 12
  727. AND (
  728. t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
  729. OR UPPER(t2. NAME) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})), '%')
  730. )
  731. ) b1,
  732. kl_concept b2,
  733. kl_concept_detail b3,
  734. kl_lis_mapping m
  735. WHERE
  736. b2.is_deleted = 'N'
  737. AND b3.is_deleted = 'N'
  738. AND m.is_deleted = 'N'
  739. AND m.item_id = 0
  740. AND m.meal_id = b1.selfId
  741. AND m.unique_id = b2.id
  742. AND b2.lib_type = 46
  743. AND b2.id = b3.concept_id
  744. ) -- 化验子项推父项,父项公表项匹配静态知识
  745. UNION
  746. (
  747. SELECT
  748. b2.id conceptId,
  749. b1.parentName `name`,
  750. 34 AS orderNo,
  751. b1.retrievalName retrievalName,
  752. b1.showType + 10 showType,
  753. b1.libTypeId libTypeId,
  754. b1.libTypeName libTypeName,
  755. b2.id uniqueId,
  756. b2.lib_name uniqueName
  757. FROM
  758. (
  759. SELECT
  760. t1.id selfId,
  761. t1.lib_name selfName,
  762. t5.id parentId,
  763. t5.lib_name parentName,
  764. t2.`name` retrievalName,
  765. t2.is_concept showType,
  766. t5.lib_type libTypeId,
  767. t6.`name` libTypeName
  768. FROM
  769. kl_concept t1
  770. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  771. LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
  772. LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
  773. LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
  774. LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
  775. WHERE
  776. t1.is_deleted = 'N'
  777. AND t2.is_deleted = 'N'
  778. AND t3.is_deleted = 'N'
  779. AND t4.is_deleted = 'N'
  780. AND t5.is_deleted = 'N'
  781. AND t6.is_deleted = 'N'
  782. AND t1.lib_type = 13
  783. AND (
  784. t2.spell = UPPER(#{InputStr})
  785. OR UPPER(t2. NAME) = UPPER(TRIM(#{InputStr}))
  786. )
  787. AND t4.relation_id = 18
  788. ) b1,
  789. kl_concept b2,
  790. kl_concept_detail b3,
  791. kl_lis_mapping m
  792. WHERE
  793. b2.is_deleted = 'N'
  794. AND b3.is_deleted = 'N'
  795. AND m.is_deleted = 'N'
  796. AND m.meal_id = b1.parentId
  797. AND m.item_id = 0
  798. AND m.unique_id = b2.id
  799. AND b2.lib_type = 46
  800. AND b2.id = b3.concept_id
  801. )
  802. UNION
  803. (
  804. SELECT
  805. b2.id conceptId,
  806. b1.parentName `name`,
  807. 35 AS orderNo,
  808. b1.retrievalName retrievalName,
  809. b1.showType + 10 showType,
  810. b1.libTypeId libTypeId,
  811. b1.libTypeName libTypeName,
  812. b2.id uniqueId,
  813. b2.lib_name uniqueName
  814. FROM
  815. (
  816. SELECT
  817. t1.id selfId,
  818. t1.lib_name selfName,
  819. t5.id parentId,
  820. t5.lib_name parentName,
  821. t2.`name` retrievalName,
  822. t2.is_concept showType,
  823. t5.lib_type libTypeId,
  824. t6.`name` libTypeName
  825. FROM
  826. kl_concept t1
  827. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  828. LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
  829. LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
  830. LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
  831. LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
  832. WHERE
  833. t1.is_deleted = 'N'
  834. AND t2.is_deleted = 'N'
  835. AND t3.is_deleted = 'N'
  836. AND t4.is_deleted = 'N'
  837. AND t5.is_deleted = 'N'
  838. AND t6.is_deleted = 'N'
  839. AND t1.lib_type = 13
  840. AND (
  841. t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
  842. OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
  843. )
  844. AND t4.relation_id = 18
  845. ) b1,
  846. kl_concept b2,
  847. kl_concept_detail b3,
  848. kl_lis_mapping m
  849. WHERE
  850. b2.is_deleted = 'N'
  851. AND b3.is_deleted = 'N'
  852. AND m.is_deleted = 'N'
  853. AND m.meal_id = b1.parentId
  854. AND m.item_id = 0
  855. AND m.unique_id = b2.id
  856. AND b2.lib_type = 46
  857. AND b2.id = b3.concept_id
  858. )
  859. UNION
  860. (
  861. SELECT
  862. b2.id conceptId,
  863. b1.parentName `name`,
  864. 36 AS orderNo,
  865. b1.retrievalName retrievalName,
  866. b1.showType + 10 showType,
  867. b1.libTypeId libTypeId,
  868. b1.libTypeName libTypeName,
  869. b2.id uniqueId,
  870. b2.lib_name uniqueName
  871. FROM
  872. (
  873. SELECT
  874. t1.id selfId,
  875. t1.lib_name selfName,
  876. t5.id parentId,
  877. t5.lib_name parentName,
  878. t2.`name` retrievalName,
  879. t2.is_concept showType,
  880. t5.lib_type libTypeId,
  881. t6.`name` libTypeName
  882. FROM
  883. kl_concept t1
  884. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  885. LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
  886. LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
  887. LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
  888. LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
  889. WHERE
  890. t1.is_deleted = 'N'
  891. AND t2.is_deleted = 'N'
  892. AND t3.is_deleted = 'N'
  893. AND t4.is_deleted = 'N'
  894. AND t5.is_deleted = 'N'
  895. AND t6.is_deleted = 'N'
  896. AND t1.lib_type = 13
  897. AND (
  898. t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
  899. OR UPPER(t2. NAME) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
  900. )
  901. AND t4.relation_id = 18
  902. ) b1,
  903. kl_concept b2,
  904. kl_concept_detail b3,
  905. kl_lis_mapping m
  906. WHERE
  907. b2.is_deleted = 'N'
  908. AND b3.is_deleted = 'N'
  909. AND m.is_deleted = 'N'
  910. AND m.meal_id = b1.parentId
  911. AND m.item_id = 0
  912. AND m.unique_id = b2.id
  913. AND b2.lib_type = 46
  914. AND b2.id = b3.concept_id
  915. ) -- 化验子项推父项,父项--子项组合公表项匹配静态知识
  916. UNION
  917. (
  918. SELECT
  919. b2.id conceptId,
  920. CONCAT(b1.parentName,'(',b1.selfName,')') `name`,
  921. 41 AS orderNo,
  922. b1.retrievalName retrievalName,
  923. b1.showType + 20 showType,
  924. b1.libTypeId libTypeId,
  925. b1.libTypeName libTypeName,
  926. b2.id uniqueId,
  927. b2.lib_name uniqueName
  928. FROM
  929. (
  930. SELECT
  931. t1.id selfId,
  932. t1.lib_name selfName,
  933. t5.id parentId,
  934. t5.lib_name parentName,
  935. t2.`name` retrievalName,
  936. t2.is_concept showType,
  937. t1.lib_type libTypeId,
  938. t6.`name` libTypeName
  939. FROM
  940. kl_concept t1
  941. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  942. LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
  943. LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
  944. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  945. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  946. WHERE
  947. t1.is_deleted = 'N'
  948. AND t2.is_deleted = 'N'
  949. AND t3.is_deleted = 'N'
  950. AND t4.is_deleted = 'N'
  951. AND t5.is_deleted = 'N'
  952. AND t6.is_deleted = 'N'
  953. AND t1.lib_type = 13
  954. AND (
  955. t2.spell = UPPER(#{InputStr})
  956. OR UPPER(t2. NAME) = UPPER(TRIM(#{InputStr}))
  957. )
  958. AND t4.relation_id = 18
  959. ) b1,
  960. kl_concept b2,
  961. kl_concept_detail b3,
  962. kl_lis_mapping m
  963. WHERE
  964. b2.is_deleted = 'N'
  965. AND b3.is_deleted = 'N'
  966. AND m.is_deleted = 'N'
  967. AND m.meal_id = b1.parentId
  968. AND m.item_id = b1.selfId
  969. AND m.unique_id = b2.id
  970. AND b2.lib_type = 46
  971. AND b2.id = b3.concept_id
  972. )
  973. UNION
  974. (
  975. SELECT
  976. b2.id conceptId,
  977. CONCAT(b1.parentName,'(',b1.selfName,')') `name`,
  978. 42 AS orderNo,
  979. b1.retrievalName retrievalName,
  980. b1.showType + 20 showType,
  981. b1.libTypeId libTypeId,
  982. b1.libTypeName libTypeName,
  983. b2.id uniqueId,
  984. b2.lib_name uniqueName
  985. FROM
  986. (
  987. SELECT
  988. t1.id selfId,
  989. t1.lib_name selfName,
  990. t5.id parentId,
  991. t5.lib_name parentName,
  992. t2.`name` retrievalName,
  993. t2.is_concept showType,
  994. t1.lib_type libTypeId,
  995. t6.`name` libTypeName
  996. FROM
  997. kl_concept t1
  998. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  999. LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
  1000. LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
  1001. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  1002. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  1003. WHERE
  1004. t1.is_deleted = 'N'
  1005. AND t2.is_deleted = 'N'
  1006. AND t3.is_deleted = 'N'
  1007. AND t4.is_deleted = 'N'
  1008. AND t5.is_deleted = 'N'
  1009. AND t6.is_deleted = 'N'
  1010. AND t1.lib_type = 13
  1011. AND (
  1012. t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
  1013. OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
  1014. )
  1015. AND t4.relation_id = 18
  1016. ) b1,
  1017. kl_concept b2,
  1018. kl_concept_detail b3,
  1019. kl_lis_mapping m
  1020. WHERE
  1021. b2.is_deleted = 'N'
  1022. AND b3.is_deleted = 'N'
  1023. AND m.is_deleted = 'N'
  1024. AND m.meal_id = b1.parentId
  1025. AND m.item_id = b1.selfId
  1026. AND m.unique_id = b2.id
  1027. AND b2.lib_type = 46
  1028. AND b2.id = b3.concept_id
  1029. )
  1030. UNION
  1031. (
  1032. SELECT
  1033. b2.id conceptId,
  1034. CONCAT(b1.parentName,'(',b1.selfName,')') `name`,
  1035. 43 AS orderNo,
  1036. b1.retrievalName retrievalName,
  1037. b1.showType + 20 showType,
  1038. b1.libTypeId libTypeId,
  1039. b1.libTypeName libTypeName,
  1040. b2.id uniqueId,
  1041. b2.lib_name uniqueName
  1042. FROM
  1043. (
  1044. SELECT
  1045. t1.id selfId,
  1046. t1.lib_name selfName,
  1047. t5.id parentId,
  1048. t5.lib_name parentName,
  1049. t2.`name` retrievalName,
  1050. t2.is_concept showType,
  1051. t1.lib_type libTypeId,
  1052. t6.`name` libTypeName
  1053. FROM
  1054. kl_concept t1
  1055. LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
  1056. LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
  1057. LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
  1058. LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
  1059. LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
  1060. WHERE
  1061. t1.is_deleted = 'N'
  1062. AND t2.is_deleted = 'N'
  1063. AND t3.is_deleted = 'N'
  1064. AND t4.is_deleted = 'N'
  1065. AND t5.is_deleted = 'N'
  1066. AND t6.is_deleted = 'N'
  1067. AND t1.lib_type = 13
  1068. AND (
  1069. t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
  1070. OR UPPER(t2. NAME) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
  1071. )
  1072. AND t4.relation_id = 18
  1073. ) b1,
  1074. kl_concept b2,
  1075. kl_concept_detail b3,
  1076. kl_lis_mapping m
  1077. WHERE
  1078. b2.is_deleted = 'N'
  1079. AND b3.is_deleted = 'N'
  1080. AND m.is_deleted = 'N'
  1081. AND m.meal_id = b1.parentId
  1082. AND m.item_id = b1.selfId
  1083. AND m.unique_id = b2.id
  1084. AND b2.lib_type = 46
  1085. AND b2.id = b3.concept_id
  1086. )
  1087. </if>
  1088. ) a1
  1089. ORDER BY
  1090. a1.orderNo ASC,
  1091. a1.showType DESC,
  1092. a1.conceptId ASC
  1093. </select>
  1094. <select id="getConceptConMap" resultType="com.diagbot.dto.ConceptBaseDTO" parameterType="com.diagbot.vo.ConceptFindVO">
  1095. SELECT
  1096. t1.id as conceptId,
  1097. t1.lib_name as name
  1098. FROM
  1099. kl_concept t1,
  1100. kl_concept_common t2
  1101. WHERE
  1102. t1.id = t2.concept_id
  1103. AND t1.is_deleted = 'N'
  1104. AND t2.is_deleted = 'N'
  1105. <if test="conceptIds != null and conceptIds.size > 0">
  1106. and t1.id in
  1107. <foreach item="id" collection="conceptIds" open="(" separator="," close=")">
  1108. #{id}
  1109. </foreach>
  1110. </if>
  1111. <if test="sexType == 3">
  1112. AND t2.sex_type IN ('1','2','3')
  1113. </if>
  1114. <if test="sexType != 3">
  1115. AND t2.sex_type IN ('3',#{sexType})
  1116. </if>
  1117. <if test="age != null and age != ''">
  1118. AND <![CDATA[ t2.min_age <= #{age} ]]>
  1119. AND <![CDATA[ t2.max_age >= #{age} ]]>
  1120. </if>
  1121. </select>
  1122. <select id="getStandWord" resultType="java.lang.String">
  1123. SELECT lib_name FROM kl_concept WHERE is_deleted = 'N' AND lib_type = 33
  1124. </select>
  1125. <select id="indexConcept" resultType="com.diagbot.dto.ConceptBaseDTO">
  1126. SELECT DISTINCT b.id concept_id,b.lib_name name FROM `kl_library_info` a, kl_concept b
  1127. where a.is_deleted = 'N' and b.is_deleted = 'N'
  1128. and a.concept_id = b.id
  1129. and a.`name` like concat('%',#{name},'%') and a.type_id = #{libType} and b.lib_type = #{libType}
  1130. </select>
  1131. </mapper>