|
|
@ -21,12 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</resultMap> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectPatientManageVo"> |
|
|
|
<sql id="selectPatientManageVo"> |
|
|
|
select patient_id, patient_name, patient_age, CASE patient_sex WHEN '1' THEN '男' ELSE '女' END as patient_sex |
|
|
|
select patient_id, patient_name, patient_age, CASE patient_sex WHEN '男' THEN '男' ELSE '女' END as patient_sex |
|
|
|
, patient_id_card, description, current_location, temperature, diagnosed_time |
|
|
|
, patient_id_card, description, current_location, temperature, diagnosed_time |
|
|
|
, CASE is_emergency WHEN '1' THEN '重症患者' ELSE '非重症患者' END as is_emergency |
|
|
|
, CASE is_emergency WHEN '重症患者' THEN '重症患者' ELSE '非重症患者' END as is_emergency |
|
|
|
, CASE is_dead WHEN '1' THEN '健在' ELSE '已死亡' END as is_dead |
|
|
|
, CASE is_dead WHEN '健在' THEN '健在' ELSE '已死亡' END as is_dead |
|
|
|
, CASE is_touch WHEN '1' THEN '是密接人员' ELSE '不是密接人员' END as is_touch |
|
|
|
, CASE is_touch WHEN '密接人员' THEN '密接人员' ELSE '非密接人员' END as is_touch |
|
|
|
, CASE is_high WHEN '1' THEN '去过高风险地区' ELSE '未去过高风险地区' END as is_high |
|
|
|
, CASE is_high WHEN '去过高风险地区' THEN '去过高风险地区' ELSE '未去过高风险地区' END as is_high |
|
|
|
from patient_manage |
|
|
|
from patient_manage |
|
|
|
</sql> |
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
@ -119,14 +119,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
where patient_id_card = #{patientIdCard} |
|
|
|
where patient_id_card = #{patientIdCard} |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
<select id="selectPatientById" parameterType="Long" resultMap="PatientManageResult"> |
|
|
|
<select id="selectPatientById" parameterType="Long" resultMap="PatientManageResult"> |
|
|
|
<include refid="selectPatientManageVo"/>l |
|
|
|
<include refid="selectPatientManageVo"/> |
|
|
|
where patient_id= #{patientId} |
|
|
|
where patient_id= #{patientId} |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
<select id="checkPatientIdCardUnique" parameterType="String" resultMap="PatientManageResult"> |
|
|
|
<select id="checkPatientCureIdCardUnique" parameterType="String" resultMap="PatientManageResult"> |
|
|
|
select patient_id, patient_id_card from patient_manage where patient_id_card=#{patientIdCard} |
|
|
|
select patient_id, patient_id_card from patient_manage where patient_id_card=#{patientIdCard} |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
<insert id="insertCurePatientManage" parameterType="PatientManage" useGeneratedKeys="true" keyProperty="patientId"> |
|
|
|
<insert id="insertCurePatientManage" parameterType="PatientManage" useGeneratedKeys="true" keyProperty="patientId"> |
|
|
|
|
|
|
|
|
|
|
|
insert into patient_cure |
|
|
|
insert into patient_cure |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<if test="patientId != null">patient_id,</if> |
|
|
|
<if test="patientId != null">patient_id,</if> |
|
|
@ -145,11 +144,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</trim> select |
|
|
|
</trim> select |
|
|
|
patient_id,patient_name,patient_age,patient_sex,patient_id_card,description,current_location,temperature,diagnosed_time,is_emergency,is_touch,is_high,is_dead |
|
|
|
patient_id,patient_name,patient_age,patient_sex,patient_id_card,description,current_location,temperature,diagnosed_time,is_emergency,is_touch,is_high,is_dead |
|
|
|
from patient_manage where patient_id not in(SELECT patient_id=#{patientId} from patient_cure ); |
|
|
|
from patient_manage where patient_id not in(SELECT patient_id=#{patientId} from patient_cure ); |
|
|
|
update patient_manage set is_dead='1' where patient_id=#{patientId}; |
|
|
|
|
|
|
|
</insert> |
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertDeadPatientManage" parameterType="PatientManage" useGeneratedKeys="true" keyProperty="patientId"> |
|
|
|
<insert id="insertDeadPatientManage" parameterType="PatientManage" useGeneratedKeys="true" keyProperty="patientId"> |
|
|
|
|
|
|
|
|
|
|
|
insert into patient_dead |
|
|
|
insert into patient_dead |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<if test="patientId != null">patient_id,</if> |
|
|
|
<if test="patientId != null">patient_id,</if> |
|
|
@ -167,20 +164,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="isDead != null">is_dead,</if> |
|
|
|
<if test="isDead != null">is_dead,</if> |
|
|
|
</trim> |
|
|
|
</trim> |
|
|
|
select patient_id,patient_name,patient_age,patient_sex,patient_id_card,description,current_location,temperature,diagnosed_time,is_emergency,is_touch,is_high,is_dead |
|
|
|
select patient_id,patient_name,patient_age,patient_sex,patient_id_card,description,current_location,temperature,diagnosed_time,is_emergency,is_touch,is_high,is_dead |
|
|
|
from patient_manage where patient_id not in(SELECT patient_id=#{patientId} from patient_dead ); |
|
|
|
from patient_manage where patient_id_card not in(SELECT patient_id_card=#{patientIdCard} from patient_dead ); |
|
|
|
</insert> |
|
|
|
</insert> |
|
|
|
<update id="updateIsDead" parameterType="PatientManage"> |
|
|
|
|
|
|
|
update patient_manage |
|
|
|
|
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
|
|
|
|
<if test="isDead != null">is_dead = '0',</if> |
|
|
|
|
|
|
|
</trim> |
|
|
|
|
|
|
|
where patient_id = #{patientId} |
|
|
|
|
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="updateIsCure" parameterType="PatientManage"> |
|
|
|
|
|
|
|
update patient_manage |
|
|
|
|
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
|
|
|
|
<if test="isDead != null">is_dead = '0',</if> |
|
|
|
|
|
|
|
</trim> |
|
|
|
|
|
|
|
where patient_id = #{patientId} |
|
|
|
|
|
|
|
</update> |
|
|
|
|
|
|
|
</mapper> |
|
|
|
</mapper> |