PostDischargePatientManage/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml

885 lines
47 KiB
XML
Raw Normal View History

<?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.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper">
<resultMap type="SignPatientManageRouteNode" id="SignPatientManageRouteNodeResult">
<result property="id" column="id"/>
<result property="manageRouteId" column="manage_route_id"/>
<result property="manageRouteName" column="manage_route_name"/>
<result property="routeNodeId" column="route_node_id"/>
<result property="routeNodeName" column="route_node_name"/>
<result property="routeNodeDay" column="route_node_day"/>
<result property="taskType" column="task_type"/>
<result property="taskStatus" column="task_status"/>
<result property="taskSubdivision" column="task_subdivision"/>
2024-07-11 11:09:36 +08:00
<result property="taskNodeType" column="task_node_type"/>
<result property="secondClassifyDescribe" column="second_classify_describe"/>
<result property="executeTime" column="execute_time"/>
<result property="phonePushSign" column="phone_push_sign"/>
<result property="phoneId" column="phone_id"/>
<result property="phoneTemplateId" column="phone_template_id"/>
<result property="phoneTemplateName" column="phone_template_name"/>
<result property="phoneNodeContent" column="phone_node_content"/>
<result property="phoneRedialTimes" column="phone_redial_times"/>
<result property="phoneTimeInterval" column="phone_time_interval"/>
<result property="phoneMessageRemind" column="phone_message_remind"/>
<result property="phoneMessageTemplateId" column="phone_message_template_id"/>
<result property="phoneMessageTemplateName" column="phone_message_template_name"/>
2024-06-25 17:41:41 +08:00
<result property="phoneMessageTemplateContent" column="phone_message_template_content"/>
<result property="questionInfoId" column="question_info_id"/>
<result property="questionnaireName" column="questionnaire_name"/>
<result property="questionnaireContent" column="questionnaire_content"/>
<result property="questionExpirationDate" column="question_expiration_date"/>
<result property="propagandaInfoId" column="propaganda_info_id"/>
<result property="propagandaTitle" column="propaganda_title"/>
<result property="propagandaContent" column="propaganda_content"/>
<result property="messagePushSign" column="message_push_sign"/>
2024-04-16 14:23:10 +08:00
<result property="messageTemplateId" column="message_template_id"/>
<result property="messageTemplateName" column="message_template_name"/>
<result property="messagePreview" column="message_preview"/>
<result property="messageNodeContent" column="message_node_content"/>
<result property="officialPushSign" column="official_push_sign"/>
<result property="officialTemplateId" column="official_template_id"/>
<result property="officialTemplateName" column="official_template_name"/>
<result property="officialRemindContent" column="official_remind_content"/>
<result property="officialNodeContent" column="official_node_content"/>
<result property="appletPushSign" column="applet_push_sign"/>
<result property="appletTemplateId" column="applet_template_id"/>
<result property="appletTemplateName" column="applet_template_name"/>
<result property="appletRemindContent" column="applet_remind_content"/>
<result property="appletPromptDescription" column="applet_prompt_description"/>
<result property="appletNodeContent" column="applet_node_content"/>
2024-06-28 14:19:22 +08:00
<result property="followTemplateId" column="follow_template_id"/>
<result property="followTemplateName" column="follow_template_name"/>
<result property="routeCheckStatus" column="route_check_status"/>
<result property="routeCheckPerson" column="route_check_person"/>
<result property="routeCheckDate" column="route_check_date"/>
<result property="routeCheckRemark" column="route_check_remark"/>
<result property="routeNodeRemark" column="route_node_remark"/>
<result property="nodeExecuteStatus" column="node_execute_status"/>
<result property="routeHandleRemark" column="route_handle_remark"/>
<result property="routeHandleId" column="route_handle_id"/>
<result property="routeHandlePerson" column="route_handle_person"/>
<result property="routeLink" column="route_link"/>
2024-03-28 17:48:09 +08:00
<result property="textRemindContent" column="text_remind_content"/>
2024-04-18 09:16:02 +08:00
<result property="nodeContent" column="node_content"/>
<result property="messageStatus" column="message_status"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
2024-06-27 16:14:03 +08:00
<result property="phoneDialMethod" column="phone_dial_method"/>
2024-07-30 13:36:51 +08:00
<result property="phoneNodeExecuteResultStatus" column="phone_node_execute_result_status"/>
<result property="messageNodeExecuteResultStatus" column="message_node_execute_result_status"/>
<result property="officialNodeExecuteResultStatus" column="official_node_execute_result_status"/>
<result property="appletNodeExecuteResultStatus" column="applet_node_execute_result_status"/>
<result property="nodeFinishDate" column="node_finish_date"/>
</resultMap>
<sql id="selectSignPatientManageRouteNodeVo">
2024-07-30 13:36:51 +08:00
select id, manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day, task_type, task_status, task_subdivision, task_node_type, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name,phone_message_template_content,question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, follow_template_id, follow_template_name, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, node_content,message_status, del_flag, create_by, create_time, update_by, update_time, phone_dial_method, phone_node_execute_result_status, message_node_execute_result_status, official_node_execute_result_status, applet_node_execute_result_status, node_finish_date from sign_patient_manage_route_node
</sql>
2024-04-17 16:55:51 +08:00
<select id="selectSignPatientManageRouteNodeList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto" resultMap="SignPatientManageRouteNodeResult">
<include refid="selectSignPatientManageRouteNodeVo"/>
<where>
del_flag = 0
<if test="manageRouteId != null ">
and manage_route_id = #{manageRouteId}
</if>
<if test="manageRouteName != null and manageRouteName != ''">
and manage_route_name like concat('%', #{manageRouteName}, '%')
</if>
<if test="routeNodeId != null">
and route_node_id = #{routeNodeId}
</if>
<if test="routeNodeName != null and routeNodeName != ''">
and route_node_name like concat('%', #{routeNodeName}, '%')
</if>
<if test="routeNodeDay != null ">
and route_node_day = #{routeNodeDay}
</if>
<if test="taskType != null and taskType != ''">
and task_type = #{taskType}
</if>
<if test="taskStatus != null and taskStatus != ''">
and task_status = #{taskStatus}
2024-07-11 11:09:36 +08:00
</if>
<if test="taskNodeType != null and taskNodeType != ''">
and task_node_type = #{taskStatus}
</if>
2024-04-17 16:55:51 +08:00
<if test="taskTypeList != null and taskTypeList.size > 0">
and
<foreach collection="taskTypeList" item="item" index="index" open="(" close=")" separator="or">
2024-04-18 17:59:38 +08:00
task_type = #{item}
2024-04-17 16:55:51 +08:00
</foreach>
</if>
<if test="nodeExecuteStatus != null and nodeExecuteStatus != ''">
and node_execute_status = #{nodeExecuteStatus}
</if>
2024-06-27 16:14:03 +08:00
<if test="phoneDialMethod != null and phoneDialMethod != ''">
and phone_dial_method = #{phoneDialMethod}
</if>
</where>
</select>
2024-05-28 17:20:17 +08:00
<select id="selectPatientManageNodeList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto"
resultType="com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo">
select node.id, node.manage_route_id, node.manage_route_name, node.route_node_id, node.route_node_name, node.route_node_day,
node.task_type, node.task_subdivision, node.execute_time,
node.node_execute_status, type.task_type_name as taskTypeName, part.task_partition_name as taskPartitionDictName
from sign_patient_manage_route_node node
left join task_type_dict type on node.task_type = type.task_type_code
left join task_partition_dict part on part.task_partition_code = node.task_subdivision
<where>
node.del_flag = 0
<if test="manageRouteId != null ">
and node.manage_route_id = #{manageRouteId}
</if>
<if test="taskStatus != null and taskStatus != ''">
and node.task_status = #{taskStatus}
</if>
<if test="nodeExecuteStatus != null and nodeExecuteStatus != ''">
and node.node_execute_status = #{nodeExecuteStatus}
</if>
</where>
</select>
<select id="selectSignPatientManageRouteNodeById" parameterType="Long" resultMap="SignPatientManageRouteNodeResult">
<include refid="selectSignPatientManageRouteNodeVo"/>
where id = #{id}
</select>
<select id="getNodeList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto"
resultMap="SignPatientManageRouteNodeResult">
select node.id, node.manage_route_id, node.manage_route_name, node.route_node_id, node.route_node_name, node.route_node_day, node.task_type,
node.task_status, node.task_subdivision,node.second_classify_describe, node.execute_time, node.phone_push_sign, node.phone_id,
node.phone_template_id, node.phone_template_name, node.phone_node_content, node.phone_redial_times, node.phone_time_interval,
2024-06-25 17:41:41 +08:00
node.phone_message_remind, node.phone_message_template_id, node.phone_message_template_name,node.phone_message_template_content,
node.question_info_id, node.questionnaire_name, node.questionnaire_content, node.question_expiration_date,
2024-06-28 14:19:22 +08:00
node.propaganda_info_id, node.propaganda_title, node.propaganda_content,node.follow_template_id, node.follow_template_name,
node.message_push_sign, node.message_template_id, node.message_template_name,node.message_preview, node.message_node_content,
node.official_push_sign, node.official_template_id, node.official_template_name, node.official_remind_content, node.official_node_content,
node.applet_push_sign, node.applet_template_id, node.applet_template_name, node.applet_remind_content, node.applet_prompt_description, node.applet_node_content,
node.route_check_status, node.route_check_person, node.route_check_date, node.route_check_remark, node.route_node_remark,
2024-07-11 11:09:36 +08:00
node.node_execute_status, node.route_handle_remark, node.route_handle_id, node.route_handle_person, node.route_link,node.text_remind_content,node.node_content,node.phone_dial_method,node.task_node_type
from sign_patient_manage_route_node node
left join sign_patient_manage_route route on node.manage_route_id = route.id
<where>
node.del_flag = 0
<if test="patientId != null">
and route.patient_id = #{patientId}
</if>
<if test="taskType != null and taskType != ''">
2024-05-30 17:54:56 +08:00
<choose>
<when test="taskType == 'PROPAGANDA_ARTICLE'.toString()">
and node.propaganda_info_id is not null
</when>
<otherwise>
and node.task_type = #{taskType}
</otherwise>
</choose>
</if>
2024-04-16 09:56:09 +08:00
<if test="taskCreateType != null and taskCreateType != ''">
and route.task_create_type = #{taskCreateType}
</if>
<choose>
<when test="routeCheckStatus != null and routeCheckStatus == 'UNAUDITED'">
and node.route_check_status is null
</when>
<when test="routeCheckStatus != null and routeCheckStatus == 'AGREE'">
and node.route_check_status = #{routeCheckStatus}
</when>
<when test="routeCheckStatus != null and routeCheckStatus == 'DISAGREE'">
and node.route_check_status = #{routeCheckStatus}
</when>
</choose>
2024-04-16 14:23:10 +08:00
<if test="signPatientRecordId != null">
and route.sign_patient_record_id = #{signPatientRecordId}
</if>
</where>
</select>
<insert id="insertSignPatientManageRouteNode" parameterType="SignPatientManageRouteNode" useGeneratedKeys="true"
keyProperty="id">
insert into sign_patient_manage_route_node
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="manageRouteId != null">manage_route_id,
</if>
<if test="manageRouteName != null">manage_route_name,
</if>
<if test="routeNodeId != null">route_node_id,
</if>
<if test="routeNodeName != null">route_node_name,
</if>
<if test="routeNodeDay != null">route_node_day,
</if>
<if test="taskType != null">task_type,
</if>
<if test="taskStatus != null">task_status,
</if>
<if test="taskSubdivision != null">task_subdivision,
</if>
2024-07-11 11:09:36 +08:00
<if test="taskNodeType != null">task_node_type,
</if>
<if test="secondClassifyDescribe != null">second_classify_describe,
</if>
<if test="executeTime != null">execute_time,
</if>
<if test="phonePushSign != null">phone_push_sign,
</if>
<if test="phoneId != null">phone_id,
</if>
<if test="phoneTemplateId != null">phone_template_id,
</if>
<if test="phoneTemplateName != null">phone_template_name,
</if>
<if test="phoneNodeContent != null">phone_node_content,
</if>
<if test="phoneRedialTimes != null">phone_redial_times,
</if>
<if test="phoneTimeInterval != null">phone_time_interval,
</if>
<if test="phoneMessageRemind != null">phone_message_remind,
</if>
<if test="phoneMessageTemplateId != null">phone_message_template_id,
</if>
<if test="phoneMessageTemplateName != null">phone_message_template_name,
</if>
2024-06-25 17:41:41 +08:00
<if test="phoneMessageTemplateContent != null">phone_message_template_content,
</if>
<if test="questionInfoId != null">question_info_id,
</if>
<if test="questionnaireName != null">questionnaire_name,
</if>
<if test="questionnaireContent != null">questionnaire_content,
</if>
<if test="questionExpirationDate != null">question_expiration_date,
</if>
<if test="propagandaInfoId != null">propaganda_info_id,
</if>
<if test="propagandaTitle != null">propaganda_title,
</if>
<if test="propagandaContent != null">propaganda_content,
</if>
<if test="messagePushSign != null">message_push_sign,
</if>
2024-04-16 14:23:10 +08:00
<if test="messageTemplateId != null">message_template_id,
</if>
<if test="messageTemplateName != null">message_template_name,
</if>
<if test="messagePreview != null">message_preview,
</if>
<if test="messageNodeContent != null">message_node_content,
</if>
<if test="officialPushSign != null">official_push_sign,
</if>
<if test="officialTemplateId != null">official_template_id,
</if>
<if test="officialTemplateName != null">official_template_name,
</if>
<if test="officialRemindContent != null">official_remind_content,
</if>
<if test="officialNodeContent != null">official_node_content,
</if>
<if test="appletPushSign != null">applet_push_sign,
</if>
<if test="appletTemplateId != null">applet_template_id,
</if>
<if test="appletTemplateName != null">applet_template_name,
</if>
<if test="appletRemindContent != null">applet_remind_content,
</if>
<if test="appletPromptDescription != null">applet_prompt_description,
</if>
<if test="appletNodeContent != null">applet_node_content,
</if>
<if test="routeCheckStatus != null">route_check_status,
</if>
<if test="routeCheckPerson != null">route_check_person,
</if>
<if test="routeCheckDate != null">route_check_date,
</if>
<if test="routeCheckRemark != null">route_check_remark,
</if>
<if test="routeNodeRemark != null">route_node_remark,
</if>
<if test="nodeExecuteStatus != null">node_execute_status,
</if>
<if test="routeHandleRemark != null">route_handle_remark,
</if>
2024-06-17 14:12:13 +08:00
<if test="phoneConnectStatus != null">phone_connect_status,
</if>
<if test="routeHandleId != null">route_handle_id,
</if>
<if test="routeHandlePerson != null">route_handle_person,
</if>
<if test="routeLink != null">route_link,
</if>
2024-03-28 17:48:09 +08:00
<if test="textRemindContent != null">text_remind_content,
</if>
2024-04-18 09:16:02 +08:00
<if test="nodeContent != null">node_content,
</if>
<if test="delFlag != null">del_flag,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
2024-06-27 16:14:03 +08:00
<if test="phoneDialMethod != null">phone_dial_method,
</if>
2024-06-28 14:19:22 +08:00
<if test="followTemplateId != null">follow_template_id,
</if>
<if test="followTemplateName != null">follow_template_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="manageRouteId != null">#{manageRouteId},
</if>
<if test="manageRouteName != null">#{manageRouteName},
</if>
<if test="routeNodeId != null">#{routeNodeId},
</if>
<if test="routeNodeName != null">#{routeNodeName},
</if>
<if test="routeNodeDay != null">#{routeNodeDay},
</if>
<if test="taskType != null">#{taskType},
</if>
<if test="taskStatus != null">#{taskStatus},
</if>
<if test="taskSubdivision != null">#{taskSubdivision},
</if>
2024-07-11 11:09:36 +08:00
<if test="taskNodeType != null">#{taskNodeType},
</if>
<if test="secondClassifyDescribe != null">#{secondClassifyDescribe},
</if>
<if test="executeTime != null">#{executeTime},
</if>
<if test="phonePushSign != null">#{phonePushSign},
</if>
<if test="phoneId != null">#{phoneId},
</if>
<if test="phoneTemplateId != null">#{phoneTemplateId},
</if>
<if test="phoneTemplateName != null">#{phoneTemplateName},
</if>
<if test="phoneNodeContent != null">#{phoneNodeContent},
</if>
<if test="phoneRedialTimes != null">#{phoneRedialTimes},
</if>
<if test="phoneTimeInterval != null">#{phoneTimeInterval},
</if>
<if test="phoneMessageRemind != null">#{phoneMessageRemind},
</if>
<if test="phoneMessageTemplateId != null">#{phoneMessageTemplateId},
</if>
<if test="phoneMessageTemplateName != null">#{phoneMessageTemplateName},
</if>
2024-06-25 17:41:41 +08:00
<if test="phoneMessageTemplateContent != null">#{phoneMessageTemplateContent},
</if>
<if test="questionInfoId != null">#{questionInfoId},
</if>
<if test="questionnaireName != null">#{questionnaireName},
</if>
<if test="questionnaireContent != null">#{questionnaireContent},
</if>
<if test="questionExpirationDate != null">#{questionExpirationDate},
</if>
<if test="propagandaInfoId != null">#{propagandaInfoId},
</if>
<if test="propagandaTitle != null">#{propagandaTitle},
</if>
<if test="propagandaContent != null">#{propagandaContent},
</if>
<if test="messagePushSign != null">#{messagePushSign},
</if>
<if test="messageTemplateId != null">#{messageTemplateId},
</if>
<if test="messageTemplateName != null">#{messageTemplateName},
</if>
<if test="messagePreview != null">#{messagePreview},
</if>
<if test="messageNodeContent != null">#{messageNodeContent},
</if>
<if test="officialPushSign != null">#{officialPushSign},
</if>
<if test="officialTemplateId != null">#{officialTemplateId},
</if>
<if test="officialTemplateName != null">#{officialTemplateName},
</if>
<if test="officialRemindContent != null">#{officialRemindContent},
</if>
<if test="officialNodeContent != null">#{officialNodeContent},
</if>
<if test="appletPushSign != null">#{appletPushSign},
</if>
<if test="appletTemplateId != null">#{appletTemplateId},
</if>
<if test="appletTemplateName != null">#{appletTemplateName},
</if>
<if test="appletRemindContent != null">#{appletRemindContent},
</if>
<if test="appletPromptDescription != null">#{appletPromptDescription},
</if>
<if test="appletNodeContent != null">#{appletNodeContent},
</if>
<if test="routeCheckStatus != null">#{routeCheckStatus},
</if>
<if test="routeCheckPerson != null">#{routeCheckPerson},
</if>
<if test="routeCheckDate != null">#{routeCheckDate},
</if>
<if test="routeCheckRemark != null">#{routeCheckRemark},
</if>
<if test="routeNodeRemark != null">#{routeNodeRemark},
</if>
<if test="nodeExecuteStatus != null">#{nodeExecuteStatus},
</if>
<if test="routeHandleRemark != null">#{routeHandleRemark},
</if>
2024-06-17 14:12:13 +08:00
<if test="phoneConnectStatus != null">#{phoneConnectStatus},
</if>
<if test="routeHandleId != null">#{routeHandleId},
</if>
<if test="routeHandlePerson != null">#{routeHandlePerson},
</if>
<if test="routeLink != null">#{routeLink},
</if>
2024-03-28 17:48:09 +08:00
<if test="textRemindContent != null">#{textRemindContent},
</if>
2024-04-18 09:16:02 +08:00
<if test="nodeContent != null">#{nodeContent},
</if>
<if test="delFlag != null">#{delFlag},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
2024-06-28 14:19:22 +08:00
<if test="phoneDialMethod != null ">#{phoneDialMethod},
</if>
<if test="followTemplateId != null">#{followTemplateId},
</if>
<if test="followTemplateName != null">#{followTemplateName},
2024-06-27 16:14:03 +08:00
</if>
</trim>
</insert>
<insert id="insertBatch">
2024-07-11 11:09:36 +08:00
insert into sign_patient_manage_route_node(manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day, task_type, task_status, task_subdivision, task_node_type, second_classify_describe,
execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id,
2024-07-04 09:06:32 +08:00
phone_message_template_name, phone_message_template_content,question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign,
2024-04-16 14:23:10 +08:00
message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content,
2024-06-25 17:41:41 +08:00
official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content,
route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark,phone_connect_status,
2024-06-28 14:19:22 +08:00
route_handle_id, route_handle_person, route_link, text_remind_content,node_content, del_flag, create_by, create_time, update_by, update_time,phone_dial_method,follow_template_id, follow_template_name)
values
<foreach collection="nodeList" item="item" separator=",">
2024-07-11 11:09:36 +08:00
(#{item.manageRouteId},#{item.manageRouteName},#{item.routeNodeId},#{item.routeNodeName},#{item.routeNodeDay},#{item.taskType},#{item.taskStatus},#{item.taskSubdivision},#{item.taskNodeType},#{item.secondClassifyDescribe},
2024-07-04 09:06:32 +08:00
#{item.executeTime},#{item.phonePushSign},#{item.phoneId},#{item.phoneTemplateId},#{item.phoneTemplateName},#{item.phoneNodeContent},#{item.phoneRedialTimes},#{item.phoneTimeInterval},#{item.phoneMessageRemind},#{item.phoneMessageTemplateId},
#{item.phoneMessageTemplateName},#{item.phoneMessageTemplateContent},
#{item.questionInfoId},#{item.questionnaireName},#{item.questionnaireContent},#{item.questionExpirationDate},#{item.propagandaInfoId},#{item.propagandaTitle},#{item.propagandaContent},#{item.messagePushSign},#{item.messageTemplateId},
#{item.messageTemplateName},#{item.messagePreview},#{item.messageNodeContent},#{item.officialPushSign},#{item.officialTemplateId},#{item.officialTemplateName},#{item.officialRemindContent},#{item.officialNodeContent},
2024-06-25 17:41:41 +08:00
#{item.appletPushSign},#{item.appletTemplateId},#{item.appletTemplateName},#{item.appletRemindContent},#{item.appletPromptDescription},#{item.appletNodeContent},
#{item.routeCheckStatus},#{item.routeCheckPerson},#{item.routeCheckDate},#{item.routeCheckRemark},#{item.routeNodeRemark},#{item.nodeExecuteStatus},#{item.routeHandleRemark},#{item.phoneConnectStatus},
2024-06-28 14:19:22 +08:00
#{item.routeHandleId},#{item.routeHandlePerson},#{item.routeLink},#{item.textRemindContent},#{item.nodeContent},0,#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.phoneDialMethod},#{item.followTemplateId},#{item.followTemplateName})
</foreach>
</insert>
<update id="updateSignPatientManageRouteNode" parameterType="SignPatientManageRouteNode">
update sign_patient_manage_route_node
<trim prefix="SET" suffixOverrides=",">
<if test="manageRouteId != null">manage_route_id =
#{manageRouteId},
</if>
<if test="manageRouteName != null">manage_route_name =
#{manageRouteName},
</if>
<if test="routeNodeId != null">route_node_id =
#{routeNodeId},
</if>
<if test="routeNodeName != null">route_node_name =
#{routeNodeName},
</if>
<if test="routeNodeDay != null">route_node_day =
#{routeNodeDay},
</if>
<if test="taskType != null">task_type =
#{taskType},
</if>
<if test="taskStatus != null">task_status =
#{taskStatus},
</if>
<if test="taskSubdivision != null">task_subdivision =
#{taskSubdivision},
</if>
2024-07-11 11:09:36 +08:00
<if test="taskNodeType != null">task_node_type =
#{taskNodeType},
</if>
<if test="secondClassifyDescribe != null">second_classify_describe =
#{secondClassifyDescribe},
</if>
<if test="executeTime != null">execute_time =
#{executeTime},
</if>
<if test="phonePushSign != null">phone_push_sign =
#{phonePushSign},
</if>
<if test="phoneId != null">phone_id =
#{phoneId},
</if>
<if test="phoneTemplateId != null">phone_template_id =
#{phoneTemplateId},
</if>
<if test="phoneTemplateName != null">phone_template_name =
#{phoneTemplateName},
</if>
<if test="phoneNodeContent != null">phone_node_content =
#{phoneNodeContent},
</if>
<if test="phoneRedialTimes != null">phone_redial_times =
#{phoneRedialTimes},
</if>
<if test="phoneTimeInterval != null">phone_time_interval =
#{phoneTimeInterval},
</if>
<if test="phoneMessageRemind != null">phone_message_remind =
#{phoneMessageRemind},
</if>
<if test="phoneMessageTemplateId != null">phone_message_template_id =
#{phoneMessageTemplateId},
</if>
<if test="phoneMessageTemplateName != null">phone_message_template_name =
#{phoneMessageTemplateName},
</if>
2024-06-25 17:41:41 +08:00
<if test="phoneMessageTemplateContent != null">phone_message_template_content =
#{phoneMessageTemplateContent},
</if>
<if test="questionInfoId != null">question_info_id =
#{questionInfoId},
</if>
<if test="questionnaireName != null">questionnaire_name =
#{questionnaireName},
</if>
<if test="questionnaireContent != null">questionnaire_content =
#{questionnaireContent},
</if>
<if test="questionExpirationDate != null">question_expiration_date =
#{questionExpirationDate},
</if>
<if test="propagandaInfoId != null">propaganda_info_id =
#{propagandaInfoId},
</if>
<if test="propagandaTitle != null">propaganda_title =
#{propagandaTitle},
</if>
<if test="propagandaContent != null">propaganda_content =
#{propagandaContent},
</if>
<if test="messagePushSign != null">message_push_sign =
#{messagePushSign},
</if>
2024-04-16 14:23:10 +08:00
<if test="messageTemplateId != null">message_template_id =
#{messageTemplateId},
</if>
<if test="messageTemplateName != null">message_template_name =
#{messageTemplateName},
</if>
<if test="messagePreview != null">message_preview =
#{messagePreview},
</if>
<if test="messageNodeContent != null">message_node_content =
#{messageNodeContent},
</if>
<if test="officialPushSign != null">official_push_sign =
#{officialPushSign},
</if>
<if test="officialTemplateId != null">official_template_id =
#{officialTemplateId},
</if>
<if test="officialTemplateName != null">official_template_name =
#{officialTemplateName},
</if>
<if test="officialRemindContent != null">official_remind_content =
#{officialRemindContent},
</if>
<if test="officialNodeContent != null">official_node_content =
#{officialNodeContent},
</if>
<if test="appletPushSign != null">applet_push_sign =
#{appletPushSign},
</if>
<if test="appletTemplateId != null">applet_template_id =
#{appletTemplateId},
</if>
<if test="appletTemplateName != null">applet_template_name =
#{appletTemplateName},
</if>
<if test="appletRemindContent != null">applet_remind_content =
#{appletRemindContent},
</if>
<if test="appletPromptDescription != null">applet_prompt_description =
#{appletPromptDescription},
</if>
<if test="appletNodeContent != null">applet_node_content =
#{appletNodeContent},
</if>
<if test="routeCheckStatus != null">route_check_status =
#{routeCheckStatus},
</if>
<if test="routeCheckPerson != null">route_check_person =
#{routeCheckPerson},
</if>
<if test="routeCheckDate != null">route_check_date =
#{routeCheckDate},
</if>
<if test="routeCheckRemark != null">route_check_remark =
#{routeCheckRemark},
</if>
<if test="routeNodeRemark != null">route_node_remark =
#{routeNodeRemark},
</if>
<if test="nodeExecuteStatus != null">node_execute_status =
#{nodeExecuteStatus},
</if>
<if test="routeHandleRemark != null">route_handle_remark =
#{routeHandleRemark},
</if>
2024-06-17 14:12:13 +08:00
<if test="phoneConnectStatus != null">phone_connect_status =
#{phoneConnectStatus},
</if>
<if test="routeHandleId != null">route_handle_id =
#{routeHandleId},
</if>
<if test="routeHandlePerson != null">route_handle_person =
#{routeHandlePerson},
</if>
<if test="routeLink != null">route_link =
#{routeLink},
</if>
2024-03-28 17:48:09 +08:00
<if test="textRemindContent != null">text_remind_content =
#{textRemindContent},
</if>
2024-04-18 09:16:02 +08:00
<if test="nodeContent != null">node_content =
#{nodeContent},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
2024-06-27 16:14:03 +08:00
<if test="phoneDialMethod != null ">phone_dial_method =
#{phoneDialMethod},
</if>
2024-06-28 14:19:22 +08:00
<if test="followTemplateId != null">follow_template_id =
2024-07-30 16:01:52 +08:00
#{followTemplateId},
2024-06-28 14:19:22 +08:00
</if>
<if test="followTemplateName != null">follow_template_name =
2024-07-30 16:01:52 +08:00
#{followTemplateName},
</if>
<if test="phoneNodeExecuteResultStatus != null">phone_node_execute_result_status =
#{phoneNodeExecuteResultStatus},
</if>
<if test="phoneMessageNodeExecuteResultStatus != null">phone_message_node_execute_result_status =
#{phoneMessageNodeExecuteResultStatus},
</if>
<if test="messageNodeExecuteResultStatus != null">message_node_execute_result_status =
#{messageNodeExecuteResultStatus},
</if>
<if test="officialNodeExecuteResultStatus != null">official_node_execute_result_status =
#{officialNodeExecuteResultStatus},
</if>
<if test="appletNodeExecuteResultStatus != null">applet_node_execute_result_status =
#{appletNodeExecuteResultStatus},
</if>
<if test="nodeFinishDate != null">node_finish_date =
#{nodeFinishDate},
2024-06-28 14:19:22 +08:00
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSignPatientManageRouteNodeById" parameterType="Long">
delete from sign_patient_manage_route_node where id = #{id}
</delete>
<update id="deleteSignPatientManageRouteNodeByIds" parameterType="String">
update sign_patient_manage_route_node set del_flag = 1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="deleteRouteNodeByManageRouteId">
update sign_patient_manage_route_node set del_flag = 1
2024-04-02 16:55:08 +08:00
where manage_route_id = #{manageRouteId}
</update>
2024-06-03 17:54:37 +08:00
<select id="selectPatientTaskList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto" resultType="com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo">
select patient.id as patientId, patient.patient_name,
patient.patient_phone,
patient.family_member_phone,
patient.birth_date,
patient.card_no,
patient.sex,
patient.address,
patient.patient_type, patient.visit_method, patient.attending_physician_id, patient.attending_physician_name, patient.main_diagnosis,
patient.hospital_agency_id, patient.hospital_agency_name, patient.campus_agency_id, patient.campus_agency_name,
2024-04-16 09:56:09 +08:00
patient.department_id, patient.department_name,patient.ward_id, patient.ward_name, patient.patient_visit_record_id,patient.in_hospital_number, patient.visit_date, patient.discharge_time,
patient.patient_source, patient.surgical_name,route.sign_patient_record_id, node.id as manageRouteNodeId, node.manage_route_id, node.manage_route_name,node.route_check_status
from sign_patient_manage_route_node node
left join sign_patient_manage_route route on node.manage_route_id = route.id
left join patient_info patient on route.patient_id = patient.id
<where>
node.del_flag = 0
<if test="patientName != null and patientName != ''">
and patient.patient_name = #{patientName}
</if>
<if test="mainDiagnosis != null and mainDiagnosis != ''">
and patient.main_diagnosis like concat('%', #{mainDiagnosis}, '%')
</if>
2024-04-10 17:37:35 +08:00
<choose>
2024-04-18 17:59:38 +08:00
<when test="routeCheckStatus != null and routeCheckStatus == 'UNAUDITED'.toString()">
2024-04-16 09:56:09 +08:00
and node.route_check_status is null
</when>
2024-04-18 17:59:38 +08:00
<when test="routeCheckStatus != null and routeCheckStatus == 'AGREE'.toString()">
2024-04-16 09:56:09 +08:00
and node.route_check_status = #{routeCheckStatus}
</when>
2024-04-18 17:59:38 +08:00
<when test="routeCheckStatus != null and routeCheckStatus == 'DISAGREE'.toString()">
2024-04-10 17:37:35 +08:00
and node.route_check_status = #{routeCheckStatus}
</when>
</choose>
<if test="hospitalAgencyId != null ">
and patient.hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="campusAgencyId != null ">
and patient.campus_agency_id = #{campusAgencyId}
</if>
<if test="departmentId != null ">
and patient.department_id = #{departmentId}
</if>
<if test="wardId != null ">
and patient.ward_id = #{wardId}
</if>
2024-04-10 17:37:35 +08:00
<if test="dischargeTimeStart != null ">
and date_format(patient.discharge_time,'%y%m%d') &gt;= date_format(#{dischargeTimeStart},'%y%m%d')
</if>
2024-04-10 17:37:35 +08:00
<if test="dischargeTimeEnd != null ">
and date_format(patient.discharge_time,'%y%m%d') &lt;= date_format(#{dischargeTimeEnd},'%y%m%d')
</if>
2024-04-19 09:46:27 +08:00
<if test="taskCreateType != null ">
and route.task_create_type = #{taskCreateType}
</if>
<if test="patientSource != null ">
and patient.patient_source like concat('%', #{patientSource}, '%')
</if>
2024-06-05 15:32:39 +08:00
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
2024-04-16 09:56:09 +08:00
group by patient.hospital_agency_id, patient.id
</select>
2024-06-03 17:54:37 +08:00
<update id="updateMessageStatus">
update sign_patient_manage_route_node
set message_status = #{messageStatus}
where id = #{id}
</update>
2024-06-25 17:41:41 +08:00
<select id="selectByRouteId" resultType="com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo">
select
sdn.route_node_name routeNodeName,
sdn.route_node_day routeNodeDay,
sdn.execute_time executionTime,
2024-07-12 10:37:08 +08:00
GROUP_CONCAT(sdn.task_node_type SEPARATOR ',') as taskPartitionCodes,
2024-06-25 17:41:41 +08:00
GROUP_CONCAT(dic.dict_label SEPARATOR ',') as taskPartitionDictNames
from sign_patient_manage_route_node sdn
2024-07-12 10:37:08 +08:00
left join sys_dict_data dic on sdn.task_node_type = dic.dict_value
where sdn.manage_route_id = #{manageRouteId} and dic.dict_type ='task_node_type'
2024-06-25 17:41:41 +08:00
group by sdn.route_node_name, sdn.route_node_day
</select>
<select id="selectAuditNodeInfo" resultType="com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo">
select
2024-06-27 09:38:02 +08:00
node.*,
2024-06-25 17:41:41 +08:00
dic.dict_label as taskTypeName
from sign_patient_manage_route_node node
2024-07-12 10:37:08 +08:00
left join sys_dict_data dic on node.task_node_type = dic.dict_value
2024-06-27 09:38:02 +08:00
where node.manage_route_id in
<foreach item="manageRouteId" collection="manageRouteIds" open="(" separator="," close=")">
2024-06-25 17:41:41 +08:00
#{manageRouteId}
</foreach>
2024-07-12 10:37:08 +08:00
and dic.dict_type ='task_node_type'
2024-06-25 17:41:41 +08:00
</select>
2024-06-27 09:38:02 +08:00
<select id="selectNodesByManageIds" resultMap="SignPatientManageRouteNodeResult">
<include refid="selectSignPatientManageRouteNodeVo"/>
where manage_route_id in
<foreach item="manageRouteId" collection="manageRouteIds" open="(" separator="," close=")">
#{manageRouteId}
</foreach>
</select>
2024-07-16 08:59:49 +08:00
<select id="getRouteNodeContentList"
resultType="com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode">
select node_content
from sign_patient_manage_route spmr
LEFT JOIN special_disease_route sdr ON spmr.route_id = sdr.id
LEFT JOIN special_disease_node sdn ON sdn.route_id = sdr.id
where spmr.patient_id = #{patientId}
</select>
2024-07-23 18:05:38 +08:00
<select id="selectMessagePushSign"
resultType="com.xinelu.manage.vo.signpatientmanageroutenode.TextMessage">
select spmrn.id signPatientManageRouteNodeId,
spmrn.manage_route_name,
spmrn.message_push_sign,
spmrn.message_node_content,
spmrn.node_execute_status,
spmrn.route_node_name,
spmrn.route_node_day,
spmrn.task_node_type,
spmr.id manageRouteId,
pi.patient_phone,
pi.patient_type,
pi.admission_time,
pi.discharge_time,
pi.visit_date,
2024-07-24 10:40:48 +08:00
pi.visit_method,
tm.text_message_id
2024-07-23 18:05:38 +08:00
from sign_patient_manage_route_node spmrn
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
LEFT JOIN patient_info pi ON pi.id = spmr.patient_id
2024-07-24 10:40:48 +08:00
LEFT JOIN text_message tm ON tm.id = spmrn.message_template_id
2024-07-23 18:05:38 +08:00
where spmrn.message_push_sign = 1
and spmrn.del_flag = 0
and spmrn.node_execute_status = 'UNEXECUTED'
</select>
<update id="updateMessageStatusByIds">
update sign_patient_manage_route_node
set message_status = 'EXECUTED'
where id in
<foreach item="ids" collection="ids" open="(" separator="," close=")">
#{ids}
</foreach>
</update>
</mapper>