|
@@ -1,21 +1,56 @@
|
|
|
<?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">
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.diagbot.mapper.BasDeptInfoMapper">
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.diagbot.entity.BasDeptInfo">
|
|
|
- <id column="dept_id" property="deptId" />
|
|
|
- <result column="hospital_id" property="hospitalId" />
|
|
|
- <result column="parent_dept_id" property="parentDeptId" />
|
|
|
- <result column="dept_name" property="deptName" />
|
|
|
- <result column="dept_type" property="deptType" />
|
|
|
- <result column="spell" property="spell" />
|
|
|
- <result column="station" property="station" />
|
|
|
- <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" />
|
|
|
+ <id column="dept_id" property="deptId"/>
|
|
|
+ <result column="hospital_id" property="hospitalId"/>
|
|
|
+ <result column="parent_dept_id" property="parentDeptId"/>
|
|
|
+ <result column="dept_name" property="deptName"/>
|
|
|
+ <result column="dept_type" property="deptType"/>
|
|
|
+ <result column="spell" property="spell"/>
|
|
|
+ <result column="station" property="station"/>
|
|
|
+ <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"/>
|
|
|
</resultMap>
|
|
|
+ <select id="getList" resultType="com.diagbot.dto.BasDeptInfoDTO"
|
|
|
+ parameterType="com.diagbot.vo.BasDeptInfoVO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ t.dept_id AS deptId,
|
|
|
+ dept_name AS deptName
|
|
|
+ FROM
|
|
|
+ `bas_dept_info` t
|
|
|
+ WHERE
|
|
|
+ t.is_deleted = 'N'
|
|
|
+ AND t.station = '住院'
|
|
|
+ AND t.hospital_id = #{hospitalId}
|
|
|
+ <if test="inputStr !=null and inputStr != ''">
|
|
|
+ AND (UPPER(t.spell) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%') OR UPPER(t.dept_name) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%'));
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="getListUser" resultType="com.diagbot.dto.BasDeptInfoDTO"
|
|
|
+ parameterType="com.diagbot.vo.BasDeptInfoVO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ t.dept_id AS deptId,
|
|
|
+ dept_name AS deptName
|
|
|
+ FROM
|
|
|
+ `bas_dept_info` t
|
|
|
+ INNER JOIN sys_user_dept t1 ON t1.is_deleted = 'N'
|
|
|
+ AND t1.dept_id = t.dept_id
|
|
|
+ AND t1.hospital_id = t.hospital_id
|
|
|
+ WHERE
|
|
|
+ t.is_deleted = 'N'
|
|
|
+ AND t.station = '住院'
|
|
|
+ AND t.hospital_id = #{hospitalId}
|
|
|
+ AND t1.user_id = #{userId}
|
|
|
+ <if test="inputStr !=null and inputStr != ''">
|
|
|
+ AND (UPPER(t.spell) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%') OR UPPER(t.dept_name) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%'));
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|