KlDiseaseMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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.KlDiseaseMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.diagbot.entity.KlDisease">
  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="concept_id" property="conceptId" />
  13. <result column="dept_id" property="deptId" />
  14. <result column="icd10_code" property="icd10Code" />
  15. <result column="guoname" property="guoname" />
  16. <result column="guocode" property="guocode" />
  17. <result column="guospell" property="guospell" />
  18. <result column="course" property="course" />
  19. <result column="inducement" property="inducement" />
  20. <result column="food_prohibition" property="foodProhibition" />
  21. <result column="hazard" property="hazard" />
  22. <result column="healing" property="healing" />
  23. <result column="pernicious" property="pernicious" />
  24. <result column="clinic_type" property="clinicType" />
  25. <result column="vul_area" property="vulArea" />
  26. <result column="vul_crowd" property="vulCrowd" />
  27. <result column="incidence" property="incidence" />
  28. <result column="is_infect" property="isInfect" />
  29. <result column="complication" property="complication" />
  30. <result column="pathogeny" property="pathogeny" />
  31. <result column="dis_type" property="disType" />
  32. <result column="ch_western" property="chWestern" />
  33. <result column="is_common_dis" property="isCommonDis" />
  34. <result column="is_heredity" property="isHeredity" />
  35. <result column="name_simple" property="nameSimple" />
  36. <result column="en_name_simple" property="enNameSimple" />
  37. <result column="en_name" property="enName" />
  38. <result column="morphology" property="morphology" />
  39. <result column="tumor_cell_type" property="tumorCellType" />
  40. <result column="remark" property="remark" />
  41. </resultMap>
  42. <select id="getDiseasePage" resultType="com.diagbot.dto.DiseasePageDTO">
  43. SELECT
  44. a.id,
  45. b.lib_name as disName,
  46. a.modifier,
  47. a.gmt_modified as gmtModified
  48. FROM
  49. `kl_relation` a,
  50. kl_concept b
  51. WHERE
  52. a.is_deleted = 'N'
  53. AND b.is_deleted = 'N'
  54. <if test="disName != null and disName != ''">
  55. AND UPPER(b.lib_name) LIKE concat('%',UPPER(trim(#{disName})) ,'%' )
  56. </if>
  57. AND a.`status` = 1
  58. AND b.`status` = 1
  59. AND a.start_id = b.id
  60. AND b.lib_type=100
  61. AND a.relation_id IN (
  62. 501,
  63. 502,
  64. 503,
  65. 504,
  66. 505,
  67. 506,
  68. 507,
  69. 508,
  70. 509,
  71. 510
  72. )
  73. GROUP BY b.lib_name
  74. ORDER BY
  75. a.gmt_modified DESC
  76. </select>
  77. <select id="getDiseaseAll" resultType="com.diagbot.dto.DiseasePageDTO">
  78. SELECT
  79. a.id,
  80. b.lib_name as disName,
  81. a.modifier,
  82. a.gmt_modified as gmtModified
  83. FROM
  84. `kl_relation` a,
  85. kl_concept b
  86. WHERE
  87. a.is_deleted = 'N'
  88. AND b.is_deleted = 'N'
  89. AND a.`status` = 1
  90. AND b.`status` = 1
  91. AND a.start_id = b.id
  92. <if test="disName != null and disName != ''">
  93. AND UPPER(b.lib_name) LIKE concat('%',UPPER(trim(#{disName})) ,'%' )
  94. </if>
  95. AND b.lib_type=100
  96. AND a.relation_id IN (
  97. 501,
  98. 502,
  99. 503,
  100. 504,
  101. 505,
  102. 506,
  103. 507,
  104. 508,
  105. 509,
  106. 510
  107. )
  108. GROUP BY b.lib_name
  109. ORDER BY
  110. b.gmt_modified DESC
  111. </select>
  112. <select id="getDiseaseAllDetaill" resultType="com.diagbot.dto.DiseaseAllDetailDTO">
  113. SELECT
  114. t1.sid,
  115. t1.disName,
  116. t1.rid,
  117. t1.rname,
  118. t1.eid,
  119. t1.itemName,
  120. t2.drug_c
  121. FROM(
  122. SELECT
  123. kr.start_id as sid,
  124. klc1.lib_name as disName,
  125. kr.relation_id as rid,
  126. klex.name as rname,
  127. kr.end_id as eid,
  128. kro.order_no as order_no,
  129. klc2.lib_name as itemName
  130. FROM
  131. kl_relation kr,
  132. kl_relation_order kro,
  133. kl_concept klc1,
  134. kl_concept klc2,
  135. kl_lexicon_relationship klex
  136. WHERE
  137. kr.id = kro.t_relation_id
  138. AND klc1.id = kr.start_id
  139. AND klc2.id = kr.end_id
  140. AND kr.relation_id = klex. CODE
  141. <if test="disName != null and disName !=''">
  142. AND klc1.lib_name = #{disName}
  143. </if>
  144. <!--<if test="types!=null and types.size() > 0">
  145. AND kr.relation_id IN
  146. <foreach collection="types" item="item" index="index" open="(" separator="," close=")">
  147. #{item}
  148. </foreach>
  149. </if>-->
  150. AND kr.relation_id IN (501,502,503,504,505,506,507,508,509,510,516,517,518,519,520)
  151. )t1
  152. LEFT JOIN kl_drug t2 ON t1.eid = t2.concept_id
  153. ORDER BY
  154. rid,t1.order_no
  155. </select>
  156. </mapper>