liusheng
9 天以前 e4e220916dd2a4aa649a9b0162e5b5ed0dc9d7e5
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -117,6 +117,8 @@
        <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/>
        <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
        <result property="guid" column="guid"/>
        <result property="leavediagname" column="leavediagname"/>
        <result property="leaveicd10code" column="leaveicd10code"/>
    </resultMap>
    <sql id="selectPatArchiveVo">
@@ -432,7 +434,7 @@
            resultMap="PatArchiveOthreInfoResult">
        SELECT
        DISTINCT a.id,
        a.id,
        a.age_unit,
        a.age_unit2,
        a.patid_his,
@@ -474,6 +476,7 @@
        LEFT JOIN pat_archivetag b ON a.id = b.patid AND b.del_flag = 0
        <where>
            a.del_flag = 0
            and a.orgid = #{orgid}
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
            <if test="notrequiredFlag != null  and notrequiredFlag != ''">and a.notrequired_flag = #{notrequiredFlag}
@@ -485,7 +488,6 @@
                    #{tagId}
                </foreach>
            </if>
        </where>
        order by a.update_time desc
    </select>
@@ -493,9 +495,8 @@
    <select id="selectPatArchiveInfoByInhosp" parameterType="com.smartor.domain.PatArchiveReq"
            resultMap="PatArchiveOthreInfoResult">
        select
        DISTINCT a.id,
        a.id,
        a.age_unit,
        a.age_unit2,
        a.inhospno,
@@ -547,11 +548,13 @@
        FROM
        pat_med_inhosp d
        JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
        ) t ON t.patid =
        d.patid
        <where>
            d.del_flag != 1
            AND a.del_flag != 1
            and d.orgid = #{orgid}
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
            <if test="pid != null  and pid != ''">and a.id = #{id}</if>
@@ -629,9 +632,8 @@
    <select id="selectPatArchiveInfoByOuthosp" parameterType="com.smartor.domain.PatArchiveReq"
            resultMap="PatArchiveOthreInfoResult">
        select
        DISTINCT a.id,
        a.id,
        a.age_unit,
        a.age_unit2,
        a.patid_his,
@@ -669,13 +671,16 @@
        a.create_time,
        a.isupload,
        a.upload_time,
        t.tagname,
        a.pattype
        from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
        ) t ON t.patid =
        d.patid
        <where>
            d.del_flag != 1
            AND a.del_flag != 1
            and d.orgid = #{orgid}
            <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
@@ -755,13 +760,16 @@
        a.create_time,
        a.isupload,
        a.upload_time,
        t.tagname,
        a.pattype
        from pat_med_physical d JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
        ) t ON t.patid =
        d.patid
        <where>
            d.del_flag != 1
            AND a.del_flag != 1
            and d.orgid = #{orgid}
            <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
@@ -804,7 +812,7 @@
            resultMap="PatArchiveOthreInfoResult">
        select
        distinct a.idcardno,
        a.idcardno,
        a.id,
        a.age_unit,
        a.age_unit2,
@@ -819,6 +827,8 @@
        d.deptcode,
        d.drcode,
        d.drname,
        d.leavediagname,
        d.leaveicd10code,
        a.sex,
        a.nation,
        a.native_place,
@@ -856,11 +866,13 @@
        FROM
        pat_med_inhosp d
        JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
        ) t ON t.patid =
        d.patid
        <where>
            d.del_flag != 1
            AND a.del_flag != 1
            and d.orgid = #{orgid}
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
            <if test="pid != null  and pid != ''">and a.id = #{id}</if>
@@ -885,14 +897,8 @@
            <if test="deptname != null and deptname != ''">
                and d.deptname LIKE concat('%', #{deptname}, '%')
            </if>
            <if test="drname != null and drname != ''">
                AND d.drname LIKE concat('%',#{drname}, '%')
            </if>
            <if test="diagname != null and diagname != ''">
                AND d.diagname LIKE concat('%',#{diagname}, '%')
            </if>
            <if test="deptname != null and deptname != ''">
                AND d.deptname LIKE concat('%',#{deptname}, '%')
            <if test="leavediagname != null and leavediagname != ''">
                AND d.leavediagname LIKE concat('%',#{leavediagname}, '%')
            </if>
            <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
                AND d.leavehospitaldistrictcode IN
@@ -918,14 +924,13 @@
                AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
            </if>
        </where>
        order by a.update_time desc
    </select>
    <select id="selectPatArchiveInfoByOuthospQC" parameterType="com.smartor.domain.PatArchiveReq"
            resultMap="PatArchiveOthreInfoResult">
        select
        distinct a.idcardno,
        a.idcardno,
        a.id,
        a.age_unit,
        a.age_unit2,
@@ -945,6 +950,8 @@
        a.place_of_residence,
        a.birthplace,
        a.birthdate,
        a.icd10code as leaveicd10code,
        a.diagname as leavediagname,
        a.age,
        a.age2,
        a.viptype,
@@ -963,13 +970,16 @@
        a.create_time,
        a.isupload,
        a.upload_time,
        t.tagname,
        a.pattype
        from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
        ) t ON t.patid =
        d.patid
        <where>
            d.del_flag != 1
            AND a.del_flag != 1
            and d.orgid = #{orgid}
            <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
@@ -979,8 +989,8 @@
            </if>
            <if test="notrequiredFlag != null  and notrequiredFlag != ''">and a.notrequired_flag = #{notrequiredFlag}
            </if>
            <if test="diagname != null and diagname != ''">
                AND d.diagname LIKE concat('%',#{diagname}, '%')
            <if test="leavediagname != null and leavediagname != ''">
                AND d.diagname LIKE concat('%',#{leavediagname}, '%')
            </if>
            <if test="hospitalname != null and hospitalname != ''">
                AND d.hospitalname = #{hospitalname}
@@ -1011,7 +1021,7 @@
            resultMap="PatArchiveOthreInfoResult">
        select
        distinct a.idcardno,
        a.idcardno,
        a.id,
        a.age_unit,
        a.age_unit2,
@@ -1049,13 +1059,16 @@
        a.create_time,
        a.isupload,
        a.upload_time,
        t.tagname,
        a.pattype
        from pat_med_physical d JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
        ) t ON t.patid =
        d.patid
        <where>
            d.del_flag != 1
            AND a.del_flag != 1
            and d.orgid = #{orgid}
            <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>