123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.diagbot.mapper.KlDiseaseMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.KlDisease">
- <id column="id" property="id" />
- <result column="is_deleted" property="isDeleted" />
- <result column="gmt_create" property="gmtCreate" />
- <result column="gmt_modified" property="gmtModified" />
- <result column="creator" property="creator" />
- <result column="modifier" property="modifier" />
- <result column="concept_id" property="conceptId" />
- <result column="dept_id" property="deptId" />
- <result column="icd10_code" property="icd10Code" />
- <result column="guoname" property="guoname" />
- <result column="guocode" property="guocode" />
- <result column="guospell" property="guospell" />
- <result column="course" property="course" />
- <result column="inducement" property="inducement" />
- <result column="food_prohibition" property="foodProhibition" />
- <result column="hazard" property="hazard" />
- <result column="healing" property="healing" />
- <result column="pernicious" property="pernicious" />
- <result column="clinic_type" property="clinicType" />
- <result column="vul_area" property="vulArea" />
- <result column="vul_crowd" property="vulCrowd" />
- <result column="incidence" property="incidence" />
- <result column="is_infect" property="isInfect" />
- <result column="complication" property="complication" />
- <result column="pathogeny" property="pathogeny" />
- <result column="dis_type" property="disType" />
- <result column="ch_western" property="chWestern" />
- <result column="is_common_dis" property="isCommonDis" />
- <result column="is_heredity" property="isHeredity" />
- <result column="name_simple" property="nameSimple" />
- <result column="en_name_simple" property="enNameSimple" />
- <result column="en_name" property="enName" />
- <result column="morphology" property="morphology" />
- <result column="tumor_cell_type" property="tumorCellType" />
- <result column="remark" property="remark" />
- </resultMap>
- <select id="getDiseasePage" resultType="com.diagbot.dto.DiseasePageDTO">
- SELECT
- a.id,
- b.lib_name as disName,
- a.modifier,
- a.gmt_modified as gmtModified
- FROM
- `kl_relation` a,
- kl_concept b
- WHERE
- a.is_deleted = 'N'
- AND b.is_deleted = 'N'
- <if test="disName != null and disName != ''">
- AND UPPER(b.lib_name) LIKE concat('%',UPPER(trim(#{disName})) ,'%' )
- </if>
- AND a.`status` = 1
- AND b.`status` = 1
- AND a.start_id = b.id
- AND b.lib_type=100
- AND a.relation_id IN (
- 501,
- 502,
- 503,
- 504,
- 505,
- 506,
- 507,
- 508,
- 509,
- 510
- )
- GROUP BY b.lib_name
- ORDER BY
- a.gmt_modified DESC
- </select>
- <select id="getDiseaseAll" resultType="com.diagbot.dto.DiseasePageDTO">
- SELECT
- a.id,
- b.lib_name as disName,
- a.modifier,
- a.gmt_modified as gmtModified
- FROM
- `kl_relation` a,
- kl_concept b
- WHERE
- a.is_deleted = 'N'
- AND b.is_deleted = 'N'
- AND a.`status` = 1
- AND b.`status` = 1
- AND a.start_id = b.id
- <if test="disName != null and disName != ''">
- AND UPPER(b.lib_name) LIKE concat('%',UPPER(trim(#{disName})) ,'%' )
- </if>
- AND b.lib_type=100
- AND a.relation_id IN (
- 501,
- 502,
- 503,
- 504,
- 505,
- 506,
- 507,
- 508,
- 509,
- 510
- )
- GROUP BY b.lib_name
- ORDER BY
- b.gmt_modified DESC
- </select>
- <select id="getDiseaseAllDetaill" resultType="com.diagbot.dto.DiseaseAllDetailDTO">
- SELECT
- t1.sid,
- t1.disName,
- t1.rid,
- t1.rname,
- t1.eid,
- t1.itemName,
- t2.drug_c
- FROM(
- SELECT
- kr.start_id as sid,
- klc1.lib_name as disName,
- kr.relation_id as rid,
- klex.name as rname,
- kr.end_id as eid,
- kro.order_no as order_no,
- klc2.lib_name as itemName
- FROM
- kl_relation kr,
- kl_relation_order kro,
- kl_concept klc1,
- kl_concept klc2,
- kl_lexicon_relationship klex
- WHERE
- kr.id = kro.t_relation_id
- AND klc1.id = kr.start_id
- AND klc2.id = kr.end_id
- AND kr.relation_id = klex. CODE
- <if test="disName != null and disName !=''">
- AND klc1.lib_name = #{disName}
- </if>
- <!--<if test="types!=null and types.size() > 0">
- AND kr.relation_id IN
- <foreach collection="types" item="item" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>-->
- AND kr.relation_id IN (501,502,503,504,505,506,507,508,509,510,516,517,518,519,520)
- )t1
- LEFT JOIN kl_drug t2 ON t1.eid = t2.concept_id
- ORDER BY
- rid,t1.order_no
- </select>
- </mapper>
|