|
@@ -32,7 +32,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
|
|
and admission_time BETWEEN #{startTime} AND #{endTime}
|
|
|
</if>
|
|
|
- <if test="deptId != null and deptId != 0">AND (v.dept_id = #{deptId} OR v.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, parent_id) ))</if>
|
|
|
+ <if test="deptId != null and deptId != 0">
|
|
|
+ AND (v.dept_id = #{deptId} OR v.dept_id IN (SELECT s.dept_id FROM sys_dept s WHERE s.parent_id in (SELECT s.dept_id FROM sys_dept s WHERE find_in_set( 100, parent_id ))))
|
|
|
+ </if>
|
|
|
</where>
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
@@ -65,7 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="physician!='' and physician!= null">
|
|
|
AND v.physician like concat('%', #{physician}, '%')
|
|
|
</if>
|
|
|
- <if test="deptId !=null and deptId != 0">AND (v.dept_id = #{deptId} OR v.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, parent_id) ))</if>
|
|
|
+ <if test="deptId !=null and deptId != 0">
|
|
|
+ AND (v.dept_id = #{deptId} OR v.dept_id IN (SELECT s.dept_id FROM sys_dept s WHERE s.parent_id in (SELECT s.dept_id FROM sys_dept s WHERE find_in_set( 100, parent_id ))))
|
|
|
+ </if>
|
|
|
<if test="startTime!=null and endTime!=null ">
|
|
|
AND v.discharge_time BETWEEN #{startTime} AND DATE_ADD(#{endTime},INTERVAL 1 day)
|
|
|
</if>
|