| | |
| | | #{itemTaskId} |
| | | </foreach> |
| | | </if> |
| | | <if test="operationItemIds != null and operationItemIds.size() > 0"> |
| | | AND operation_item_id IN |
| | | <foreach collection="operationItemIds" item="operationItemIdItem" open="(" separator="," close=")"> |
| | | #{operationItemIdItem} |
| | | </foreach> |
| | | </if> |
| | | <if test="templateid != null and templateid != ''">and templateid = #{templateid}</if> |
| | | <if test="templatename != null and templatename != ''">and templatename like concat('%', #{templatename}, |
| | | '%') |
| | |
| | | </if> |
| | | <if test="endSendDateTime != null"> |
| | | AND date_format(visit_time,'%y%m%d') <= date_format(#{endSendDateTime},'%y%m%d') |
| | | </if> |
| | | <if test="finishtimeStart != null"> |
| | | AND date_format(finishtime,'%y%m%d') >= date_format(#{finishtimeStart},'%y%m%d') |
| | | </if> |
| | | <if test="finishtimeEnd != null"> |
| | | AND date_format(finishtime,'%y%m%d') <= date_format(#{finishtimeEnd},'%y%m%d') |
| | | </if> |
| | | <if test="longSendTime != null"> |
| | | AND date_format(long_send_time,'%y%m%d') <= date_format(#{longSendTime},'%y%m%d') |
| | |
| | | </if> |
| | | <if test="deptOrDistrict==2"> |
| | | AND (1=1 |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | <if test="leavehospitaldistrictcodes != null"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | <if test=" leaveldeptcodes != null"> |
| | | OR deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | |
| | | <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename}</if> |
| | | <if test="openid != null ">and openid = #{openid}</if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | <if test="operationItemId != null ">and operation_item_id = #{operationItemId}</if> |
| | | <if test="drname != null and drname != ''">and drname like concat('%', #{drname}, '%')</if> |
| | | <if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if> |
| | | <if test="drcode != null and drcode != ''">and (drcode = #{drcode}</if> |
| | |
| | | t.taskid AS taskid, |
| | | t.task_name AS taskName, |
| | | d.asrtext AS optionresult, |
| | | d.score AS score, |
| | | d.targetvalue AS targetvalue, |
| | | d.value_type AS valueType, |
| | | COUNT(*) AS count, |
| | | CONCAT(ROUND(COUNT(*) * 100.0 / t2.total_count, 2), '%') AS ratio |
| | | FROM |
| | |
| | | service_task t |
| | | INNER JOIN service_subtask s ON s.taskid = t.taskid |
| | | INNER JOIN service_subtask_detail d ON d.sub_id = s.id |
| | | WHERE t.taskid IN |
| | | <foreach collection="taskIds" item="taskId" open="(" separator="," close=")"> |
| | | #{taskId} |
| | | </foreach> |
| | | WHERE 1=1 |
| | | <if test="taskIds != null and taskIds.size() > 0"> |
| | | AND t.taskid IN |
| | | <foreach collection="taskIds" item="taskId" open="(" separator="," close=")"> |
| | | #{taskId} |
| | | </foreach> |
| | | </if> |
| | | <if test="valueType != null">AND d.value_type = #{valueType}</if> |
| | | <if test="scoreStart != null">AND d.score >= #{scoreStart}</if> |
| | | <if test="scoreEnd != null">AND d.score <= #{scoreEnd}</if> |
| | | <if test="questiontext != null and questiontext != ''">and d.questiontext like concat('%', #{questiontext}, |
| | | '%') |
| | | </if> |
| | | and s.sendstate=6 |
| | | and d.del_flag=0 |
| | | GROUP BY |
| | | t.taskid, |
| | | d.questiontext |
| | | ) t2 ON t2.taskid = t.taskid AND t2.questiontext = d.questiontext |
| | | WHERE t.taskid IN |
| | | <foreach collection="taskIds" item="taskId" open="(" separator="," close=")"> |
| | | #{taskId} |
| | | </foreach> |
| | | WHERE 1=1 |
| | | <if test="taskIds != null and taskIds.size() > 0"> |
| | | AND t.taskid IN |
| | | <foreach collection="taskIds" item="taskId" open="(" separator="," close=")"> |
| | | #{taskId} |
| | | </foreach> |
| | | </if> |
| | | <if test="valueType != null">AND d.value_type = #{valueType}</if> |
| | | <if test="scoreStart != null">AND d.score >= #{scoreStart}</if> |
| | | <if test="scoreEnd != null">AND d.score <= #{scoreEnd}</if> |
| | | <if test="questiontext != null and questiontext != ''">and d.questiontext like concat('%', #{questiontext}, |
| | | '%') |
| | | </if> |
| | | AND s.sendstate = 6 |
| | | and d.del_flag=0 |
| | | <if test="startOutHospTime != null"> |
| | | AND date_format(s.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d') |
| | | </if> |
| | | <if test="endOutHospTime != null"> |
| | | AND date_format(s.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d') |
| | | </if> |
| | | GROUP BY |
| | | t.taskid, |
| | | d.questiontext, |
| | | d.score, |
| | | d.targetvalue, |
| | | d.asrtext, |
| | | d.value_type |
| | | ORDER BY |
| | | d.questiontext, |
| | | t.taskid |
| | | </select> |
| | | |
| | | <!-- 新方法:根据子任务 ID 统计问题选项百分比 (用于满意度统计 serviceType=6) --> |
| | | <select id="statQuestionOptionBySubtaskIds" resultType="com.smartor.domain.ServiceSubtaskDetailRatioExport"> |
| | | SELECT |
| | | d.questiontext AS questiontext, |
| | | t.taskid AS taskid, |
| | | t.task_name AS taskName, |
| | | d.asrtext AS optionresult, |
| | | d.score AS score, |
| | | d.targetvalue AS targetvalue, |
| | | d.value_type AS valueType, |
| | | COUNT(*) AS count, |
| | | CONCAT(ROUND(COUNT(*) * 100.0 / t2.total_count, 2), '%') AS ratio |
| | | FROM |
| | | service_task t |
| | | INNER JOIN service_subtask s ON s.taskid = t.taskid |
| | | INNER JOIN service_subtask_detail d ON d.sub_id = s.id |
| | | INNER JOIN ( |
| | | SELECT |
| | | d.questiontext, |
| | | COUNT(*) AS total_count |
| | | FROM |
| | | service_task t |
| | | INNER JOIN service_subtask s ON s.taskid = t.taskid |
| | | INNER JOIN service_subtask_detail d ON d.sub_id = s.id |
| | | WHERE 1=1 |
| | | <if test="subtaskIds != null and subtaskIds.size() > 0"> |
| | | AND s.id IN |
| | | <foreach collection="subtaskIds" item="subtaskId" open="(" separator="," close=")"> |
| | | #{subtaskId} |
| | | </foreach> |
| | | </if> |
| | | <if test="valueType != null">AND d.value_type >= #{valueType}</if> |
| | | <if test="scoreStart != null">AND d.score = #{scoreStart}</if> |
| | | <if test="scoreEnd != null">AND d.score <= #{scoreEnd}</if> |
| | | <if test="questiontext != null and questiontext != ''">and d.questiontext like concat('%', #{questiontext}, '%')</if> |
| | | AND s.sendstate = 6 |
| | | AND d.del_flag=0 |
| | | GROUP BY d.questiontext |
| | | ) t2 ON t2.questiontext = d.questiontext |
| | | WHERE 1=1 |
| | | <if test="subtaskIds != null and subtaskIds.size() > 0"> |
| | | AND s.id IN |
| | | <foreach collection="subtaskIds" item="subtaskId" open="(" separator="," close=")"> |
| | | #{subtaskId} |
| | | </foreach> |
| | | </if> |
| | | AND s.sendstate = 6 |
| | | AND d.del_flag=0 |
| | | <if test="valueType != null">AND d.value_type >= #{valueType}</if> |
| | | <if test="scoreStart != null">AND d.score >= #{scoreStart}</if> |
| | | <if test="scoreEnd != null">AND d.score <= #{scoreEnd}</if> |
| | | <if test="questiontext != null and questiontext != ''">and d.questiontext like concat('%', #{questiontext}, '%')</if> |
| | | <if test="startOutHospTime != null"> |
| | | AND date_format(s.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d') |
| | | </if> |
| | |
| | | GROUP BY |
| | | t.taskid, |
| | | d.questiontext, |
| | | d.score, |
| | | d.targetvalue, |
| | | d.asrtext |
| | | ORDER BY |
| | | d.questiontext, |
| | | t.taskid |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskListDeadLine" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and visit_count = 1 |
| | | and endtime |
| | | </select> |
| | | |
| | | </mapper> |
| | | |