123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?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.KlRegulationBaseMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.KlRegulationBase">
- <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="description" property="description" />
- <result column="type" property="type" />
- <result column="min_operator" property="minOperator" />
- <result column="min_value" property="minValue" />
- <result column="min_unit" property="minUnit" />
- <result column="max_operator" property="maxOperator" />
- <result column="max_value" property="maxValue" />
- <result column="max_unit" property="maxUnit" />
- <result column="eq_operator" property="eqOperator" />
- <result column="eq_value" property="eqValue" />
- <result column="eq_unit" property="eqUnit" />
- </resultMap>
- <select id="getAllBase" resultType="com.diagbot.dto.BaseRegulationDTO">
- SELECT DISTINCT
- CONCAT_WS(
- "_",
- t1.concept_id,
- t1.type,
- t1.max_operator,
- t1.max_value,
- t1.max_unit,
- t1.min_operator,
- t1.min_value,
- t1.min_unit,
- t1.eq_operator,
- t1.eq_value,
- t1.eq_unit
- ) AS baseKey,
- GROUP_CONCAT(t1.id) AS ids,
- IFNULL(t2.lib_name, "") AS baseLibName,
- IFNULL(t2.lib_type, 0) AS baseLibType,
- t1.concept_id,
- t1.type AS baseType,
- t1.max_operator AS baseMaxOperator,
- t1.max_value AS baseMaxValue,
- t1.max_unit AS baseMaxUnit,
- t1.min_operator AS baseMinOperator,
- t1.min_value AS baseMinValue,
- t1.min_unit AS baseMinUnit,
- t1.eq_operator AS baseEqOperator,
- t1.eq_value AS baseEqValue,
- t1.eq_unit AS baseEqUnit
- FROM
- kl_regulation_base t1
- LEFT JOIN kl_concept t2 ON t1.concept_id = t2.id
- AND t2.is_deleted = "N"
- AND t2.`status` = 1
- WHERE
- t1.is_deleted = "N"
- AND t1.`status` = 1
- GROUP BY
- t1.concept_id,
- t1.type,
- t1.max_operator,
- t1.max_value,
- t1.max_unit,
- t1.min_operator,
- t1.min_value,
- t1.min_unit,
- t1.eq_operator,
- t1.eq_value,
- t1.eq_unit
- </select>
- <select id="getSelectBase" resultType="com.diagbot.dto.BaseRegulationDTO">
- SELECT DISTINCT
- CONCAT_WS(
- "_",
- t1.concept_id,
- t1.type,
- t1.max_operator,
- t1.max_value,
- t1.max_unit,
- t1.min_operator,
- t1.min_value,
- t1.min_unit,
- t1.eq_operator,
- t1.eq_value,
- t1.eq_unit
- ) AS baseKey,
- GROUP_CONCAT(t1.id) AS ids,
- IFNULL(t2.lib_name, "") AS baseLibName,
- IFNULL(t2.lib_type, 0) AS baseLibType,
- t1.concept_id,
- t1.type AS baseType,
- t1.max_operator AS baseMaxOperator,
- t1.max_value AS baseMaxValue,
- t1.max_unit AS baseMaxUnit,
- t1.min_operator AS baseMinOperator,
- t1.min_value AS baseMinValue,
- t1.min_unit AS baseMinUnit,
- t1.eq_operator AS baseEqOperator,
- t1.eq_value AS baseEqValue,
- t1.eq_unit AS baseEqUnit
- FROM
- kl_regulation_base t1
- LEFT JOIN kl_concept t2 ON t1.concept_id = t2.id
- AND t2.is_deleted = "N"
- AND t2.`status` = 1
- WHERE
- t1.is_deleted = "N"
- AND t1.`status` = 1
- AND t1.id in
- (
- SELECT
- b.regulation_base_id
- FROM
- `kl_regulation` a,
- kl_regulation_condition b
- WHERE
- a.id = b.regulation_id
- <if test="list != null and list.size > 0">
- and a.`code` in
- <foreach item="code" collection="list" open="(" separator="," close=")">
- #{code}
- </foreach>
- </if>
- AND a.`status` = 1
- AND b.condition_type = 1
- )
- GROUP BY
- t1.concept_id,
- t1.type,
- t1.max_operator,
- t1.max_value,
- t1.max_unit,
- t1.min_operator,
- t1.min_value,
- t1.min_unit,
- t1.eq_operator,
- t1.eq_value,
- t1.eq_unit
- </select>
- </mapper>
|