| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.PatArchiveMapper"> |
| | | |
| | | <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"/> |
| | |
| | | from pat_archive |
| | | </sql> |
| | | |
| | | <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 |
| | | and del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if> |
| | | <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="telcode != null and telcode != ''">and telcode = #{telcode}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="id != null and id != ''">and id = #{id}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | |
| | | <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> |
| | | <if test="campusid != null ">and campusid = #{campusid}</if> |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | | |
| | | |
| | |
| | | </foreach> |
| | | </select> |
| | | |
| | | <insert id="insertPatArchiveSingle" parameterType="com.smartor.domain.PatArchive" useGeneratedKeys="true" |
| | | <insert id="insertPatArchiveSingle" parameterType="com.ruoyi.common.core.domain.entity.PatArchive" useGeneratedKeys="true" |
| | | keyProperty="id"> |
| | | insert into pat_archive |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <update id="updatePatArchive" parameterType="com.smartor.domain.PatArchive"> |
| | | <update id="updatePatArchive" parameterType="com.ruoyi.common.core.domain.entity.PatArchive"> |
| | | update pat_archive |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="name != null">name = #{name},</if> |
| | |
| | | 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> |
| | | <!-- 原为 `and a.id = #{id}`:PatArchiveReq 上没有 id(只有 pid), |
| | | 条件判的是 pid 却取 id —— 这条查询(按住院记录查档案)一执行就抛 |
| | | ReflectionException: no getter for 'id'。占位符按 pid 取。 --> |
| | | <if test="pid != null and pid != ''">and a.id = #{pid}</if> |
| | | <if test="campusid != null and campusid != ''">and a.campusid = #{campusid}</if> |
| | | <if test="telcode != null and telcode != ''">and a.telcode = #{telcode}</if> |
| | | <if test="notrequiredFlag != null and notrequiredFlag != ''">and a.notrequired_flag = #{notrequiredFlag} |
| | |
| | | d.leavehospitaldistrictcode AS leavehospitaldistrictcode |
| | | FROM |
| | | pat_med_inhosp d |
| | | JOIN pat_archive a ON a.id = d.patid |
| | | LEFT 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> |
| | | <!-- 同上(QC 版语句):占位符 id -> pid。 --> |
| | | <if test="pid != null and pid != ''">and a.id = #{pid}</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> |
| | | |
| | | <if test="pids != null"> |
| | | AND a.id NOT IN |
| | | AND d.patid NOT IN |
| | | <foreach collection="pids" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |
| | |
| | | |
| | | <!-- 住院患者总数统计(去重) --> |
| | | <select id="countPatArchiveInfoByInhospQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long"> |
| | | SELECT COUNT(DISTINCT a.id) |
| | | SELECT COUNT(DISTINCT d.patid) |
| | | 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> |
| | |
| | | </foreach> |
| | | </if> |
| | | <if test="pids != null"> |
| | | AND a.id NOT IN |
| | | AND d.patid NOT IN |
| | | <foreach collection="pids" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |