123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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.KlConceptStaticMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.KlConceptStatic">
- <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="status" property="status" />
- <result column="clinical_pathway_name" property="clinicalPathwayName" />
- <result column="notice_name" property="noticeName" />
- </resultMap>
- <select id="getStaticInfo" resultType="com.diagbot.entity.KlConceptStatic">
- SELECT
- b.*
- FROM
- kl_concept a,
- kl_concept_static b,
- kl_lexicon c
- WHERE
- a.is_deleted = 'N'
- AND b.is_deleted = 'N'
- AND c.is_deleted = 'N'
- AND a.id = b.concept_id
- AND a.lib_type = c.CODE
- <if test="status!=null and status!=''">
- AND b.`status` = #{status}
- </if>
- <if test="name!=null and name!=''">
- AND a.lib_name = #{name}
- </if>
- <if test="typeName!=null and typeName!=''">
- AND c.NAME = #{typeName}
- </if>
- </select>
- <!-- 分页查询 -->
- <select id="getPage" resultType="com.diagbot.dto.KlConceptStaticDTO">
- SELECT
- t1.id,
- t1.NAME,
- t1.clinicalPathwayName,
- t1.noticeName,
- t1.type,
- t1.status,
- t1.title,
- t1.gmtModified,
- t1.modifier
- FROM
- (
- SELECT
- a.id,
- a.lib_name as NAME ,
- b.clinical_pathway_name AS clinicalPathwayName,
- b.notice_name AS noticeName,
- a.lib_type as type,
- b.status,
- GROUP_CONCAT( c.title order by c.order_no asc SEPARATOR '、' ) AS title,
- b.gmt_modified AS gmtModified,
- b.modifier
- FROM
- kl_concept a,
- kl_concept_static b,
- kl_concept_detail c
- WHERE
- a.id = b.concept_id
- and a.id = c.concept_id
- and a.is_deleted = 'N'
- and b.is_deleted = 'N'
- and c.is_deleted = 'N'
- <if test="klConceptStaticPageVO.status!=null ">
- AND b.status = #{klConceptStaticPageVO.status}
- </if>
- <if test="klConceptStaticPageVO.name!=null and klConceptStaticPageVO.name!=''">
- AND a.lib_name like concat('%', #{klConceptStaticPageVO.name},'%')
- </if>
- <if test="klConceptStaticPageVO.type!=null and klConceptStaticPageVO.type!=''">
- AND a.lib_type = #{klConceptStaticPageVO.type}
- </if>
- GROUP BY
- a.id
- ) t1
- ORDER BY
- t1.status DESC,
- t1.gmtModified DESC
- </select>
- </mapper>
|