From 04bd73df18204f4dff695b2a1210ac76c45f9b97 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 04 二月 2026 13:58:53 +0800
Subject: [PATCH] 【市一】查询问卷题目列表
---
ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml | 96 +++++++++++++++++++++++++++++++++++++++---------
1 files changed, 78 insertions(+), 18 deletions(-)
diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
index bb424fa..5c0653a 100644
--- a/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
+++ b/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
@@ -17,6 +17,13 @@
<result property="updateTime" column="update_time"/>
</resultMap>
+ <resultMap type="com.smartor.domain.SysUserOrg" id="SysUserOrgResult">
+ <result property="id" column="id"/>
+ <result property="userId" column="user_id"/>
+ <result property="campusid" column="campusid"/>
+ <result property="orgid" column="orgid"/>
+ <result property="delFlag" column="del_flag"/>
+ </resultMap>
<resultMap type="com.ruoyi.common.core.domain.entity.SysUserRole" id="SysUserRoleResult">
<result property="userId" column="user_id"/>
@@ -366,24 +373,78 @@
<select id="yhyjsxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserRoleResult">
select user_id, role_id, orgid
FROM healthy_user_role
- <where>
+ where 1=1
+ <if test="orgid != null and orgid != ''">
+ AND orgid = #{orgid}
+ </if>
<if test="hisUserId != null ">and user_id = #{hisUserId}</if>
- </where>
</select>
<select id="yhyksxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
select user_id , user_code , dept_type ,dept_code,dept_name,deptparent,del_flag,orgid
FROM healthy_user_dept
- <where>
- user_id != 'admin'
- <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
- </where>
+ where 1=1
+ and user_id != 'admin'
+ and dept_type = '1'
+ <if test="orgid != null and orgid != ''">
+ AND orgid = #{orgid}
+ </if>
+ <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
</select>
+ <select id="yhybfxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
+ select user_id , user_code , dept_type ,dept_code,dept_name,deptparent,del_flag,orgid
+ FROM healthy_user_dept
+ where 1=1
+ and user_id != 'admin'
+ and dept_type = '2'
+ <if test="orgid != null and orgid != ''">
+ AND orgid = #{orgid}
+ </if>
+ <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
+ </select>
+
+ <select id="yhyyqxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserOrgResult">
+ select
+ d.orgid as campusid,
+ ud.user_id as user_id,
+ ud.orgid as orgid
+ FROM healthy_dept d
+ JOIN healthy_user_dept ud ON d.his_dept_id = ud.dept_code
+ where 1=1
+ and ud.user_id != 'admin'
+ <if test="orgid != null and orgid != ''">
+ AND ud.orgid = #{orgid}
+ </if>
+ <if test="hisUserId != null ">
+ AND ud.user_id = #{hisUserId}
+ </if>
+ <if test="campusid != null">
+ AND d.orgid = #{campusid}
+ </if>
+ union all
+ select
+ d.orgid as campusid,
+ udb.user_id as user_id,
+ udb.orgid as orgid
+ FROM healthy_dept d
+ JOIN healthy_user_dept_bf udb ON d.his_dept_id = udb.dept_code
+ where 1=1
+ and udb.user_id != 'admin'
+ <if test="orgid != null and orgid != ''">
+ AND udb.orgid = #{orgid}
+ </if>
+ <if test="hisUserId != null ">
+ AND udb.user_id = #{hisUserId}
+ </if>
+ <if test="campusid != null">
+ AND d.orgid = #{campusid}
+ </if>
+ </select>
<select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">
<include refid="selectPatArchiveVo"/>
- <where>
+ where 1=1
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="idcardno != null and idcardno != ''">and idcardno = #{idcardno}</if>
<if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
@@ -422,7 +483,6 @@
<if test="pageSize != null and pageSize!='' ">and rownum<#{pageSize}</if>
- </where>
</select>
@@ -495,8 +555,7 @@
FROM
healthy_inhosp b
- <where>
-
+ where 1=1
<if test="startOutHospTime != null ">
and to_char(b.endtime, 'YYYY-MM-DD HH24:MI:SS') >=to_char(#{startOutHospTime},'YYYY-MM-DD HH24:MI:SS')
</if>
@@ -525,7 +584,6 @@
<if test="lastEndTime != null and lastEndTime != ''">
and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') <= #{lastEndTime}
</if>
- </where>
</select>
@@ -552,8 +610,10 @@
patname,
mainsuit
from healthy_outhosp
- <where>
-
+ where 1=1
+ <if test="orgid != null and orgid != ''">
+ AND orgid = #{orgid}
+ </if>
<if test="beginTime != null ">
and to_char(admitdate, 'YYYY-MM-DD HH24:MI:SS') >= to_char(#{beginTime}, 'YYYY-MM-DD HH24:MI:SS')
</if>
@@ -566,7 +626,6 @@
<if test="lastEndTime != null and lastEndTime != ''">
and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') <= #{lastEndTime}
</if>
- </where>
</select>
@@ -579,7 +638,7 @@
icdname,
icdpym
from healthy_disease
- <where>
+ where 1=1
<if test="icdcode != null and icdcode != ''">and icdcode = #{icdcode}</if>
<if test="lastflag != null and lastflag != ''">and lastflag = #{lastflag}</if>
<if test="chimedflag != null and chimedflag != ''">and chimedflag = #{chimedflag}</if>
@@ -590,7 +649,6 @@
<if test="pid != null ">and pid = #{pid}</if>
<if test="guid != null and guid != ''">and guid = #{guid}</if>
<if test="hisIcdid != null and hisIcdid != ''">and his_icdid = #{hisIcdid}</if>
- </where>
</select>
@@ -600,7 +658,10 @@
u.nick_name, u.user_name, u.email,u.id_card, u.avatar,
u.birthday,u.orgid,u.job_phone,u.phonenumber, u.sex, u.status
from healthy_user u
- <where>
+ where 1=1
+ <if test="orgid != null and orgid != ''">
+ AND u.orgid = #{orgid}
+ </if>
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
</if>
@@ -631,7 +692,6 @@
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
- </where>
</select>
<select id="selectDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
--
Gitblit v1.9.3