| | |
| | | <if test="groupKey != null and groupKey != ''"> |
| | | ss.${groupKey} as groupKey, |
| | | </if> |
| | | SUM(CASE WHEN ss.finishtime IS NOT NULL AND DATE(ss.visit_time) <= DATE(ss.finishtime) THEN 1 ELSE 0 END) / COUNT(*) AS finishRate, |
| | | SUM(CASE WHEN ss.finishtime IS NOT NULL AND DATE(ss.visit_time) <= DATE(ss.finishtime) THEN 1 ELSE 0 END) / |
| | | COUNT(*) AS finishRate, |
| | | <if test="rateDay != null"> |
| | | SUM(CASE WHEN ss.finishtime IS NOT NULL |
| | | AND DATEDIFF(ss.finishtime, ss.endtime) <= #{rateDay} + COALESCE(cp.compensate_days, 0) |
| | |
| | | t.task_name AS taskName, |
| | | d.asrtext AS optionresult, |
| | | d.score AS score, |
| | | s.deptcode AS deptcode, |
| | | s.deptname AS deptname, |
| | | s.leavehospitaldistrictcode AS leavehospitaldistrictcode, |
| | | s.leavehospitaldistrictname AS leavehospitaldistrictname, |
| | | d.targetvalue AS targetvalue, |
| | | d.value_type AS valueType, |
| | | COUNT(*) AS count, |
| | |
| | | <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="questiontext != null and questiontext != ''">and d.questiontext like concat('%', #{questiontext}, |
| | | '%') |
| | | </if> |
| | | AND s.sendstate = 6 |
| | | AND d.del_flag=0 |
| | | GROUP BY d.questiontext |
| | |
| | | <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="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> |
| | |
| | | t.taskid |
| | | </select> |
| | | |
| | | <select id="statQuestionOptionByKsOrBq" resultType="com.smartor.domain.DTO.QuestionCountKsOrBqDTO" |
| | | parameterType="com.smartor.domain.VO.QuestionCountKsOrBqVO"> |
| | | SELECT questiontext, |
| | | d.taskid, |
| | | s.deptname, |
| | | s.leavehospitaldistrictname, |
| | | d.targetvalue, |
| | | d.asrtext, |
| | | COUNT(d.asrtext) AS answercount, |
| | | SUM(d.score) AS singleScore |
| | | FROM service_subtask_detail d, |
| | | service_task s |
| | | WHERE d.taskid = s.taskid |
| | | AND deptname IS NOT NULL |
| | | AND leavehospitaldistrictname IS NOT NULL |
| | | <if test="endFinishTime != null"> |
| | | AND create_time < #{endFinishTime} |
| | | </if> |
| | | <if test="startFinishTime != null"> |
| | | AND create_time >= #{startFinishTime} |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | AND deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY d.questiontext, |
| | | d.taskid, |
| | | d.asrtext |
| | | ORDER BY d.taskid |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskListDeadLine" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |