12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?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.ScaleConfigMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.ScaleConfig">
- <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="hospital_id" property="hospitalId" />
- <result column="his_name" property="hisName" />
- <result column="unique_name" property="uniqueName" />
- <result column="unique_code" property="uniqueCode" />
- </resultMap>
- <!-- 分页查询 -->
- <select id="getPage" resultType="com.diagbot.entity.ScaleConfig">
- select a.*
- from tran_scale_config a
- where a.is_deleted='N'
- <if test="scaleConfigPageVO.hospitalId!=null">
- and a.hospital_id=#{scaleConfigPageVO.hospitalId}
- </if>
- <if test="scaleConfigPageVO.hisName!=null and scaleConfigPageVO.hisName!=''">
- and a.his_name like concat("%",#{scaleConfigPageVO.hisName},"%")
- </if>
- <if test="scaleConfigPageVO.uniqueName!=null and scaleConfigPageVO.uniqueName!=''">
- and a.unique_name like concat("%",#{scaleConfigPageVO.uniqueName},"%")
- </if>
- <if test="scaleConfigPageVO.uniqueCode!=null and scaleConfigPageVO.uniqueCode!=''">
- and a.unique_code like concat("%",#{scaleConfigPageVO.uniqueCode},"%")
- </if>
- order by a.gmt_modified desc
- </select>
- <!-- 各医院映射关系数列表 -->
- <select id="getRelationNumPage" resultType="com.diagbot.dto.HosRelationNumDTO">
- SELECT
- a.id,
- a.NAME,
- sum( b.id IS NOT NULL ) AS num
- FROM
- tran_hospital_info a
- LEFT JOIN tran_scale_config b ON a.id = b.hospital_id
- AND b.is_deleted = 'N'
- WHERE
- a.is_deleted = 'N'
- GROUP BY
- a.id
- </select>
- </mapper>
|