KlDiseaseMapper.xml 4.9 KB

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