KlRuleMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.diagbot.mapper.KlRuleMapper">
  5. <!-- 通用查询映射结果 -->
  6. <resultMap id="BaseResultMap" type="com.diagbot.entity.KlRule">
  7. <id column="id" property="id"/>
  8. <result column="is_deleted" property="isDeleted"/>
  9. <result column="gmt_create" property="gmtCreate"/>
  10. <result column="gmt_modified" property="gmtModified"/>
  11. <result column="creator" property="creator"/>
  12. <result column="modifier" property="modifier"/>
  13. <result column="concept_id" property="conceptId"/>
  14. <result column="description" property="description"/>
  15. <result column="rule_type" property="ruleType"/>
  16. <result column="status" property="status"/>
  17. </resultMap>
  18. <resultMap id="SchemaResultMap" type="com.diagbot.dto.RuleDTO">
  19. <result column="libName" property="libName"/>
  20. <result column="libType" property="libType"/>
  21. <result column="ruleType" property="ruleType"/>
  22. <collection property="ruleConditionDTOList" ofType="com.diagbot.dto.RuleConditionDTO">
  23. <result column="hasSubCond" property="hasSubCond"/>
  24. <result column="ruleGroup" property="ruleGroup"/>
  25. <result column="msg" property="msg"/>
  26. <collection property="ruleBaseDTOList" ofType="com.diagbot.dto.RuleBaseDTO">
  27. <result column="baseLibName" property="baseLibName"/>
  28. <result column="baseLibType" property="baseLibType"/>
  29. <result column="baseType" property="baseType"/>
  30. <result column="baseMinOperator" property="baseMinOperator"/>
  31. <result column="baseMinValue" property="baseMinValue"/>
  32. <result column="baseMinUnit" property="baseMinUnit"/>
  33. <result column="baseMaxOperator" property="baseMaxOperator"/>
  34. <result column="baseMaxValue" property="baseMaxValue"/>
  35. <result column="baseMaxUnit" property="baseMaxUnit"/>
  36. <result column="baseEqOperator" property="baseEqOperator"/>
  37. <result column="baseEqValue" property="baseEqValue"/>
  38. <result column="baseEqUnit" property="baseEqUnit"/>
  39. </collection>
  40. </collection>
  41. </resultMap>
  42. <select id="getAllRule" resultMap="SchemaResultMap">
  43. SELECT
  44. t10.*
  45. FROM
  46. (
  47. SELECT
  48. t4.lib_name AS libName,
  49. t4.lib_type AS libType,
  50. t1.rule_type AS ruleType,
  51. t1.msg AS msg,
  52. t1.has_sub_cond AS hasSubCond,
  53. CONCAT_WS("-", t1.id, 1) AS ruleGroup,
  54. "" AS baseLibName,
  55. 0 AS baseLibType,
  56. 0 AS baseType,
  57. "" AS baseMinOperator,
  58. "" AS baseMinValue,
  59. "" AS baseMinUnit,
  60. "" AS baseMaxOperator,
  61. "" AS baseMaxValue,
  62. "" AS baseMaxUnit,
  63. "" AS baseEqOperator,
  64. "" AS baseEqValue,
  65. "" AS baseEqUnit
  66. FROM
  67. kl_rule t1,
  68. kl_concept t4
  69. WHERE
  70. t1.is_deleted = "N"
  71. AND t4.is_deleted = "N"
  72. AND t1.concept_id = t4.id
  73. AND t1. STATUS = 1
  74. AND t4. STATUS = 1
  75. AND t1.has_sub_cond = 0
  76. UNION ALL
  77. SELECT
  78. t4.lib_name AS libName,
  79. t4.lib_type AS libType,
  80. t1.rule_type AS ruleType,
  81. t1.msg AS msg,
  82. t1.has_sub_cond AS hasSubCond,
  83. CONCAT_WS("-", t1.id, t2.group_type) AS ruleGroup,
  84. t5.lib_name AS baseLibName,
  85. t5.lib_type AS baseLibType,
  86. t3.type AS baseType,
  87. t3.min_operator AS baseMinOperator,
  88. t3.min_value AS baseMinValue,
  89. t3.min_unit AS baseMinUnit,
  90. t3.max_operator AS baseMaxOperator,
  91. t3.max_value AS baseMaxValue,
  92. t3.max_unit AS baseMaxUnit,
  93. t3.eq_operator AS baseEqOperator,
  94. t3.eq_value AS baseEqValue,
  95. t3.eq_unit AS baseEqUnit
  96. FROM
  97. kl_rule t1,
  98. kl_rule_condition t2,
  99. kl_rule_base t3,
  100. kl_concept t4,
  101. kl_concept t5
  102. WHERE
  103. t1.is_deleted = "N"
  104. AND t2.is_deleted = "N"
  105. AND t3.is_deleted = "N"
  106. AND t4.is_deleted = "N"
  107. AND t5.is_deleted = "N"
  108. AND t1. STATUS = 1
  109. AND t3. STATUS = 1
  110. AND t4. STATUS = 1
  111. AND t5. STATUS = 1
  112. AND t1.id = t2.rule_id
  113. AND t2.rule_base_id = t3.id
  114. AND t1.concept_id = t4.id
  115. AND t3.concept_id = t5.id
  116. AND t1.has_sub_cond = 1
  117. ) t10
  118. ORDER BY
  119. t10.libType,
  120. t10.libName,
  121. t10.ruleType,
  122. t10.ruleGroup
  123. </select>
  124. <select id="getKlRuleInfoPage" resultType="com.diagbot.dto.KlRuleInfoDTO">
  125. SELECT
  126. ru.id as parId,
  127. ru.description as parDescription,
  128. ru.rule_type as parRuleType,
  129. ru.concept_id as parConceptId,
  130. co.lib_name as parConceptName,
  131. le.name as parLibTypeName,
  132. ru.has_sub_cond as parHasSub,
  133. ru.msg as parMsg,
  134. ru.status as parStatus,
  135. ru.gmt_modified as gmtModified,
  136. ru.modifier as modifier
  137. FROM
  138. kl_rule ru,
  139. kl_concept co,
  140. kl_lexicon le
  141. WHERE ru.is_deleted = 'N'
  142. AND co.is_deleted = 'N'
  143. AND le.is_deleted = 'N'
  144. AND ru.concept_id = co.`id`
  145. AND co.lib_type = le.`code`
  146. <if test="parDescription!=null and parDescription!=''">
  147. AND UPPER(ru.description) LIKE CONCAT('%', UPPER(trim(#{parDescription})), '%')
  148. </if>
  149. <if test="parRuleType !=null">
  150. AND ru.rule_type = #{parRuleType}
  151. </if>
  152. <if test="parConceptName!=null and parConceptName!=''">
  153. AND UPPER(co.lib_name) LIKE CONCAT('%', UPPER(trim(#{parConceptName})), '%')
  154. </if>
  155. <if test="parStatus!=null">
  156. AND ru.status = #{parStatus}
  157. </if>
  158. ORDER BY ru.status DESC ,ru.gmt_modified DESC,ru.id DESC
  159. </select>
  160. <select id="getByIdRuleInfo" resultType="com.diagbot.dto.KlRuleByIdDTO">
  161. SELECT
  162. par.*,
  163. CASE
  164. WHEN ISNULL(ruco.rule_id)
  165. THEN par.parId
  166. ELSE ruco.rule_id
  167. END AS ruleId,
  168. sub.*,
  169. ruco.msg AS subMsg,
  170. ruco.group_type AS groupType
  171. FROM
  172. (SELECT
  173. a.id AS parId,
  174. a.description AS parDescription,
  175. a.rule_type AS parRuleType,
  176. a.concept_id AS parconceptId,
  177. b.lib_name AS parlibName,
  178. a.has_sub_cond AS parHasSub,
  179. a.msg AS parMsg,
  180. a.status AS parStatus,
  181. c.name AS parLenName,
  182. c.code AS parLenCode
  183. FROM
  184. kl_rule a,
  185. kl_concept b,
  186. kl_lexicon c
  187. WHERE a.is_deleted = 'N'
  188. AND b.is_deleted = 'N'
  189. AND c.is_deleted = 'N'
  190. AND a.concept_id = b.id
  191. <if test="id != null">
  192. and a.id = #{id}
  193. </if>
  194. AND b.lib_type = c.code) par
  195. LEFT JOIN kl_rule_condition ruco
  196. ON par.parId = ruco.rule_id
  197. LEFT JOIN
  198. (SELECT
  199. c.id AS subId,
  200. c.description AS subDescription,
  201. c.concept_id AS subConceptId,
  202. d.lib_name AS subLibName,
  203. f.name AS subLenName,
  204. f.code AS subLenCode,
  205. c.type AS subType,
  206. c.min_operator AS subMinOperator,
  207. c.min_value AS subMinValue,
  208. c.min_unit AS subMinUnit,
  209. c.max_operator AS subMaxOperator,
  210. c.max_value AS subMaxValue,
  211. c.max_unit AS subMaxUnit,
  212. c.eq_operator AS subEqOperator,
  213. c.eq_value AS subEqValue,
  214. c.eq_unit AS subEqUnit
  215. FROM
  216. kl_rule_base c,
  217. kl_concept d,
  218. kl_lexicon f
  219. WHERE c.is_deleted = 'N'
  220. AND d.is_deleted = 'N'
  221. AND f.is_deleted = 'N'
  222. AND c.concept_id = d.id
  223. AND d.lib_type = f.code) sub
  224. ON sub.subId = ruco.rule_base_id
  225. </select>
  226. <select id="exportIndication" resultType="com.diagbot.dto.IndicationExportDTO">
  227. SELECT
  228. tt1.par_name,
  229. tt1.par_type,
  230. tt2.lib_name base_name,
  231. xx2.NAME base_type,
  232. CASE
  233. when tt1.type = '1' then '等于术语'
  234. when tt1.type = '2' then '比较'
  235. when tt1.type = '3' then '不等于术语'
  236. when tt1.type = '4' then '过敏'
  237. when tt1.type = '5' then '开单项互斥'
  238. when tt1.type = '6' then '正则'
  239. else '错误类型'
  240. end taboo_type,
  241. tt1.eq_value,
  242. tt1.min_value,
  243. tt1.min_operator,
  244. tt1.min_unit,
  245. tt1.max_value,
  246. tt1.max_operator,
  247. tt1.max_unit,
  248. tt1.description,
  249. tt1.msg,
  250. tt1.rule_id,
  251. tt1.cond_id
  252. FROM
  253. (
  254. SELECT
  255. c1.lib_name par_name,
  256. c1.id par_id,
  257. x1.`name` par_type,
  258. t1.id rule_id,
  259. t1.description,
  260. t1.rule_type,
  261. t1.has_sub_cond,
  262. t2.id cond_id,
  263. t2.msg,
  264. t3.type,
  265. t3.concept_id base_id,
  266. t3.eq_value,
  267. t3.min_value,
  268. t3.min_operator,
  269. t3.min_unit,
  270. t3.max_value,
  271. t3.max_operator,
  272. t3.max_unit
  273. FROM
  274. kl_concept c1,
  275. kl_lexicon x1,
  276. kl_rule t1,
  277. kl_rule_condition t2,
  278. kl_rule_base t3
  279. WHERE
  280. c1.is_deleted = 'N'
  281. AND t1.is_deleted = 'N'
  282. AND t2.is_deleted = 'N'
  283. AND t3.is_deleted = 'N'
  284. AND c1.`status` = 1
  285. AND t1.`status` = 1
  286. AND c1.id = t1.concept_id
  287. AND t1.id = t2.rule_id
  288. AND t2.rule_base_id = t3.id
  289. AND t1.rule_type = 1
  290. AND x1.`code` = c1.lib_type
  291. ) tt1
  292. LEFT JOIN kl_concept tt2 ON tt2.is_deleted = 'N'
  293. AND tt2.`status` = 1
  294. AND tt1.base_id = tt2.id
  295. LEFT JOIN kl_lexicon xx2 ON tt2.lib_type = xx2.CODE
  296. ORDER BY par_name, rule_id
  297. </select>
  298. <select id="exportOther" resultType="com.diagbot.dto.DefaultExportDTO">
  299. SELECT
  300. a.id rule_id,
  301. a.concept_id,
  302. f.lib_type,
  303. f.lib_name,
  304. g.name lib_type_cn,
  305. a.description rule_group,
  306. a.rule_type,
  307. a.has_sub_cond,
  308. b.group_type,
  309. b.msg,
  310. c.concept_id base_concept,
  311. d.lib_name baseName,
  312. d.lib_type baseType,
  313. e. NAME baseTypeCn,
  314. CASE
  315. WHEN c.type = '1' THEN
  316. '等于术语'
  317. WHEN c.type = '2' THEN
  318. '比较'
  319. WHEN c.type = '3' THEN
  320. '不等于术语'
  321. WHEN c.type = '4' THEN
  322. '过敏'
  323. WHEN c.type = '5' THEN
  324. '开单项互斥'
  325. WHEN c.type = '6' THEN
  326. '正则'
  327. ELSE
  328. '错误类型'
  329. END taboo_type,
  330. c.min_operator,
  331. c.min_value,
  332. c.max_operator,
  333. c.max_value,
  334. c.eq_value
  335. FROM
  336. kl_rule a,
  337. kl_rule_condition b,
  338. kl_rule_base c,
  339. kl_concept d,
  340. kl_lexicon e,
  341. kl_concept f,
  342. kl_lexicon g
  343. WHERE
  344. a.is_deleted = 'N'
  345. AND b.is_deleted = 'N'
  346. AND c.is_deleted = 'N'
  347. AND d.is_deleted = 'N'
  348. AND e.is_deleted = 'N'
  349. AND f.is_deleted = 'N'
  350. AND g.is_deleted = 'N'
  351. AND a.`status` = 1
  352. AND d.`status` = 1
  353. AND f.`status` = 1
  354. AND a.id = b.rule_id
  355. AND b.rule_base_id = c.id
  356. AND c.concept_id = d.id
  357. AND d.lib_type = e.`code`
  358. AND a.concept_id = f.id
  359. AND f.lib_type = g.`code`
  360. <if test="ruleType != null">
  361. AND a.rule_type = #{ruleType}
  362. </if>
  363. <if test="libTypeList != null and libTypeList.size() > 0">
  364. and f.lib_type in
  365. <foreach collection="libTypeList" item="item" separator="," open="(" close=")">
  366. #{item}
  367. </foreach>
  368. </if>
  369. ORDER BY
  370. a.gmt_modified DESC, b.id,c.id asc
  371. </select>
  372. <select id="getRuleInitDTO" resultType="com.diagbot.dto.RuleInitDTO">
  373. SELECT
  374. *
  375. FROM
  376. (
  377. SELECT
  378. t1.concept_id AS conceptId,
  379. CONCAT_WS(
  380. "_",
  381. t1.concept_id,
  382. t1.rule_type
  383. ) AS conceptGroup,
  384. t1.id AS ruleId,
  385. t4.lib_name AS libName,
  386. t4.lib_type AS libType,
  387. t1.rule_type AS ruleType,
  388. t1.has_sub_cond AS hasSubCond,
  389. t1.msg AS msg,
  390. t1.gmt_modified AS gmtModified
  391. FROM
  392. kl_rule t1,
  393. kl_concept t4
  394. WHERE
  395. t1.is_deleted = "N"
  396. AND t4.is_deleted = "N"
  397. AND t1.concept_id = t4.id
  398. AND t1. STATUS = 1
  399. AND t4. STATUS = 1
  400. AND t4.lib_type BETWEEN 100 AND 299
  401. UNION
  402. SELECT
  403. t11.id AS conceptId,
  404. CONCAT_WS("_", t11.id, t1.rule_type) AS conceptGroup,
  405. t1.id AS ruleId,
  406. t11.lib_name AS libName,
  407. t11.lib_type AS libType,
  408. t1.rule_type AS ruleType,
  409. t1.has_sub_cond AS hasSubCond,
  410. t1.msg AS msg,
  411. t1.gmt_modified AS gmtModified
  412. FROM
  413. kl_rule t1,
  414. kl_concept t4,
  415. kl_relation t10,
  416. kl_concept t11
  417. WHERE
  418. t1.is_deleted = "N"
  419. AND t4.is_deleted = "N"
  420. AND t1.concept_id = t4.id
  421. AND t1. STATUS = 1
  422. AND t4. STATUS = 1
  423. AND t4.lib_type BETWEEN 300 AND 399
  424. AND t10.start_id = t4.id
  425. AND t10.relation_id = 600
  426. AND t10.end_id = t11.id
  427. AND t11.lib_type BETWEEN 100 AND 299
  428. AND t10.is_deleted = "N"
  429. AND t11.is_deleted = "N"
  430. AND t10. STATUS = 1
  431. AND t11. STATUS = 1
  432. ) t12
  433. ORDER BY
  434. t12.conceptId,
  435. t12.ruleType,
  436. t12.hasSubCond,
  437. t12.gmtModified DESC,
  438. t12.ruleId DESC
  439. </select>
  440. <select id="getRuleConditionInitDTO" resultType="com.diagbot.dto.RuleConditionInitDTO">
  441. SELECT
  442. t2.rule_id AS ruleId,
  443. CONCAT_WS("-", t2.rule_id, t2.group_type) AS ruleGroup,
  444. t2.rule_base_id as ruleBaseId,
  445. t2.msg as msg
  446. FROM
  447. kl_rule_condition t2
  448. WHERE
  449. t2.is_deleted = "N"
  450. ORDER BY
  451. t2.id DESC
  452. </select>
  453. <select id="getRuleBaseInitDTO" resultType="com.diagbot.dto.RuleBaseInitDTO">
  454. SELECT
  455. t3.id as ruleBaseId,
  456. t5.lib_name AS baseLibName,
  457. t5.lib_type AS baseLibType,
  458. t3.type AS baseType,
  459. t3.min_operator AS baseMinOperator,
  460. t3.min_value AS baseMinValue,
  461. t3.min_unit AS baseMinUnit,
  462. t3.max_operator AS baseMaxOperator,
  463. t3.max_value AS baseMaxValue,
  464. t3.max_unit AS baseMaxUnit,
  465. t3.eq_operator AS baseEqOperator,
  466. t3.eq_value AS baseEqValue,
  467. t3.eq_unit AS baseEqUnit
  468. FROM
  469. kl_rule_base t3,
  470. kl_concept t5
  471. WHERE
  472. t3.is_deleted = "N"
  473. AND t5.is_deleted = "N"
  474. AND t3. STATUS = 1
  475. AND t5. STATUS = 1
  476. AND t3.concept_id = t5.id
  477. </select>
  478. <select id="getRuleInitDTONotHaveClass" resultType="com.diagbot.dto.RuleInitDTO">
  479. SELECT
  480. CONCAT_WS("_",t1.concept_id,t1.rule_type) AS conceptGroup,
  481. t1.id AS ruleId,
  482. t4.lib_name AS libName,
  483. t4.lib_type AS libType,
  484. t1.rule_type AS ruleType,
  485. t1.msg AS msg,
  486. t1.has_sub_cond AS hasSubCond
  487. FROM
  488. kl_rule t1,
  489. kl_concept t4
  490. WHERE
  491. t1.is_deleted = "N"
  492. AND t4.is_deleted = "N"
  493. AND t1.concept_id = t4.id
  494. AND t1. STATUS = 1
  495. AND t4. STATUS = 1
  496. AND t4.lib_type BETWEEN 100 AND 299
  497. </select>
  498. <select id="getRuleInitDTOHaveClass" resultType="com.diagbot.dto.RuleInitDTO">
  499. SELECT
  500. CONCAT_WS("_", t11.id, t1.rule_type) AS conceptGroup,
  501. t1.id AS ruleId,
  502. t11.lib_name AS libName,
  503. t11.lib_type AS libType,
  504. t1.rule_type AS ruleType,
  505. t1.msg AS msg,
  506. t1.has_sub_cond AS hasSubCond
  507. FROM
  508. kl_rule t1,
  509. kl_concept t4,
  510. kl_relation t10,
  511. kl_concept t11
  512. WHERE
  513. t1.is_deleted = "N"
  514. AND t4.is_deleted = "N"
  515. AND t1.concept_id = t4.id
  516. AND t1. STATUS = 1
  517. AND t4. STATUS = 1
  518. AND t4.lib_type BETWEEN 300 AND 399
  519. AND t10.start_id = t4.id
  520. AND t10.relation_id = 600
  521. AND t10.end_id = t11.id
  522. AND t11.lib_type BETWEEN 100 AND 299
  523. AND t10.is_deleted = "N"
  524. AND t11.is_deleted = "N"
  525. AND t10. STATUS = 1
  526. AND t11. STATUS = 1
  527. </select>
  528. <select id="getRuleBaseInitDTONotHaveClass" resultType="com.diagbot.dto.RuleBaseInitDTO">
  529. SELECT
  530. t3.id AS ruleBaseId,
  531. t5.lib_name AS baseLibName,
  532. t5.lib_type AS baseLibType,
  533. t3.type AS baseType,
  534. t3.min_operator AS baseMinOperator,
  535. t3.min_value AS baseMinValue,
  536. t3.min_unit AS baseMinUnit,
  537. t3.max_operator AS baseMaxOperator,
  538. t3.max_value AS baseMaxValue,
  539. t3.max_unit AS baseMaxUnit,
  540. t3.eq_operator AS baseEqOperator,
  541. t3.eq_value AS baseEqValue,
  542. t3.eq_unit AS baseEqUnit
  543. FROM
  544. kl_rule_base t3,
  545. kl_concept t5
  546. WHERE
  547. t3.is_deleted = "N"
  548. AND t5.is_deleted = "N"
  549. AND t3. STATUS = 1
  550. AND t5. STATUS = 1
  551. AND t3.concept_id = t5.id
  552. AND (t5.lib_type BETWEEN 100 AND 299
  553. OR t5.lib_type= 410)
  554. ORDER BY t5.id
  555. </select>
  556. <select id="getRuleBaseInitDTOHaveClass" resultType="com.diagbot.dto.RuleBaseInitDTO">
  557. SELECT
  558. t3.id AS ruleBaseId,
  559. t11.lib_name AS baseLibName,
  560. t11.lib_type AS baseLibType,
  561. t3.type AS baseType,
  562. t3.min_operator AS baseMinOperator,
  563. t3.min_value AS baseMinValue,
  564. t3.min_unit AS baseMinUnit,
  565. t3.max_operator AS baseMaxOperator,
  566. t3.max_value AS baseMaxValue,
  567. t3.max_unit AS baseMaxUnit,
  568. t3.eq_operator AS baseEqOperator,
  569. t3.eq_value AS baseEqValue,
  570. t3.eq_unit AS baseEqUnit
  571. FROM
  572. kl_rule_base t3,
  573. kl_concept t5,
  574. kl_relation t10,
  575. kl_concept t11
  576. WHERE
  577. t3.is_deleted = "N"
  578. AND t5.is_deleted = "N"
  579. AND t3. STATUS = 1
  580. AND t5. STATUS = 1
  581. AND t3.concept_id = t5.id
  582. AND t5.lib_type BETWEEN 300 AND 399
  583. AND t10.start_id = t5.id
  584. AND t10.relation_id = 600
  585. AND t10.end_id = t11.id
  586. AND (t11.lib_type BETWEEN 100 AND 299
  587. OR t11.lib_type = 410)
  588. AND t10.is_deleted = "N"
  589. AND t11.is_deleted = "N"
  590. AND t10. STATUS = 1
  591. AND t11. STATUS = 1
  592. ORDER BY t11.id
  593. </select>
  594. </mapper>