12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?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="index_unique" property="indexUnique" />
- <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
- a.id as id,
- a.gmt_create as gmtCreate,
- a.gmt_modified as gmtModified,
- a.creator as creator,
- a.modifier as modifier,
- a.disease_id as diseaseId ,
- b.tag_name as diseaseName
- FROM
- icss_index_config a
- JOIN icss_question_info b
- WHERE a.disease_id = b.id
- AND a.is_deleted = "N"
- AND b.is_deleted = "N"
- <if test="indexConfigVO.diseaseName != null and indexConfigVO.diseaseName != ''">
- AND b.tag_name LIKE CONCAT('%', #{indexConfigVO.diseaseName}, '%')
- </if>
- GROUP BY a.disease_id
- ORDER BY a.gmt_create DESC
- </select>
- <select id="queryIndexConfigDiseaseName" resultType="com.diagbot.dto.DiseaseInfoDTO">
- SELECT DISTINCT
- a.dis_id AS diseaseId,
- b.tag_name AS diseaseName
- FROM
- icss_dis_type a
- JOIN icss_question_info b
- ON a.dis_id = b.id
- LEFT JOIN icss_index_config f ON a.dis_id = f.disease_id and f.is_deleted = 'N'
- WHERE a.type = 1
- AND f.disease_id is null
- AND a.is_deleted = "N"
- AND b.is_deleted = "N"
- <if test="diseaseNameVO.diseaseName != null and diseaseNameVO.diseaseName != ''">
- AND b.tag_name LIKE CONCAT('%', #{diseaseNameVO.diseaseName}, '%')
- </if>
- ORDER BY b.tag_name DESC
- </select>
- </mapper>
|