12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?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.DrugConfigMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.DrugConfig">
- <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" />
- <result column="form" property="form" />
- </resultMap>
- <!-- 分页查询 -->
- <select id="getPage" resultType="com.diagbot.entity.DrugConfig">
- select a.*
- from tran_drug_config a
- where a.is_deleted='N'
- <if test="drugConfigPageVO.hospitalId!=null">
- and a.hospital_id=#{drugConfigPageVO.hospitalId}
- </if>
- <if test="drugConfigPageVO.hisName!=null and drugConfigPageVO.hisName!=''">
- and a.his_name like concat("%",#{drugConfigPageVO.hisName},"%")
- </if>
- <if test="drugConfigPageVO.uniqueName!=null and drugConfigPageVO.uniqueName!=''">
- and a.unique_name like concat("%",#{drugConfigPageVO.uniqueName},"%")
- </if>
- <if test="drugConfigPageVO.uniqueCode!=null and drugConfigPageVO.uniqueCode!=''">
- and a.unique_code like concat("%",#{drugConfigPageVO.uniqueCode},"%")
- </if>
- <if test="drugConfigPageVO.form!=null and drugConfigPageVO.form!=''">
- and a.form = #{drugConfigPageVO.form}
- </if>
- order by a.gmt_modified desc
- </select>
- <select id="getMedicinesIndex" resultType="com.diagbot.entity.DrugConfig"
- parameterType="com.diagbot.vo.RetrievalVO">
- SELECT DISTINCT u.his_name
- FROM(
- SELECT
- DISTINCT his_name
- FROM
- `tran_drug_config`
- WHERE
- is_deleted = "N"
- <if test="hospitalId!=null">
- and hospital_id=#{hospitalId}
- </if>
- <if test="inputStr!=null and inputStr!=''">
- and his_name = #{inputStr}
- </if>
- UNION
- SELECT
- DISTINCT his_name
- FROM
- `tran_drug_config`
- WHERE
- is_deleted = "N"
- <if test="hospitalId!=null">
- and hospital_id=#{hospitalId}
- </if>
- <if test="inputStr!=null and inputStr!=''">
- and his_name like concat(#{inputStr},"%")
- </if>
- UNION
- SELECT
- DISTINCT his_name
- FROM
- `tran_drug_config`
- WHERE
- is_deleted = "N"
- <if test="hospitalId!=null">
- and hospital_id=#{hospitalId}
- </if>
- <if test="inputStr!=null and inputStr!=''">
- and his_name like concat("%",#{inputStr},"%")
- </if>
- ) u LIMIT 100
- </select>
- </mapper>
|