From da026a34bcc97b2eb49607a3b02d94d8f683f997 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 07 一月 2026 16:18:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml |  141 +++++++++++++++++++++++++++++------------------
 1 files changed, 87 insertions(+), 54 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
index 69a0f90..3a197f4 100644
--- a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
@@ -4,6 +4,28 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.smartor.mapper.HNGatherPatArchiveMapper">
 
+
+    <resultMap type="com.ruoyi.common.core.domain.entity.SysUserDept" id="SysUserDeptResult">
+        <result property="id" column="id"/>
+        <result property="orgid" column="orgid"/>
+        <result property="userId" column="user_id"/>
+        <result property="deptId" column="dept_id"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="deptCode" column="dept_code"/>
+        <result property="deptName" column="dept_name"/>
+        <result property="deptType" column="dept_type"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+
+    <resultMap type="com.ruoyi.common.core.domain.entity.SysUserRole" id="SysUserRoleResult">
+        <result property="userId" column="user_id"/>
+        <result property="roleId" column="role_id"/>
+        <result property="orgid" column="orgid"/>
+    </resultMap>
+
+
     <resultMap type="com.smartor.domain.PatArchive" id="PatArchiveResult">
         <result property="id" column="id"/>
         <result property="patientno" column="patientno"/>
@@ -307,22 +329,16 @@
     </resultMap>
 
     <sql id="selectPatArchiveVo">
-        select id,
-               notrequired_flag,
+        select notrequired_flag,
                notrequiredreason,
                patientno,
-               filter_drname,
-               filter_drcode,
                patid_his,
-               age_unit,
-               age_unit2,
                sd_flag,
                name,
                sex,
                idcardno,
                birthdate,
                age,
-               age2,
                nation,
                native_place,
                place_of_residence,
@@ -335,15 +351,7 @@
                idcardtype,
                orgid,
                openid,
-               del_flag,
-               update_by,
-               update_time,
-               create_by,
-               create_time,
-               isupload,
-               pattype,
                viptype,
-               upload_time,
                care_facilities,
                case_path,
                degree_of_education,
@@ -351,14 +359,33 @@
                income,
                medicare_type,
                care_person,
-               guid,
                case_person_age
         from hzjbxx
     </sql>
 
+
+    <select id="yhyjsxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserRoleResult">
+        select user_id, role_id, orgid
+        FROM yhyjsxx
+        where 1=1
+        <if test="hisUserId != null ">
+            and user_id = #{hisUserId}
+        </if>
+    </select>
+
+    <select id="yhyksxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
+        select user_id, user_code, dept_type,department_id as
+        dept_id,dept_name,deptparent,del_flag,orgid,create_time,create_by,update_time,update_by
+        FROM yhyksxx
+        where 1=1
+            and user_id != 'admin'
+            <if test="hisUserId != null ">and user_id = #{hisUserId}</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>
@@ -369,7 +396,7 @@
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="viptype != null ">and viptype = #{viptype}</if>
             <if test="pattype != null ">and pattype = #{pattype}</if>
-            <if test="patientno != null ">and patientno = #{patientno}</if>
+            <if test="patientno != null ">and patientno = CAST(#{patientno} AS INTEGER)</if>
             <if test="patidHis != null ">and patid_his = #{patidHis}</if>
             <if test="sdFlag != null ">and sd_flag = #{sdFlag}</if>
             <if test="ageUnit != null ">and age_unit = #{ageUnit}</if>
@@ -388,13 +415,36 @@
             <if test="casePersonAge != null ">and case_person_age = #{casePersonAge}</if>
             <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
             <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
-        </where>
     </select>
 
 
     <select id="selectPatMedInhospListCount" parameterType="com.smartor.domain.PatMedInhosp" resultType="Long">
         select count(*)
         FROM cryxx
+    </select>
+
+    <select id="selectPatArchiveListByLastId" resultMap="PatArchiveResult">
+        SELECT *
+        FROM (
+                 SELECT *,
+                        ROW_NUMBER() OVER (ORDER BY patid_his) as row_num
+                 FROM hzjbxx
+             ) a
+        WHERE row_num > #{lastRowNumber} LIMIT #{ps}
+    </select>
+
+    <select id="selectPatMedInhospListByLastId" resultMap="PatMedInhospResult">
+        SELECT *
+        FROM (SELECT *,
+                     ROW_NUMBER() OVER (ORDER BY patno) as row_num
+              FROM cryxx
+             ) a
+        WHERE row_num > #{lastRowNumber} LIMIT #{ps}
+    </select>
+
+    <select id="selectPatArchiveCount" parameterType="com.smartor.domain.PatMedInhosp" resultType="Long">
+        select count(*)
+        FROM hzjbxx
     </select>
 
 
@@ -443,18 +493,18 @@
         b.fuadvice
         FROM
         cryxx b
-        <where>
-            <if test="startOutHospTime != null ">and date_format(b.endtime,'%y%m%d') &gt;=
-                date_format(#{startOutHospTime},'%y%m%d')
+        where 1=1
+            <if test="startOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &gt;=
+                to_char(#{startOutHospTime}::date,'YYMMDD')
             </if>
-            <if test="endOutHospTime != null ">and date_format(b.endtime,'%y%m%d') &lt;=
-                date_format(#{endOutHospTime},'%y%m%d')
+            <if test="endOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &lt;=
+                to_char(#{endOutHospTime}::date,'YYMMDD')
             </if>
-            <if test="startInHospTime != null ">and date_format(b.starttime,'%y%m%d') &gt;=
-                date_format(#{startInHospTime},'%y%m%d')
+            <if test="startInHospTime != null ">and to_char(b.starttime,'YYMMDD') &gt;=
+                to_char(#{startInHospTime}::date,'%y%m%d')
             </if>
-            <if test="endInHospTime != null ">and date_format(b.starttime,'%y%m%d') &lt;=
-                date_format(#{endInHospTime},'%y%m%d')
+            <if test="endInHospTime != null ">and to_char(b.starttime,'YYMMDD') &lt;=
+                to_char(#{endInHospTime}::date,'YYMMDD')
             </if>
             <if test="inhospno != null ">and b.inhospno = #{inhospno}</if>
             <if test="fuflag != null ">and b.fuflag = #{fuflag}</if>
@@ -466,8 +516,6 @@
             <if test="outWayId != null ">and b.out_way_id = #{outWayId}</if>
             <if test="outWayName != null ">and b.out_way_name = #{outWayName}</if>
             <if test="orgid != null ">and b.orgid = #{orgid}</if>
-        </where>
-        limit #{ps} OFFSET #{pn}
     </select>
 
 
@@ -501,21 +549,14 @@
         patname,
         mainsuit
         from mzxx
-        <where>
-            <if test="deptname != null  and deptname != ''">and deptname like concat('%', #{deptname}, '%')</if>
-            <if test="drname != null  and drname != ''">and drname like concat('%', #{drname}, '%')</if>
-            <if test="patname != null  and patname != ''">and patname like concat('%', #{patname}, '%')</if>
-            <if test="beginTime != null ">and date_format( admitdate,'%y%m%d') &gt;=
-                date_format(#{beginTime},'%y%m%d')
+        where 1=1
+            <if test="beginTime != null ">and to_char( admitdate,'YYMMDD') &gt;=
+                to_char(#{beginTime}::date,'YYMMDD')
             </if>
-            <if test="endTime != null ">and date_format( admitdate,'%y%m%d') &lt;=
-                date_format(#{endTime},'%y%m%d')
+            <if test="endTime != null ">and to_char( admitdate,'YYMMDD') &lt;=
+                to_char(#{endTime}::date,'YYMMDD')
             </if>
-            <if test="patid != null ">and patid = #{patid}</if>
-            <if test="patno != null ">and patno = #{patno}</if>
-            <if test="outhospno != null  and outhospno != ''">and outhospno = #{outhospno}</if>
-            <if test="diagcheckFlag != null  and diagcheckFlag != ''">and diagcheck_flag = #{diagcheckFlag}</if>
-        </where>
+
     </select>
 
 
@@ -528,7 +569,7 @@
         icdname,
         icdpym
         from jbxx
-        <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>
@@ -539,7 +580,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>
 
 
@@ -550,7 +590,7 @@
         u.birthday,u.orgid,u.job_phone,u.phonenumber, u.sex, u.status,
         u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
         from ryxx u
-        <where>
+        where 1=1
             <if test="userId != null and userId != 0">
                 AND u.user_id = #{userId}
             </if>
@@ -581,13 +621,6 @@
             <if test="phonenumber != null and phonenumber != ''">
                 AND u.phonenumber like concat('%', #{phonenumber}, '%')
             </if>
-            <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
-                AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-            </if>
-            <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
-                AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-            </if>
-        </where>
     </select>
 
     <select id="selectDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
@@ -605,7 +638,7 @@
                d.create_time,
                d.his_dept_id,
                d.his_parent_id
-        FROM bmxx d
+        FROM HEALTHY_DEPT d
 
     </select>
 </mapper>

--
Gitblit v1.9.3