123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?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.ConceptDetailMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.ConceptDetail">
- <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="title" property="title" />
- <result column="content" property="content" />
- <result column="text" property="text" />
- <result column="order_no" property="orderNo" />
- <result column="position" property="position" />
- <result column="is_reason" property="isReason" />
- </resultMap>
- <select id="getConceptDetailList" resultType="com.diagbot.dto.GetConceptDetailListDTO">
- SELECT a.concept_id concept_id, b.lib_name,b.lib_type as typeId, group_concat(title) title, a.is_deleted, a.modifier, a.gmt_modified
- FROM kl_concept_detail a ,kl_concept b
- WHERE b.is_deleted='N' and a.concept_id=b.id
- <if test="conceptName!=null and conceptName!=''">
- and b.`lib_name` like concat('%',#{conceptName},'%')
- </if>
- <if test="status!=null and status!=''">
- and a.is_deleted = #{status}
- </if>
- <if test="libType!=null">
- and b.lib_type=#{libType}
- </if>
- group by a.concept_id
- ORDER BY a.is_deleted ASC, a.gmt_modified DESC
- </select>
- <select id="getByParam" resultType="com.diagbot.dto.ConceptDetailDTO">
- SELECT a.*,b.lib_name FROM `kl_concept_detail` a, `kl_concept` b
- where a.is_deleted = 'N' and b.is_deleted = 'N' and b.id = a.concept_id
- and a.concept_id = #{conceptId}
- ORDER BY a.order_no
- </select>
- <select id="index" resultType="com.diagbot.dto.ConceptIndexDTO">
- SELECT
- DISTINCT
- a.id AS conceptId,
- a.lib_name AS name,
- a.lib_type AS typeId
- FROM kl_concept a LEFT JOIN kl_concept_detail b
- ON a.id=b.concept_id
- WHERE a.is_deleted='N' and b.id IS NULL
- <if test="name != null and name != ''">
- AND a.lib_name like concat('%',#{name} ,'%' )
- </if>
- AND a.lib_type not in(12,13,14)
- ORDER BY a.gmt_modified DESC
- </select>
- <select id="conDetailCount" resultType="com.diagbot.dto.BIItemDTO">
- SELECT
- "静态知识" AS moduleName,
- "静态知识总数" AS itemName,
- count(DISTINCT kc.id) AS count
- FROM
- kl_concept kc,
- kl_concept_detail kcd
- WHERE
- kc.is_deleted = 'N'
- AND kcd.is_deleted = 'N'
- AND kc.id = kcd.concept_id
- UNION
- SELECT DISTINCT
- "静态知识" AS moduleName,
- CASE
- WHEN t2.lib_type = 18 THEN '疾病'
- WHEN t2.lib_type = 46 THEN '化验公表项'
- WHEN t2.lib_type = 16 THEN '辅检项目'
- WHEN t2.lib_type = 10 THEN '药品通用名'
- ELSE ''
- END AS itemName,
- COUNT(t2.id) AS count
- FROM
- (SELECT DISTINCT concept_id FROM kl_concept_detail WHERE is_deleted = "N") t1,
- kl_concept t2
- WHERE
- t1.concept_id = t2.id
- AND t2.is_deleted = "N"
- AND t2.lib_type IN (18, 46, 16, 10)
- GROUP BY
- lib_type
- </select>
- </mapper>
|