|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.acupuncture.system.persist.dao.FmsFollowupDao">
|
|
|
|
|
|
|
|
|
|
<select id="queryCommonQueue" resultType="com.acupuncture.system.domain.vo.FmsFollowupVo$FollowupQueueVO">
|
|
|
|
|
select
|
|
|
|
|
id,
|
|
|
|
|
name,
|
|
|
|
|
followup_method as followupMethod,
|
|
|
|
|
followup_type as followupType,
|
|
|
|
|
frequency,
|
|
|
|
|
followup_month as followupMonth,
|
|
|
|
|
person_in_charge as personInCharge,
|
|
|
|
|
person_in_charge_username as personInChargeUsername,
|
|
|
|
|
status,
|
|
|
|
|
create_by as createBy
|
|
|
|
|
from
|
|
|
|
|
fms_followup_queue
|
|
|
|
|
<where>
|
|
|
|
|
<if test="name != null and name != ''">
|
|
|
|
|
and name like concat('%', #{name}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectQueueList" resultType="com.acupuncture.system.domain.vo.FmsFollowupVo$FollowupQueueVO">
|
|
|
|
|
SELECT id,
|
|
|
|
|
name,
|
|
|
|
|
followup_method as followupMethod,
|
|
|
|
|
followup_type as followupType,
|
|
|
|
|
frequency,
|
|
|
|
|
followup_month as followupMonth,
|
|
|
|
|
person_in_charge as personInCharge,
|
|
|
|
|
person_in_charge_username as personInChargeUsername,
|
|
|
|
|
status,
|
|
|
|
|
create_by as createBy
|
|
|
|
|
FROM fms_followup_queue
|
|
|
|
|
WHERE del_flag = 0
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
and id = #{id}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="queryPatient" resultType="com.acupuncture.system.domain.vo.FmsFollowupVo$FollowupPatient">
|
|
|
|
|
select
|
|
|
|
|
patient_id as id,
|
|
|
|
|
queue_id as queueId,
|
|
|
|
|
name,
|
|
|
|
|
pinyin_full as pinyinFull,
|
|
|
|
|
pinyin_simple as pinyinSimple,
|
|
|
|
|
gender,
|
|
|
|
|
birth_date as birthDate,
|
|
|
|
|
ethnicity,
|
|
|
|
|
education_years as educationYears,
|
|
|
|
|
phone,
|
|
|
|
|
discharge_time as dischargeTime,
|
|
|
|
|
id_card_type as idCardType,
|
|
|
|
|
id_card as idCard,
|
|
|
|
|
tenant_id as tenantId,
|
|
|
|
|
create_by as createBy,
|
|
|
|
|
create_time as createTime
|
|
|
|
|
FROM fms_patient_queue_relation
|
|
|
|
|
WHERE del_flag = 0
|
|
|
|
|
AND queue_id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectTaskList" resultType="com.acupuncture.system.domain.vo.FmsFollowupVo$FollowupTaskVO"
|
|
|
|
|
parameterType="com.acupuncture.system.domain.dto.FmsFollowupDto$FollowupTaskQueryDTO">
|
|
|
|
|
SELECT
|
|
|
|
|
id,
|
|
|
|
|
name,
|
|
|
|
|
followup_method as followupMethod,
|
|
|
|
|
followup_type as followupType,
|
|
|
|
|
frequency,
|
|
|
|
|
followup_month as followupMonth,
|
|
|
|
|
person_in_charge as personInCharge,
|
|
|
|
|
person_in_charge_username as personInChargeUsername,
|
|
|
|
|
status,
|
|
|
|
|
create_by as createBy
|
|
|
|
|
FROM fms_followup_task
|
|
|
|
|
<where>
|
|
|
|
|
queue_id = #{dto.queueId}
|
|
|
|
|
AND status = #{dto.status}
|
|
|
|
|
<if test="dto.keywords != null and dto.keywords != ''">
|
|
|
|
|
AND (name LIKE CONCAT('%', #{dto.keywords}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.startAge != null">
|
|
|
|
|
AND age >= #{dto.startAge}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.endAge != null">
|
|
|
|
|
AND age <= #{dto.endAge}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="updateStatusToLost" parameterType="com.acupuncture.system.domain.dto.FmsFollowupDto$FollowupLostDTO">
|
|
|
|
|
UPDATE fms_followup_task
|
|
|
|
|
SET status = 2, lost_reason = #{dto.reason}
|
|
|
|
|
WHERE patient_id = #{dto.patientId} AND queue_id = #{dto.queueId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="completeFollowup" parameterType="com.acupuncture.system.domain.dto.FmsFollowupDto$FollowupCompleteDTO">
|
|
|
|
|
UPDATE fms_followup_task
|
|
|
|
|
SET status = 1, followuper = #{dto.followuper},
|
|
|
|
|
followup_time = #{dto.followupTime}, followup_text = #{dto.followupText}
|
|
|
|
|
WHERE patient_id = #{dto.patientId} AND queue_id = #{dto.queueId}
|
|
|
|
|
</update>
|
|
|
|
|
</mapper>
|