陈昶聿
9 天以前 599beddc80e7e50b2099bacdbf7df2d89df00ef2
ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
@@ -32,7 +32,7 @@
    </resultMap>
    <resultMap type="com.smartor.domain.PatArchive" id="PatArchiveResult">
    <resultMap type="com.ruoyi.common.core.domain.entity.PatArchive" id="PatArchiveResult">
        <result property="id" column="id"/>
        <result property="patientno" column="patientno"/>
        <result property="sourcefrom" column="sourcefrom"/>
@@ -93,7 +93,7 @@
    </resultMap>
    <resultMap type="com.smartor.domain.PatArchiveOthreInfo" id="PatArchiveOthreInfoResult">
    <resultMap type="com.ruoyi.patarchive.domain.PatArchiveOthreInfo" id="PatArchiveOthreInfoResult">
        <result property="id" column="id"/>
        <result property="notrequiredFlag" column="notrequired_flag"/>
        <result property="notrequiredreason" column="notrequiredreason"/>
@@ -153,7 +153,7 @@
        <result property="filterDrcode" column="filter_drcode"/>
    </resultMap>
    <resultMap type="com.smartor.domain.PatMedInhosp" id="PatMedInhospResult">
    <resultMap type="com.ruoyi.inhospvisit.domain.PatMedInhosp" id="PatMedInhospResult">
        <result property="inhospid" column="inhospid"/>
        <result property="inhospno" column="inhospno"/>
        <result property="serialnum" column="serialnum"/>
@@ -223,7 +223,7 @@
        <result property="fuspecialadvice" column="fuspecialadvice"/>
    </resultMap>
    <resultMap type="com.smartor.domain.PatMedOuthosp" id="PatMedOuthospResult">
    <resultMap type="com.ruoyi.outpatientvisit.domain.PatMedOuthosp" id="PatMedOuthospResult">
        <result property="id" column="id"/>
        <result property="serialnum" column="serialnum"/>
        <result property="patidHis" column="patid"/>
@@ -259,7 +259,7 @@
    </resultMap>
    <resultMap type="com.smartor.domain.Icd10" id="Icd10Result">
    <resultMap type="com.ruoyi.common.core.domain.entity.Icd10" id="Icd10Result">
        <result property="icdid" column="icdid"/>
        <result property="icdcode" column="icdcode"/>
        <result property="icdname" column="icdname"/>
@@ -336,7 +336,7 @@
        <result property="guid" column="guid"/>
    </resultMap>
    <resultMap type="com.smartor.domain.PatMedOperation" id="PatMedOperationResult">
    <resultMap type="com.ruoyi.othervisit.domain.PatMedOperation" id="PatMedOperationResult">
        <result property="id" column="id"/>
        <result property="patidHis" column="patid_his"/>
        <result property="patcode" column="patcode"/>
@@ -414,7 +414,7 @@
        <result property="opleveldesc" column="opleveldesc"/>
    </resultMap>
    <resultMap type="com.smartor.domain.PatMedOperationItem" id="PatMedOperationItemResult">
    <resultMap type="com.ruoyi.othervisit.domain.PatMedOperationItem" id="PatMedOperationItemResult">
        <result property="id" column="id"/>
        <result property="operationid" column="operationid"/>
        <result property="opid" column="opid"/>
@@ -488,27 +488,41 @@
    </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
        select ud.user_id , ud.user_code , ud.dept_type ,ud.dept_code,ud.dept_name,ud.deptparent,ud.del_flag,ud.orgid
        FROM healthy_user_dept ud
        where 1=1
        and user_id != 'admin'
        and dept_type = '1'
        and ud.user_id != 'admin'
        and ud.dept_type = '1'
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
            AND ud.orgid = #{orgid}
        </if>
        <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
        <if test="hisUserId != null ">and ud.user_id = #{hisUserId}</if>
        <if test="campusid != null and campusid != ''">
            AND EXISTS (
                SELECT 1 FROM healthy_dept d
                WHERE d.his_dept_id = ud.dept_code
                  AND d.orgid = #{campusid}
            )
        </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
        select ud.user_id , ud.user_code , ud.dept_type ,ud.dept_code,ud.dept_name,ud.deptparent,ud.del_flag,ud.orgid
        FROM healthy_user_dept ud
        where 1=1
        and user_id != 'admin'
        and dept_type = '2'
        and ud.user_id != 'admin'
        and ud.dept_type = '2'
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
            AND ud.orgid = #{orgid}
        </if>
        <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
        <if test="hisUserId != null ">and ud.user_id = #{hisUserId}</if>
        <if test="campusid != null and campusid != ''">
            AND EXISTS (
                SELECT 1 FROM healthy_dept d
                WHERE d.his_dept_id = ud.dept_code
                  AND d.orgid = #{campusid}
            )
        </if>
    </select>
    <select id="yhyyqxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserOrgResult">
@@ -526,7 +540,7 @@
        <if test="hisUserId != null ">
            AND ud.user_id = #{hisUserId}
        </if>
        <if test="campusid != null">
        <if test="campusid != null and campusid != ''">
            AND d.orgid = #{campusid}
        </if>
        union all
@@ -544,12 +558,12 @@
        <if test="hisUserId != null ">
            AND udb.user_id = #{hisUserId}
        </if>
        <if test="campusid != null">
        <if test="campusid != null and campusid != ''">
            AND d.orgid = #{campusid}
        </if>
    </select>
    <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">
    <select id="selectPatArchiveList" parameterType="com.ruoyi.common.core.domain.entity.PatArchive" resultMap="PatArchiveResult">
        <include refid="selectPatArchiveVo"/>
        where 1=1
            <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
@@ -593,7 +607,7 @@
    </select>
    <select id="selectPatMedInhospListCount" parameterType="com.smartor.domain.PatMedInhosp" resultType="Long">
    <select id="selectPatMedInhospListCount" parameterType="com.ruoyi.inhospvisit.domain.PatMedInhosp" resultType="Long">
        select count(*)
        FROM healthy_inhosp
    </select>
@@ -617,13 +631,13 @@
        WHERE row_num > #{lastRowNumber} LIMIT #{ps}
    </select>
    <select id="selectPatArchiveCount" parameterType="com.smartor.domain.PatMedInhosp" resultType="Long">
    <select id="selectPatArchiveCount" parameterType="com.ruoyi.inhospvisit.domain.PatMedInhosp" resultType="Long">
        select count(*)
        FROM healthy_archive
    </select>
    <select id="selectPatMedInhospList" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult">
    <select id="selectPatMedInhospList" parameterType="com.ruoyi.inhospvisit.domain.PatMedInhosp" resultMap="PatMedInhospResult">
        select
        b.nurse_id,
        b.nurse_name,
@@ -658,7 +672,8 @@
        b.leavehospitaldistrictname,
        b.leavehospitaldistrictid,
        b.deptid,
        b.leaveldeptid
        b.leaveldeptid,
        b.del_flag
        FROM
        healthy_inhosp b
        where 1=1
@@ -693,7 +708,7 @@
    </select>
    <select id="selectPatMedOuthospList" parameterType="com.smartor.domain.PatMedOuthosp"
    <select id="selectPatMedOuthospList" parameterType="com.ruoyi.outpatientvisit.domain.PatMedOuthosp"
            resultMap="PatMedOuthospResult">
        select
        outhospno,
@@ -735,7 +750,7 @@
    </select>
    <select id="selectIcd10List" parameterType="com.smartor.domain.Icd10" resultMap="Icd10Result">
    <select id="selectIcd10List" parameterType="com.ruoyi.common.core.domain.entity.Icd10" resultMap="Icd10Result">
        select
        icdcode,
        his_icdid,
@@ -767,6 +782,30 @@
        where 1=1
            <if test="orgid != null and orgid != ''">
                AND u.orgid = #{orgid}
            </if>
            <if test="lastStartTime != null and lastStartTime != ''">
                AND u.last_Update_Time &gt;= to_date(#{lastStartTime}, 'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="lastEndTime != null and lastEndTime != ''">
                AND u.last_Update_Time &lt;= to_date(#{lastEndTime}, 'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="campusid != null and campusid != ''">
                AND (
                    EXISTS (
                        SELECT 1
                        FROM healthy_user_dept ud
                        JOIN healthy_dept d ON d.his_dept_id = ud.dept_code
                        WHERE ud.user_id = u.his_user_id
                          AND d.orgid = #{campusid}
                    )
                    OR EXISTS (
                        SELECT 1
                        FROM healthy_user_dept_bf udb
                        JOIN healthy_dept d2 ON d2.his_dept_id = udb.dept_code
                        WHERE udb.user_id = u.his_user_id
                          AND d2.orgid = #{campusid}
                    )
                )
            </if>
            <if test="userId != null and userId != 0">
                AND u.user_id = #{userId}
@@ -818,7 +857,7 @@
    </select>
    <select id="selectOperList" parameterType="com.smartor.domain.PatMedOperation"
    <select id="selectOperList" parameterType="com.ruoyi.othervisit.domain.PatMedOperation"
            resultMap="PatMedOperationResult">
        select
        o.patid_his,
@@ -899,6 +938,9 @@
        <if test="orgid != null and orgid != ''">
            AND o.orgid = #{orgid}
        </if>
        <if test="opreqid != null and opreqid != ''">
            AND o.opreqid = #{opreqid}
        </if>
        <if test="lastStartTime != null and lastStartTime != ''">
            and to_char(o.last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') >= #{lastStartTime}
        </if>
@@ -907,7 +949,7 @@
        </if>
    </select>
    <select id="selectOperItemList" parameterType="com.smartor.domain.PatMedOperationItem"
    <select id="selectOperItemList" parameterType="com.ruoyi.othervisit.domain.PatMedOperationItem"
            resultMap="PatMedOperationItemResult">
        select
               oi.operationid,
@@ -941,6 +983,9 @@
        <if test="opid != null and opid != ''">
            AND oi.opid = #{opid}
        </if>
        <if test="operationid != null and operationid != ''">
            AND oi.operationid = #{operationid}
        </if>
        <if test="lastStartTime != null and lastStartTime != ''">
            and oi.last_Update_Time &gt;= to_date(#{lastStartTime}, 'YYYY-MM-DD HH24:MI:SS')
        </if>