KlDiseaseMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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="remark" property="remark" />
  36. </resultMap>
  37. <select id="getDiseasePage" resultType="com.diagbot.dto.DiseasePageDTO">
  38. SELECT
  39. a.id,
  40. b.lib_name as disName,
  41. a.modifier,
  42. a.gmt_modified as gmtModified
  43. FROM
  44. `kl_relation` a,
  45. kl_concept b
  46. WHERE
  47. a.is_deleted = 'N'
  48. AND b.is_deleted = 'N'
  49. <if test="disName != null and disName != ''">
  50. AND UPPER(b.lib_name) LIKE concat('%',UPPER(trim(#{disName})) ,'%' )
  51. </if>
  52. AND a.`status` = 1
  53. AND b.`status` = 1
  54. AND a.start_id = b.id
  55. AND b.lib_type=100
  56. AND a.relation_id IN (
  57. 501,
  58. 502,
  59. 503,
  60. 504,
  61. 505,
  62. 506,
  63. 507,
  64. 508
  65. )
  66. GROUP BY b.lib_name
  67. ORDER BY
  68. a.gmt_modified DESC
  69. </select>
  70. <select id="getDiseaseAll" resultType="com.diagbot.dto.DiseasePageDTO">
  71. SELECT
  72. a.id,
  73. b.lib_name as disName,
  74. a.modifier,
  75. a.gmt_modified as gmtModified
  76. FROM
  77. `kl_relation` a,
  78. kl_concept b
  79. WHERE
  80. a.is_deleted = 'N'
  81. AND b.is_deleted = 'N'
  82. AND a.`status` = 1
  83. AND b.`status` = 1
  84. AND a.start_id = b.id
  85. <if test="disName != null and disName != ''">
  86. AND UPPER(b.lib_name) LIKE concat('%',UPPER(trim(#{disName})) ,'%' )
  87. </if>
  88. AND b.lib_type=100
  89. AND a.relation_id IN (
  90. 501,
  91. 502,
  92. 503,
  93. 504,
  94. 505,
  95. 506,
  96. 507,
  97. 508
  98. )
  99. GROUP BY b.lib_name
  100. ORDER BY
  101. b.gmt_modified DESC
  102. </select>
  103. <select id="getDiseaseAllDetaill" resultType="com.diagbot.dto.DiseaseAllDetailDTO">
  104. SELECT
  105. kr.start_id as sid,
  106. klc1.lib_name as disName,
  107. kr.relation_id as rid,
  108. klex.name as rname,
  109. kr.end_id as eid,
  110. klc2.lib_name as itemName
  111. FROM
  112. kl_relation kr,
  113. kl_relation_order kro,
  114. kl_concept klc1,
  115. kl_concept klc2,
  116. kl_lexicon_relationship klex
  117. WHERE
  118. kr.id = kro.t_relation_id
  119. AND klc1.id = kr.start_id
  120. AND klc2.id = kr.end_id
  121. AND kr.relation_id = klex. CODE
  122. <if test="disName != null and disName !=''">
  123. AND klc1.lib_name = #{disName}
  124. </if>
  125. <!--<if test="types!=null and types.size() > 0">
  126. AND kr.relation_id IN
  127. <foreach collection="types" item="item" index="index" open="(" separator="," close=")">
  128. #{item}
  129. </foreach>
  130. </if>-->
  131. AND kr.relation_id IN (501,502,503,504,505,506,507,508,509,510)
  132. ORDER BY
  133. rid,kro.order_no
  134. </select>
  135. </mapper>