| | |
| | | |
| | | <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult"> |
| | | <include refid="selectPatArchiveVo"/> |
| | | <where> |
| | | del_flag=0 |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <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> |
| | |
| | | <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if> |
| | | <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if> |
| | | <if test="campusid != null ">and campusid = #{campusid}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | |
| | | a.filter_drcode, |
| | | a.case_person_age |
| | | from pat_archive a,pat_archivetag b ,base_tag c |
| | | <where> |
| | | a.del_flag=0 and |
| | | a.id = b.patid and b.tagid = c.tagid |
| | | where 1=1 |
| | | and a.del_flag = 0 |
| | | and a.id = b.patid |
| | | and b.tagid = c.tagid |
| | | <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if> |
| | | <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if> |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | |
| | | #{tagId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectPatArchiveByPatid" parameterType="Long" resultMap="PatArchiveResult"> |
| | |
| | | FROM |
| | | pat_archive a |
| | | LEFT JOIN pat_archivetag b ON a.id = b.patid AND b.del_flag = 0 |
| | | <where> |
| | | a.del_flag = 0 |
| | | where 1=1 |
| | | and 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> |
| | |
| | | #{tagId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by a.update_time desc |
| | | <if test="pn != null and ps != null">limit ${pn},${ps}</if> |
| | | |
| | |
| | | d.nurse_id, |
| | | d.out_way_id, |
| | | d.leavehospitaldistrictname AS leavehospitaldistrictname, |
| | | d.leavehospitaldistrictcode AS leavehospitaldistrictcode, |
| | | t.tagname |
| | | d.leavehospitaldistrictcode AS leavehospitaldistrictcode |
| | | 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 where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | | where 1=1 |
| | | and 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="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </where> |
| | | -- order by a.update_time desc |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | |
| | |
| | | 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 |
| | | where 1=1 |
| | | and 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="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </where> |
| | | -- order by a.update_time desc |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | |
| | | a.upload_time, |
| | | a.filter_drname, |
| | | a.filter_drcode, |
| | | 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 where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | | where 1=1 |
| | | and 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="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </where> |
| | | -- order by a.update_time desc |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | |
| | | d.nurse_id, |
| | | d.out_way_id, |
| | | d.leavehospitaldistrictname AS leavehospitaldistrictname, |
| | | d.leavehospitaldistrictcode AS leavehospitaldistrictcode, |
| | | t.tagname |
| | | d.leavehospitaldistrictcode AS leavehospitaldistrictcode |
| | | 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 where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | | where 1=1 |
| | | and 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="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </where> |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | ) as tmp |
| | | </select> |
| | |
| | | a.upload_time, |
| | | a.filter_drname, |
| | | a.filter_drcode, |
| | | 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 where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | | where 1=1 |
| | | and 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="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </where> |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | | |
| | |
| | | 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 where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | | where 1=1 |
| | | and 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="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </where> |
| | | -- order by a.update_time desc |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | | |
| | | <!-- 住院患者总数统计(去重) --> |
| | | <select id="countPatArchiveInfoByInhospQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long"> |
| | | SELECT COUNT(DISTINCT a.id) |
| | | FROM pat_med_inhosp d |
| | | JOIN pat_archive a ON a.id = d.patid |
| | | WHERE 1=1 |
| | | AND 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> |
| | | <if test="telcode != null and telcode != ''">AND a.telcode = #{telcode}</if> |
| | | <if test="notrequiredFlag != null and notrequiredFlag != ''">AND a.notrequired_flag = #{notrequiredFlag}</if> |
| | | <if test="hospitalname != null and hospitalname != ''">AND d.hospitalname = #{hospitalname}</if> |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''">AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%')</if> |
| | | <if test="leaveicd10code != null and leaveicd10code != ''">AND d.leaveicd10code LIKE concat('%',#{leaveicd10code}, '%')</if> |
| | | <if test="endtime != null">AND d.endtime = #{endtime}</if> |
| | | <if test="drname != null and drname != ''">AND d.drname LIKE concat('%',#{drname}, '%')</if> |
| | | <if test="drcode != null">AND d.drcode = #{drcode}</if> |
| | | <if test="campusid != null">AND d.campusid = #{campusid}</if> |
| | | <if test="allhosp != null and allhosp == 1 ">AND d.endtime is null</if> |
| | | <if test="allhosp != null and allhosp == 4 ">AND d.endtime is not null</if> |
| | | <if test="visitno != null and visitno != ''">AND d.inhospno = #{visitno}</if> |
| | | <if test="deptname != null and deptname != ''">AND d.deptname LIKE concat('%', #{deptname}, '%')</if> |
| | | <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 |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0"> |
| | | AND d.leaveldeptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0"> |
| | | AND d.hospitaldistrictcode IN |
| | | <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator="," close=")"> |
| | | #{hospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND d.deptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="pids != null"> |
| | | AND a.id NOT IN |
| | | <foreach collection="pids" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |
| | | </if> |
| | | <if test="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 门诊患者总数统计(去重) --> |
| | | <select id="countPatArchiveInfoByOuthospQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long"> |
| | | SELECT COUNT(DISTINCT a.id) |
| | | FROM pat_med_outhosp d |
| | | JOIN pat_archive a ON a.id = d.patid |
| | | WHERE 1=1 |
| | | AND 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="campusid != null and campusid != ''">AND a.campusid = #{campusid}</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> |
| | | <if test="telcode != null and telcode != ''">AND a.telcode = #{telcode}</if> |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''">AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%')</if> |
| | | <if test="notrequiredFlag != null and notrequiredFlag != ''">AND a.notrequired_flag = #{notrequiredFlag}</if> |
| | | <if test="leavediagname != null and leavediagname != ''">AND d.diagname LIKE concat('%',#{leavediagname}, '%')</if> |
| | | <if test="hospitalname != null and hospitalname != ''">AND d.hospitalname = #{hospitalname}</if> |
| | | <if test="visitno != null and visitno != ''">AND d.outhospno = #{visitno}</if> |
| | | <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="drcode != null">AND d.drcode = #{drcode}</if> |
| | | <if test="pids != null"> |
| | | AND a.id NOT IN |
| | | <foreach collection="pids" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |
| | | </if> |
| | | <if test="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 体检患者总数统计(去重) --> |
| | | <select id="countPatArchiveInfoByPhysicalQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long"> |
| | | SELECT COUNT(DISTINCT a.id) |
| | | FROM pat_med_physical d |
| | | JOIN pat_archive a ON a.id = d.patid |
| | | WHERE 1=1 |
| | | AND 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="campusid != null and campusid != ''">AND a.campusid = #{campusid}</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> |
| | | <if test="telcode != null and telcode != ''">AND a.telcode = #{telcode}</if> |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''">AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%')</if> |
| | | <if test="diagname != null and diagname != ''">AND d.diagname LIKE concat('%',#{diagname}, '%')</if> |
| | | <if test="notrequiredFlag != null and notrequiredFlag != ''">AND a.notrequired_flag = #{notrequiredFlag}</if> |
| | | <if test="hospitalname != null and hospitalname != ''">AND d.hospitalname = #{hospitalname}</if> |
| | | <if test="visitno != null and visitno != ''">AND d.physno = #{visitno}</if> |
| | | <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="pids != null"> |
| | | AND a.id NOT IN |
| | | <foreach collection="pids" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |
| | | </if> |
| | | <if test="isFilter == true"> |
| | | AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) |
| | | </if> |
| | | </select> |
| | | </mapper> |