|
@@ -4,18 +4,150 @@
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.diagbot.entity.KlLibraryInfo">
|
|
|
- <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="name" property="name" />
|
|
|
- <result column="concept_id" property="conceptId" />
|
|
|
- <result column="is_concept" property="isConcept" />
|
|
|
- <result column="type_id" property="typeId" />
|
|
|
- <result column="spell" property="spell" />
|
|
|
- <result column="remark" property="remark" />
|
|
|
+ <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="name" property="name"/>
|
|
|
+ <result column="concept_id" property="conceptId"/>
|
|
|
+ <result column="is_concept" property="isConcept"/>
|
|
|
+ <result column="type_id" property="typeId"/>
|
|
|
+ <result column="spell" property="spell"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
</resultMap>
|
|
|
-
|
|
|
+ <select id="getConcept" resultType="com.diagbot.dto.TermConceptDTO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ t.id as id,
|
|
|
+ t.name ,
|
|
|
+ t.isConcept as source
|
|
|
+ <if test="type!=null and type==100">,
|
|
|
+ t.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==127">,
|
|
|
+ t.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==128">,
|
|
|
+ t.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==106">,
|
|
|
+ t.code as code
|
|
|
+ </if>
|
|
|
+ FROM
|
|
|
+ (SELECT DISTINCT
|
|
|
+ a.concept_id as id,
|
|
|
+ a.name,
|
|
|
+ a.is_concept as isConcept
|
|
|
+ <if test="type!=null and type==100">,
|
|
|
+ b.icd10_code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==127">,
|
|
|
+ b.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==128">,
|
|
|
+ b.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==106">,
|
|
|
+ b.operation_code as code
|
|
|
+ </if>
|
|
|
+ FROM
|
|
|
+ kl_library_info a
|
|
|
+ <if test="type!=null and type==100">
|
|
|
+ left join kl_disease b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ and a.concept_id = b.concept_id
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==127">
|
|
|
+ JOIN kl_tcm_disease b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ and a.concept_id = b.concept_id
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==128">
|
|
|
+ JOIN kl_tcm_syndrome b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ and a.concept_id = b.concept_id
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==106">
|
|
|
+ JOIN kl_operation b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ and a.concept_id = b.concept_id
|
|
|
+ </if>
|
|
|
+ WHERE a.is_deleted = "N"
|
|
|
+ <if test="type!=null">
|
|
|
+ AND a.type_id = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="inputStr!=null and inputStr!=''">
|
|
|
+ AND a.name = #{inputStr}
|
|
|
+ </if>
|
|
|
+ ) t
|
|
|
+ </select>
|
|
|
+ <select id="getConceptList" resultType="com.diagbot.dto.TermConceptDTO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ t.id as id,
|
|
|
+ t.name ,
|
|
|
+ t.isConcept as source
|
|
|
+ <if test="type!=null and type==100">,
|
|
|
+ t.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==127">,
|
|
|
+ t.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==128">,
|
|
|
+ t.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==106">,
|
|
|
+ t.code as code
|
|
|
+ </if>
|
|
|
+ FROM
|
|
|
+ (SELECT DISTINCT
|
|
|
+ a.concept_id as id,
|
|
|
+ a.name,
|
|
|
+ a.is_concept as isConcept
|
|
|
+ <if test="type!=null and type==100">,
|
|
|
+ b.icd10_code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==127">,
|
|
|
+ b.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==128">,
|
|
|
+ b.code as code
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==106">,
|
|
|
+ b.operation_code as code
|
|
|
+ </if>
|
|
|
+ FROM
|
|
|
+ kl_library_info a
|
|
|
+ <if test="type!=null and type==100">
|
|
|
+ left join kl_disease b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ and a.concept_id = b.concept_id
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==127">
|
|
|
+ JOIN kl_tcm_disease b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ and a.concept_id = b.concept_id
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==128">
|
|
|
+ JOIN kl_tcm_syndrome b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ and a.concept_id = b.concept_id
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==106">
|
|
|
+ JOIN kl_operation b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ and a.concept_id = b.concept_id
|
|
|
+ </if>
|
|
|
+ WHERE a.is_deleted = "N"
|
|
|
+ <if test="type!=null">
|
|
|
+ AND a.type_id = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="placeToList != null and placeToList.size > 0">
|
|
|
+ and a.name in
|
|
|
+ <foreach item="name" collection="placeToList" open="(" separator="," close=")">
|
|
|
+ #{name}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ) t
|
|
|
+ </select>
|
|
|
</mapper>
|