KlConceptMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  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.KlConceptMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.diagbot.entity.KlConcept">
  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. <result column="status" property="status" />
  16. </resultMap>
  17. <select id="index" resultType="com.diagbot.dto.IndexDTO">
  18. SELECT DISTINCT
  19. t.id as id,
  20. t.lib_name as name
  21. <if test="typeId!=null and typeId==100">
  22. ,t.icd10Code as icd10Code
  23. </if>
  24. <if test="typeId!=null and typeId==127">
  25. ,t.code as code
  26. </if>
  27. <if test="typeId!=null and typeId==128">
  28. ,t.code as code
  29. </if>
  30. <if test="typeId!=null and typeId==108">
  31. ,
  32. t1.max_value as `maxValue`,
  33. t1.min_value as minValue,
  34. t1.unit as units,
  35. t1.type as `range`,
  36. t4.lib_name AS packName,
  37. t4.id as packId
  38. </if>
  39. FROM
  40. (
  41. SELECT DISTINCT
  42. b.id,
  43. b.lib_name
  44. <if test="typeId!=null and typeId==100">
  45. ,c.icd10_code as icd10Code
  46. </if>
  47. <if test="typeId!=null and typeId==127">
  48. ,c.code as code
  49. </if>
  50. <if test="typeId!=null and typeId==128">
  51. ,c.code as code
  52. </if>
  53. FROM
  54. kl_library_info a,
  55. kl_concept b
  56. <if test="typeId!=null and typeId==100">
  57. left join kl_disease c
  58. on c.is_deleted = 'N'
  59. and b.id = c.concept_id
  60. </if>
  61. <if test="typeId!=null and typeId==127">
  62. left join kl_tcm_disease c
  63. on c.is_deleted = 'N'
  64. and b.id = c.concept_id
  65. </if>
  66. <if test="typeId!=null and typeId==128">
  67. left join kl_tcm_syndrome c
  68. on c.is_deleted = 'N'
  69. and b.id = c.concept_id
  70. </if>
  71. WHERE
  72. a.is_deleted = 'N'
  73. AND b.is_deleted = 'N'
  74. AND a.concept_id = b.id
  75. AND a.id = b.lib_id
  76. AND b.status = 1
  77. <if test="inputStr!=null and inputStr!=''">
  78. AND ( a.`name` = #{inputStr} OR LOWER(a.spell) = LOWER(#{inputStr})
  79. <if test="typeId!=null and typeId==100">
  80. OR LOWER(c.icd10_code) = LOWER(#{inputStr})
  81. </if>
  82. <if test="typeId!=null and typeId==127">
  83. OR LOWER(c.code) = LOWER(#{inputStr})
  84. </if>
  85. <if test="typeId!=null and typeId==128">
  86. OR LOWER(c.code) = LOWER(#{inputStr})
  87. </if>
  88. )
  89. </if>
  90. <if test="typeIds != null and typeIds.size > 0">
  91. <foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")" >
  92. a.type_id =#{typeId}
  93. </foreach>
  94. </if>
  95. UNION
  96. SELECT DISTINCT
  97. b.id,
  98. b.lib_name
  99. <if test="typeId!=null and typeId==100">
  100. ,c.icd10_code as icd10Code
  101. </if>
  102. <if test="typeId!=null and typeId==127">
  103. ,c.code as code
  104. </if>
  105. <if test="typeId!=null and typeId==128">
  106. ,c.code as code
  107. </if>
  108. FROM
  109. kl_library_info a,
  110. kl_concept b
  111. <if test="typeId!=null and typeId==100">
  112. left join kl_disease c
  113. on c.is_deleted = 'N'
  114. and b.id = c.concept_id
  115. </if>
  116. <if test="typeId!=null and typeId==127">
  117. left join kl_tcm_disease c
  118. on c.is_deleted = 'N'
  119. and b.id = c.concept_id
  120. </if>
  121. <if test="typeId!=null and typeId==128">
  122. left join kl_tcm_syndrome c
  123. on c.is_deleted = 'N'
  124. and b.id = c.concept_id
  125. </if>
  126. WHERE
  127. a.is_deleted = 'N'
  128. AND b.is_deleted = 'N'
  129. AND a.concept_id = b.id
  130. AND a.id = b.lib_id
  131. AND b.status = 1
  132. <if test="inputStr!=null and inputStr!=''">
  133. AND ( a.`name` LIKE concat(#{inputStr},'%') OR LOWER(a.spell) LIKE LOWER(concat(#{inputStr},'%'))
  134. <if test="typeId!=null and typeId==100">
  135. OR LOWER(c.icd10_code) LIKE LOWER(concat(#{inputStr},'%'))
  136. </if>
  137. <if test="typeId!=null and typeId==127">
  138. OR LOWER(c.code) LIKE LOWER(concat(#{inputStr},'%'))
  139. </if>
  140. <if test="typeId!=null and typeId==128">
  141. OR LOWER(c.code) LIKE LOWER(concat(#{inputStr},'%'))
  142. </if>
  143. )
  144. </if>
  145. <if test="typeIds != null and typeIds.size > 0">
  146. <foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")" >
  147. a.type_id =#{typeId}
  148. </foreach>
  149. </if>
  150. UNION
  151. SELECT DISTINCT
  152. b.id,
  153. b.lib_name
  154. <if test="typeId!=null and typeId==100">
  155. ,c.icd10_code as icd10Code
  156. </if>
  157. <if test="typeId!=null and typeId==127">
  158. ,c.code as code
  159. </if>
  160. <if test="typeId!=null and typeId==128">
  161. ,c.code as code
  162. </if>
  163. FROM
  164. kl_library_info a,
  165. kl_concept b
  166. <if test="typeId!=null and typeId==100">
  167. left join kl_disease c
  168. on c.is_deleted = 'N'
  169. and b.id = c.concept_id
  170. </if>
  171. <if test="typeId!=null and typeId==127">
  172. left join kl_tcm_disease c
  173. on c.is_deleted = 'N'
  174. and b.id = c.concept_id
  175. </if>
  176. <if test="typeId!=null and typeId==128">
  177. left join kl_tcm_syndrome c
  178. on c.is_deleted = 'N'
  179. and b.id = c.concept_id
  180. </if>
  181. WHERE
  182. a.is_deleted = 'N'
  183. AND b.is_deleted = 'N'
  184. AND a.concept_id = b.id
  185. AND a.id = b.lib_id
  186. AND b.status = 1
  187. <if test="inputStr!=null and inputStr!=''">
  188. AND ( a.`name` LIKE concat('%',#{inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat('%',#{inputStr},'%'))
  189. <if test="typeId!=null and typeId==100">
  190. OR LOWER(c.icd10_code) LIKE LOWER( concat('%',#{inputStr},'%'))
  191. </if>
  192. <if test="typeId!=null and typeId==127">
  193. OR LOWER(c.code) LIKE LOWER( concat('%',#{inputStr},'%'))
  194. </if>
  195. <if test="typeId!=null and typeId==128">
  196. OR LOWER(c.code) LIKE LOWER( concat('%',#{inputStr},'%'))
  197. </if>
  198. )
  199. </if>
  200. <if test="typeIds != null and typeIds.size > 0">
  201. <foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")" >
  202. a.type_id =#{typeId}
  203. </foreach>
  204. </if>
  205. ) t
  206. <if test="typeId!=null and typeId==108">
  207. LEFT JOIN kl_lis t1 ON t.id = t1.concept_id
  208. AND t1.is_deleted = 'N'
  209. LEFT JOIN kl_relation t3 ON t.id = t3.end_id
  210. AND t3.relation_id = 600
  211. AND t3.is_deleted = 'N'
  212. LEFT JOIN kl_concept t4 ON t3.start_id = t4.id
  213. AND t4.lib_type = 107
  214. AND t4.is_deleted = 'N'
  215. </if>
  216. <if test="size!=null">
  217. LIMIT #{size}
  218. </if>
  219. </select>
  220. <select id="staticIndex" resultType="com.diagbot.dto.StaticKnowledgeIndexDTO">
  221. SELECT
  222. f.*
  223. FROM
  224. (
  225. SELECT
  226. s.moduleNo,
  227. s.id,
  228. s.name,
  229. s.retrievalName,
  230. s.isConcept,
  231. s.type,
  232. s.typeName,
  233. s.code,
  234. s1.concept_id AS conceptId,
  235. s1.clinical_pathway_name,
  236. s1.notice_name,
  237. s1.`status` AS status,
  238. IF( count( s2.id )> 0, 1, 0 ) AS hasInfo ,
  239. IF( sum( IF ( FIND_IN_SET( 1, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasStaticKnowledge,
  240. IF( sum( IF ( FIND_IN_SET( 2, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasNotice,
  241. IF( sum( IF ( FIND_IN_SET( 3, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasClinicalPathway,
  242. IF( sum( IF ( FIND_IN_SET( 4, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasTreatInfo
  243. FROM
  244. (
  245. SELECT
  246. t.moduleNo,
  247. t.id,
  248. t.NAME,
  249. IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
  250. t.isConcept,
  251. t.type,
  252. t.typeName,
  253. t1.icd10_code AS code
  254. FROM
  255. (
  256. SELECT
  257. concat( '1', b.lib_type ) AS moduleNo,
  258. a.NAME AS retrievalName,
  259. a.spell AS spell,
  260. a.is_concept AS isConcept,
  261. b.id AS id,
  262. b.lib_name AS NAME,
  263. b.lib_type AS type,
  264. c.NAME AS typeName
  265. FROM
  266. kl_library_info a,
  267. kl_concept b,
  268. kl_lexicon c
  269. WHERE
  270. a.is_deleted = 'N'
  271. AND b.is_deleted = 'N'
  272. AND c.is_deleted = 'N'
  273. AND a.concept_id = b.id
  274. AND b.lib_type = c.code
  275. AND b.`status` = 1
  276. <if test="typeIds != null and typeIds.size > 0">
  277. <foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")" >
  278. a.type_id =#{typeId}
  279. </foreach>
  280. </if>
  281. <if test="inputStr!=null and inputStr!=''">
  282. AND ( a.name = #{inputStr}
  283. OR LOWER(a.spell) = LOWER(#{inputStr}))
  284. </if>
  285. ) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
  286. UNION
  287. SELECT
  288. t.moduleNo,
  289. t.id,
  290. t.NAME,
  291. IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
  292. t.isConcept,
  293. t.type,
  294. t.typeName,
  295. t1.icd10_code AS code
  296. FROM
  297. (
  298. SELECT
  299. concat( '2', b.lib_type ) AS moduleNo,
  300. a.NAME AS retrievalName,
  301. a.spell AS spell,
  302. a.is_concept AS isConcept,
  303. b.id AS id,
  304. b.lib_name AS NAME,
  305. b.lib_type AS type,
  306. c.NAME AS typeName
  307. FROM
  308. kl_library_info a,
  309. kl_concept b,
  310. kl_lexicon c
  311. WHERE
  312. a.is_deleted = 'N'
  313. AND b.is_deleted = 'N'
  314. AND c.is_deleted = 'N'
  315. AND a.concept_id = b.id
  316. AND b.lib_type = c.code
  317. AND b.`status` = 1
  318. <if test="typeIds != null and typeIds.size > 0">
  319. <foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")" >
  320. a.type_id =#{typeId}
  321. </foreach>
  322. </if>
  323. <if test="inputStr!=null and inputStr!=''">
  324. AND ( a.name LIKE concat(#{inputStr},'%')
  325. OR LOWER(a.spell) LIKE LOWER( concat(#{inputStr},'%')))
  326. </if>
  327. ) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
  328. UNION
  329. SELECT
  330. t.moduleNo,
  331. t.id,
  332. t.NAME,
  333. IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
  334. t.isConcept,
  335. t.type,
  336. t.typeName,
  337. t1.icd10_code AS code
  338. FROM
  339. (
  340. SELECT
  341. concat( '3', b.lib_type ) AS moduleNo,
  342. a.NAME AS retrievalName,
  343. a.spell AS spell,
  344. a.is_concept AS isConcept,
  345. b.id AS id,
  346. b.lib_name AS NAME,
  347. b.lib_type AS type,
  348. c.NAME AS typeName
  349. FROM
  350. kl_library_info a,
  351. kl_concept b,
  352. kl_lexicon c
  353. WHERE
  354. a.is_deleted = 'N'
  355. AND b.is_deleted = 'N'
  356. AND c.is_deleted = 'N'
  357. AND a.concept_id = b.id
  358. AND b.lib_type = c.code
  359. AND b.`status` = 1
  360. <if test="typeIds != null and typeIds.size > 0">
  361. <foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")" >
  362. a.type_id =#{typeId}
  363. </foreach>
  364. </if>
  365. <if test="inputStr!=null and inputStr!=''">
  366. AND ( a.name LIKE concat('%',#{inputStr},'%')
  367. OR LOWER(a.spell) LIKE LOWER( concat('%',#{inputStr},'%')))
  368. </if>
  369. ) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
  370. <if test="typeIds.contains(107) or typeIds.contains(108)">
  371. UNION
  372. SELECT DISTINCT
  373. concat( '1', e.lib_type ) AS moduleNo,
  374. e.id AS id,
  375. e.lib_name AS NAME,
  376. b.lib_name AS retrievalName,
  377. 1 AS isConcept,
  378. e.lib_type AS type,
  379. c.name AS typeName,
  380. NULL AS code
  381. FROM
  382. kl_library_info a,
  383. kl_concept b,
  384. kl_lexicon c,
  385. kl_relation d,
  386. kl_concept e
  387. WHERE
  388. a.is_deleted = 'N'
  389. AND b.is_deleted = 'N'
  390. AND c.is_deleted = 'N'
  391. AND d.is_deleted = 'N'
  392. AND e.is_deleted = 'N'
  393. AND a.concept_id = b.id
  394. AND b.id = d.end_id
  395. AND e.id = d.start_id
  396. AND e.lib_type = c.code
  397. AND b.lib_type = 108
  398. AND e.lib_type = 107
  399. AND d.relation_id = 600
  400. AND b.`status` = 1
  401. <if test="inputStr!=null and inputStr!=''">
  402. AND ( a.name = #{inputStr} OR LOWER(a.spell) = LOWER(#{inputStr}))
  403. </if>
  404. UNION
  405. SELECT DISTINCT
  406. concat( '2', e.lib_type ) AS moduleNo,
  407. e.id AS id,
  408. e.lib_name AS NAME,
  409. b.lib_name AS retrievalName,
  410. 1 AS isConcept,
  411. e.lib_type AS type,
  412. c.name AS typeName,
  413. NULL AS code
  414. FROM
  415. kl_library_info a,
  416. kl_concept b,
  417. kl_lexicon c,
  418. kl_relation d,
  419. kl_concept e
  420. WHERE
  421. a.is_deleted = 'N'
  422. AND b.is_deleted = 'N'
  423. AND c.is_deleted = 'N'
  424. AND d.is_deleted = 'N'
  425. AND e.is_deleted = 'N'
  426. AND a.concept_id = b.id
  427. AND b.id = d.end_id
  428. AND e.id = d.start_id
  429. AND e.lib_type = c.code
  430. AND b.lib_type = 108
  431. AND e.lib_type = 107
  432. AND d.relation_id = 600
  433. AND b.`status` = 1
  434. <if test="inputStr!=null and inputStr!=''">
  435. AND ( a.name LIKE concat(#{inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat(#{inputStr},'%')))
  436. </if>
  437. UNION
  438. SELECT DISTINCT
  439. concat( '3', e.lib_type ) AS moduleNo,
  440. e.id AS id,
  441. e.lib_name AS NAME,
  442. b.lib_name AS retrievalName,
  443. 1 AS isConcept,
  444. e.lib_type AS type,
  445. c.name AS typeName,
  446. NULL AS code
  447. FROM
  448. kl_library_info a,
  449. kl_concept b,
  450. kl_lexicon c,
  451. kl_relation d,
  452. kl_concept e
  453. WHERE
  454. a.is_deleted = 'N'
  455. AND b.is_deleted = 'N'
  456. AND c.is_deleted = 'N'
  457. AND d.is_deleted = 'N'
  458. AND e.is_deleted = 'N'
  459. AND a.concept_id = b.id
  460. AND b.id = d.end_id
  461. AND e.id = d.start_id
  462. AND e.lib_type = c.code
  463. AND b.lib_type = 108
  464. AND e.lib_type = 107
  465. AND d.relation_id = 600
  466. AND b.`status` = 1
  467. <if test="inputStr!=null and inputStr!=''">
  468. AND ( a.name LIKE concat('%',#{inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat('%',#{inputStr},'%')))
  469. </if>
  470. </if>
  471. <if test="typeIds.contains(100) ">
  472. UNION
  473. SELECT
  474. t.moduleNo,
  475. t.id,
  476. t.NAME,
  477. IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
  478. t.isConcept,
  479. t.type,
  480. t.typeName,
  481. l1.icd10_code AS code
  482. FROM
  483. (
  484. SELECT
  485. concat( '1', b.lib_type ) AS moduleNo,
  486. a.NAME AS retrievalName,
  487. a.spell AS spell,
  488. a.is_concept AS isConcept,
  489. b.id AS id,
  490. b.lib_name AS NAME,
  491. b.lib_type AS type,
  492. c.NAME AS typeName
  493. FROM
  494. kl_library_info a,
  495. kl_concept b,
  496. kl_lexicon c
  497. WHERE
  498. a.is_deleted = 'N'
  499. AND b.is_deleted = 'N'
  500. AND c.is_deleted = 'N'
  501. AND a.concept_id = b.id
  502. AND b.lib_type = c.code
  503. AND b.`status` = 1
  504. AND a.type_id =100
  505. ) t
  506. LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
  507. AND l1.is_deleted = 'N'
  508. WHERE
  509. 1=1
  510. <if test="inputStr!=null and inputStr!=''">
  511. AND LOWER(l1.icd10_code) = LOWER(#{inputStr})
  512. </if>
  513. UNION
  514. SELECT
  515. t.moduleNo,
  516. t.id,
  517. t.NAME,
  518. IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
  519. t.isConcept,
  520. t.type,
  521. t.typeName,
  522. l1.icd10_code AS code
  523. FROM
  524. (
  525. SELECT
  526. concat( '2', b.lib_type ) AS moduleNo,
  527. a.NAME AS retrievalName,
  528. a.spell AS spell,
  529. a.is_concept AS isConcept,
  530. b.id AS id,
  531. b.lib_name AS NAME,
  532. b.lib_type AS type,
  533. c.NAME AS typeName
  534. FROM
  535. kl_library_info a,
  536. kl_concept b,
  537. kl_lexicon c
  538. WHERE
  539. a.is_deleted = 'N'
  540. AND b.is_deleted = 'N'
  541. AND c.is_deleted = 'N'
  542. AND a.concept_id = b.id
  543. AND b.lib_type = c.code
  544. AND b.`status` = 1
  545. AND a.type_id =100
  546. ) t
  547. LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
  548. AND l1.is_deleted = 'N'
  549. WHERE
  550. 1=1
  551. <if test="inputStr!=null and inputStr!=''">
  552. AND LOWER(l1.icd10_code) LIKE LOWER( concat(#{inputStr},'%'))
  553. </if>
  554. UNION
  555. SELECT
  556. t.moduleNo,
  557. t.id,
  558. t.NAME,
  559. IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
  560. t.isConcept,
  561. t.type,
  562. t.typeName,
  563. l1.icd10_code AS code
  564. FROM
  565. (
  566. SELECT
  567. concat( '3', b.lib_type ) AS moduleNo,
  568. a.NAME AS retrievalName,
  569. a.spell AS spell,
  570. a.is_concept AS isConcept,
  571. b.id AS id,
  572. b.lib_name AS NAME,
  573. b.lib_type AS type,
  574. c.NAME AS typeName
  575. FROM
  576. kl_library_info a,
  577. kl_concept b,
  578. kl_lexicon c
  579. WHERE
  580. a.is_deleted = 'N'
  581. AND b.is_deleted = 'N'
  582. AND c.is_deleted = 'N'
  583. AND a.concept_id = b.id
  584. AND b.lib_type = c.code
  585. AND b.`status` = 1
  586. AND a.type_id =100
  587. ) t
  588. LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
  589. AND l1.is_deleted = 'N'
  590. WHERE
  591. 1=1
  592. <if test="inputStr!=null and inputStr!=''">
  593. AND LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{inputStr},'%'))
  594. </if>
  595. </if>
  596. ) s
  597. LEFT JOIN kl_concept_static s1 ON s.id = s1.concept_id
  598. AND s1.is_deleted = 'N'
  599. LEFT JOIN kl_concept_detail s2 ON s.id = s2.concept_id
  600. AND s2.is_deleted = 'N'
  601. GROUP BY s.id
  602. ) f
  603. WHERE
  604. 1 = 1
  605. <if test="hasInfo!=null ">
  606. <choose>
  607. <when test="hasInfo==0">
  608. AND f.conceptId IS NULL
  609. </when>
  610. <when test="hasInfo==1">
  611. AND f.conceptId IS NOT NULL
  612. </when>
  613. </choose>
  614. </if>
  615. order by f.type asc,f.moduleNo ASC,f.isConcept DESC
  616. <if test="size!=null">
  617. LIMIT #{size}
  618. </if>
  619. </select>
  620. <select id="getLisDetaisByNames" parameterType="com.diagbot.vo.KllisDetailVO" resultType="com.diagbot.dto.KllisDetailDTO">
  621. SELECT
  622. t1.lib_name,
  623. t1.id,
  624. t2.min_value,
  625. t2.max_value,
  626. t2.type,
  627. t2.unit
  628. FROM
  629. `kl_concept` t1,
  630. kl_lis t2
  631. WHERE
  632. t1.is_deleted = "N"
  633. AND t2.is_deleted = "N"
  634. AND t1.id = t2.concept_id
  635. AND t1.lib_type = 108
  636. AND t1.`status` = 1
  637. <if test="names != null and names.size > 0">
  638. and t1.lib_name in
  639. <foreach item="name" collection="names" open="(" separator="," close=")">
  640. #{name}
  641. </foreach>
  642. </if>
  643. </select>
  644. </mapper>