| | |
| | | <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/> |
| | | <result property="excep" column="excep"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="doctorOpinion" column="doctor_opinion"/> |
| | | <result property="suggest" column="suggest"/> |
| | | <result property="sendstate" column="sendstate"/> |
| | | <result property="inhospid" column="inhospid"/> |
| | |
| | | long_send_time, |
| | | openid, |
| | | remark, |
| | | doctor_opinion, |
| | | service_type, |
| | | libtemplateid, |
| | | libtemplatename, |
| | |
| | | from service_subtask |
| | | </sql> |
| | | |
| | | <!-- 完成时状态(finish_state)计算:仅当本次更新把 sendstate 置为 6(随访完成)时使用。 |
| | | <!-- 超时完成、延期完成逻辑 完成时状态(finish_state)计算:仅当本次更新把 sendstate 置为 6(随访完成)时使用。 |
| | | 基准截止时间 base = endtime + send_day(缺省1) + (Σ service_subtask_preachform.compensate_time + 1) 天, |
| | | 与 RyTask/RedisMqReceiver 的 isSubtaskDeadline 口径保持一致; |
| | | delay = COALESCE(service_task.delay_finish_days, 0); |
| | |
| | | AND visit_count > 1 |
| | | </if> |
| | | <if test="remark != null">and remark = #{remark}</if> |
| | | <if test="doctorOpinion != null and doctorOpinion != ''">and doctor_opinion like concat('%', #{doctorOpinion}, '%')</if> |
| | | <if test="suggest != null">and suggest = #{suggest}</if> |
| | | <if test="createBy != null">and create_by = #{createBy}</if> |
| | | <if test="taskGuid != null">and task_guid = #{taskGuid}</if> |
| | |
| | | <if test="nurseName != null ">nurse_name,</if> |
| | | <if test="nurseId != null ">nurse_id,</if> |
| | | <if test="remark != null ">remark,</if> |
| | | <if test="doctorOpinion != null ">doctor_opinion,</if> |
| | | <if test="suggest != null ">suggest,</if> |
| | | <if test="sendstate != null ">sendstate,</if> |
| | | <if test="inhospid != null ">inhospid,</if> |
| | |
| | | <if test="nurseName != null ">#{nurseName},</if> |
| | | <if test="nurseId != null ">#{nurseId},</if> |
| | | <if test="remark != null ">#{remark},</if> |
| | | <if test="doctorOpinion != null ">#{doctorOpinion},</if> |
| | | <if test="suggest != null ">#{suggest},</if> |
| | | <if test="sendstate != null ">#{sendstate},</if> |
| | | <if test="inhospid != null ">#{inhospid},</if> |
| | |
| | | <if test="nurseName != null ">nurse_name=#{nurseName},</if> |
| | | <if test="nurseId != null ">nurse_id=#{nurseId},</if> |
| | | <if test="remark != null ">remark=#{remark},</if> |
| | | <if test="doctorOpinion != null ">doctor_opinion=#{doctorOpinion},</if> |
| | | <if test="suggest != null ">suggest=#{suggest},</if> |
| | | <if test="inhospid != null ">inhospid=#{inhospid},</if> |
| | | <if test="patfrom != null ">patfrom=#{patfrom},</if> |
| | |
| | | <if test="nurseName != null ">nurse_name=#{nurseName},</if> |
| | | <if test="nurseId != null ">nurse_id=#{nurseId},</if> |
| | | <if test="remark != null ">remark=#{remark},</if> |
| | | <if test="doctorOpinion != null ">doctor_opinion=#{doctorOpinion},</if> |
| | | <if test="suggest != null ">suggest=#{suggest},</if> |
| | | <if test="inhospid != null ">inhospid=#{inhospid},</if> |
| | | <if test="patfrom != null ">patfrom=#{patfrom},</if> |
| | |
| | | <if test="nurseName != null ">nurse_name=#{nurseName},</if> |
| | | <if test="nurseId != null ">nurse_id=#{nurseId},</if> |
| | | <if test="remark != null ">remark=#{remark},</if> |
| | | <if test="doctorOpinion != null ">doctor_opinion=#{doctorOpinion},</if> |
| | | <if test="suggest != null ">suggest=#{suggest},</if> |
| | | <if test="inhospid != null ">inhospid=#{inhospid},</if> |
| | | <if test="patfrom != null ">patfrom=#{patfrom},</if> |
| | |
| | | <if test="nurseName != null ">nurse_name=#{nurseName},</if> |
| | | <if test="nurseId != null ">nurse_id=#{nurseId},</if> |
| | | <if test="remark != null ">remark=#{remark},</if> |
| | | <if test="doctorOpinion != null ">doctor_opinion=#{doctorOpinion},</if> |
| | | <if test="suggest != null ">suggest=#{suggest},</if> |
| | | <if test="inhospid != null ">inhospid=#{inhospid},</if> |
| | | <if test="patfrom != null ">patfrom=#{patfrom},</if> |
| | |
| | | continue_count, |
| | | continue_time_next, |
| | | task_situation, |
| | | finish_state, |
| | | is_manually_called |
| | | from service_subtask |
| | | where 1=1 |
| | |
| | | continue_time_next, |
| | | task_situation, |
| | | remark, |
| | | doctor_opinion, |
| | | finish_state, |
| | | is_manually_called |
| | | from service_subtask |
| | | where 1=1 |
| | |
| | | </if> |
| | | <if test="taskSituation != null"> |
| | | AND task_situation = #{taskSituation} |
| | | </if> |
| | | <if test="finishState != null"> |
| | | AND finish_state = #{finishState} |
| | | </if> |
| | | <if test="drcode != null and drcode != ''"> |
| | | AND drcode = #{drcode} |
| | |
| | | <select id="getSfStatisticsScriptDetails" parameterType="com.smartor.domain.ServiceSubtaskCountReq" |
| | | resultMap="ServiceSubtaskScriptCountResult"> |
| | | SELECT |
| | | a.id as scriptid, |
| | | a.templateid as templateid, |
| | | a.script_type, |
| | | MIN(a.id) as scriptid, |
| | | MIN(a.templateid) as templateid, |
| | | MIN(a.script_type) as script_type, |
| | | a.script_content, |
| | | b.subtask_type, |
| | | b.completed_quantity, |
| | | b.all_quantity, |
| | | ROUND(b.completed_quantity/b.all_quantity,2) as completed_percentage |
| | | SUM(b.completed_quantity) as completed_quantity, |
| | | SUM(b.all_quantity) as all_quantity, |
| | | ROUND(SUM(b.completed_quantity)/SUM(b.all_quantity),2) as completed_percentage |
| | | FROM |
| | | <if test="type == 1"> |
| | | ivr_task_template_script a |
| | |
| | | group by ssd.scriptid) b |
| | | ON a.id = b.scriptid |
| | | <!-- 适用单条查询 --> |
| | | <if test="scriptids != null"> |
| | | <if test="scriptids != null and scriptids != ''"> |
| | | AND a.scriptid in |
| | | (SELECT lib_script.scriptid FROM |
| | | svy_lib_template_script lib_script |
| | | WHERE lib_script.scriptid in (${scriptids})) |
| | | </if> |
| | | <!-- 同一道题会被复制到多个任务模板,按题目内容合并,保证一道题只返回一条 --> |
| | | GROUP BY a.script_content, b.subtask_type |
| | | ORDER BY MIN(a.id) |
| | | </select> |
| | | |
| | | <select id="getSfStatisticsScriptItemDetails" parameterType="com.smartor.domain.ServiceSubtaskCountReq" |
| | | resultMap="ServiceSubtaskScriptCountResult"> |
| | | SELECT |
| | | ssd.scriptid, |
| | | a.script_content, |
| | | ss.type as subtask_type, |
| | | IFNULL(ssd.matchedtext,ssd.asrtext) AS option_text, |
| | | COUNT(*) AS chosen_quantity |
| | | FROM |
| | | service_subtask_detail ssd |
| | | INNER JOIN service_subtask ss ON ssd.sub_id = ss.id |
| | | INNER JOIN |
| | | <if test="type == 1"> |
| | | ivr_task_template_script a ON a.id = ssd.scriptid |
| | | </if> |
| | | <if test="type == 2"> |
| | | svy_task_template_script a ON a.id = ssd.scriptid |
| | | </if> |
| | | where 1=1 |
| | | and ss.del_flag=0 |
| | | and ssd.del_flag=0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and ss.orgid = #{orgid} |
| | | </if> |
| | |
| | | <if test="configValue != null and configValue != ''"> |
| | | AND ssd.categoryid IN (${configValue}) |
| | | </if> |
| | | group by ssd.scriptid, IFNULL(ssd.matchedtext,ssd.asrtext) |
| | | group by a.script_content, ss.type, IFNULL(ssd.matchedtext,ssd.asrtext) |
| | | </select> |
| | | |
| | | <select id="getDataByTime" resultMap="ServiceSubtaskResult"> |
| | |
| | | nurse_id, |
| | | nurse_name, |
| | | remark, |
| | | doctor_opinion, |
| | | inhospid, |
| | | patfrom, |
| | | task_guid, |
| | |
| | | continue_count, |
| | | continue_time_next, |
| | | task_situation, |
| | | remark |
| | | remark, |
| | | doctor_opinion |
| | | from service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |