1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?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.IndexConfigMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.IndexConfig">
- <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="disease_id" property="diseaseId" />
- <result column="index_desc" property="indexDesc" />
- <result column="order_no" property="orderNo" />
- <result column="remark" property="remark" />
- </resultMap>
- <select id="queryIndexConfigPageAlls" resultType="com.diagbot.dto.IndexConfigDTO">
- SELECT DISTINCT
- a.is_deleted AS state,
- a.gmt_create as gmtCreate,
- a.gmt_modified as gmtModified,
- a.creator as creator,
- a.modifier as modifier,
- a.disease_id as diseaseId,
- b.lib_name as diseaseName
- FROM kl_index_config a
- JOIN kl_concept b
- WHERE b.is_deleted = 'N'
- and a.disease_id = b.id
- <if test="indexConfigVO.diseaseName != null">
- AND UPPER(b.lib_name) LIKE CONCAT('%', UPPER(trim(#{indexConfigVO.diseaseName})), '%')
- </if>
- GROUP BY a.disease_id
- ORDER BY state ASC,gmtModified DESC
- </select>
- <select id="queryIndexConfigDiseaseName" resultType="com.diagbot.dto.DiseaseInfoDTO">
- SELECT DISTINCT
- a.diseaseId AS diseaseId,
- a.diseaseName AS diseaseName
- FROM
- (SELECT
- t1.id AS diseaseId,
- t1.lib_name AS diseaseName
- FROM
- `kl_concept` t1,
- `kl_relation` t2,
- `kl_concept` t3
- WHERE
- t1.is_deleted = 'N'
- AND t2.is_deleted = 'N'
- AND t3.is_deleted = 'N'
- AND t1.id = t2.start_id
- AND t3.id = t2.end_id
- AND t1.lib_type = 18
- AND t2.relation_id = 3
- AND t3.lib_type = 51
- AND t3.lib_name = #{diseaseNameVO.libName}) a
- LEFT JOIN kl_index_config b
- ON a.diseaseId = b.disease_id
- WHERE b.disease_id IS NULL
- <if test="diseaseNameVO.diseaseName != null and diseaseNameVO.diseaseName != ''">
- AND UPPER(a.diseaseName) LIKE CONCAT('%', UPPER(trim(#{diseaseNameVO.diseaseName})), '%')
- </if>
- ORDER BY a.diseaseName DESC
- </select>
- </mapper>
|