| | |
| | | resultMap="PatArchiveOutResult"> |
| | | <include refid="selectPatArchiveOutVo"/> |
| | | where 1=1 |
| | | <if test="patientno != null and patientno != ''">and patientno = #{patientno}</if> |
| | | <if test="pattype != null and pattype != ''">and pattype = #{pattype}</if> |
| | | <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> |
| | | <if test="sex != null ">and sex = #{sex}</if> |
| | | <if test="nation != null and nation != ''">and nation = #{nation}</if> |
| | | <if test="nativePlace != null and nativePlace != ''">and native_place = #{nativePlace}</if> |
| | | <if test="placeOfResidence != null and placeOfResidence != ''">and place_of_residence = |
| | | #{placeOfResidence} |
| | | </if> |
| | | <if test="birthplace != null and birthplace != ''">and birthplace = #{birthplace}</if> |
| | | <if test="idcardno != null and idcardno != ''">and idcardno = #{idcardno}</if> |
| | | <if test="birthdate != null ">and birthdate = #{birthdate}</if> |
| | | <if test="age != null ">and age = #{age}</if> |
| | | <if test="archivetime != null ">and archivetime = #{archivetime}</if> |
| | | <if test="archiveby != null and archiveby != ''">and archiveby = #{archiveby}</if> |
| | | <if test="telcode != null and telcode != ''">and telcode = #{telcode}</if> |
| | | <if test="relativetelcode != null and relativetelcode != ''">and relativetelcode = #{relativetelcode}</if> |
| | | <if test="idcardtype != null and idcardtype != ''">and idcardtype = #{idcardtype}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="openid != null and openid != ''">and openid = #{openid}</if> |
| | | <if test="dduserid != null and dduserid != ''">and dduserid = #{dduserid}</if> |
| | | <if test="source != null ">and source = #{source}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="membertype != null and membertype != ''">and membertype = #{membertype}</if> |
| | | <if test="patientno != null and patientno != ''">and patientno = #{patientno}</if> |
| | | <if test="pattype != null and pattype != ''">and pattype = #{pattype}</if> |
| | | <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> |
| | | <if test="sex != null ">and sex = #{sex}</if> |
| | | <if test="nation != null and nation != ''">and nation = #{nation}</if> |
| | | <if test="nativePlace != null and nativePlace != ''">and native_place = #{nativePlace}</if> |
| | | <if test="placeOfResidence != null and placeOfResidence != ''">and place_of_residence = |
| | | #{placeOfResidence} |
| | | </if> |
| | | <if test="birthplace != null and birthplace != ''">and birthplace = #{birthplace}</if> |
| | | <if test="idcardno != null and idcardno != ''">and idcardno = #{idcardno}</if> |
| | | <if test="birthdate != null ">and birthdate = #{birthdate}</if> |
| | | <if test="age != null ">and age = #{age}</if> |
| | | <if test="archivetime != null ">and archivetime = #{archivetime}</if> |
| | | <if test="archiveby != null and archiveby != ''">and archiveby = #{archiveby}</if> |
| | | <if test="telcode != null and telcode != ''">and telcode = #{telcode}</if> |
| | | <if test="relativetelcode != null and relativetelcode != ''">and relativetelcode = #{relativetelcode}</if> |
| | | <if test="idcardtype != null and idcardtype != ''">and idcardtype = #{idcardtype}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="openid != null and openid != ''">and openid = #{openid}</if> |
| | | <if test="dduserid != null and dduserid != ''">and dduserid = #{dduserid}</if> |
| | | <if test="source != null ">and source = #{source}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="membertype != null and membertype != ''">and membertype = #{membertype}</if> |
| | | </select> |
| | | |
| | | <select id="selectPatArchiveOutByPatid" parameterType="Long" resultMap="PatArchiveOutResult"> |
| | |
| | | from ( |
| | | SELECT "住院" as name1, count(1) as count FROM `pat_med_inhosp` |
| | | where 1=1 |
| | | and del_flag = 0 and endtime = null |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="deptIds != null ">and deptId in |
| | | <foreach collection="deptIds" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | <if test="drCodes != null ">and drcode in |
| | | <foreach collection="drCodes" item="drCode" open="(" separator="," close=")"> |
| | | #{drCode} |
| | | </foreach> |
| | | </if> |
| | | and del_flag = 0 and endtime = null |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="deptcodes != null ">and deptcode in |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="drCodes != null ">and drcode in |
| | | <foreach collection="drCodes" item="drCode" open="(" separator="," close=")"> |
| | | #{drCode} |
| | | </foreach> |
| | | </if> |
| | | union |
| | | select "出院" name1, count(1) as count FROM `pat_med_inhosp` |
| | | where 1=1 |
| | | and del_flag = 0 and endtime != null |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="deptIds != null ">and deptId in |
| | | <foreach collection="deptIds" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | <if test="drCodes != null ">and drcode in |
| | | <foreach collection="drCodes" item="drCode" open="(" separator="," close=")"> |
| | | #{drCode} |
| | | </foreach> |
| | | </if> |
| | | union |
| | | select "门诊" name1, count(1) as count FROM `pat_med_outhosp` |
| | | where del_flag=0 |
| | | and del_flag = 0 and endtime != null |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="deptcodes != null ">and leaveldeptcode in |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="drCodes != null ">and drcode in |
| | | <foreach collection="drCodes" item="drCode" open="(" separator="," close=")"> |
| | | #{drCode} |
| | | </foreach> |
| | | </if> |
| | | ) aa |
| | | |
| | | </select> |