| | |
| | | AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d') |
| | | </if> |
| | | <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">abd visit_dept_name = #{visitDeptName}</if> |
| | | <if test="isabnormal != null">abd isabnormal = #{isabnormal}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | | <!-- 目前只统计语音和问卷 --> |
| | | <if test="type != null"> |
| | | and type = #{type} |
| | | </if> |
| | | <if test="pageSize != null and pageNum != null"> |
| | | limit ${pageSize} OFFSET ${pageNum} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getSfStatisticsJoy" parameterType="com.smartor.domain.ServiceSubtaskCountReq" |
| | |
| | | |
| | | <select id="getSfStatisticsCategory" parameterType="com.smartor.domain.ServiceSubtaskCountReq" |
| | | resultMap="ServiceSubtaskResult2"> |
| | | SELECT a.sub_id as subTaskId, |
| | | SELECT |
| | | <if test="configValue != null and configValue != ''"> |
| | | SUM(CASE WHEN a.categoryid IN(${configValue}) |
| | | THEN 1 ELSE 0 END) AS joyAllCount, |
| | | </if> |
| | | COUNT(sub_id) joyCount |
| | | <if test="configValue != null and configValue != ''"> |
| | | SUM(CASE WHEN a.categoryid IN(${configValue}) |
| | | AND IFNULL(a.matchedtext,a.asrtext) is not null |
| | | AND IFNULL(a.matchedtext,a.asrtext) != '' |
| | | THEN 1 ELSE 0 END) AS joyCount, |
| | | </if> |
| | | a.sub_id as subTaskId |
| | | FROM service_subtask_detail a |
| | | INNER JOIN service_subtask t ON a.sub_id = t.id |
| | | where 1=1 |
| | | and a.del_flag=0 |
| | | AND t.del_flag=0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and a.orgid = #{orgid} |
| | | and t.orgid = #{orgid} |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND t.leavehospitaldistrictcode IN |
| | |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," |
| | | close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="subTaskIds != null and subTaskIds.size() > 0"> |
| | | AND t.id IN |
| | | <foreach collection="subTaskIds" item="subTaskId" open="(" separator="," |
| | | close=")"> |
| | | #{subTaskId} |
| | | </foreach> |
| | | </if> |
| | | <if test="serviceType != null and serviceType.size() > 0"> |
| | |
| | | FROM |
| | | service_subtask_detail ssd |
| | | INNER JOIN service_subtask ss ON ssd.sub_id = ss.id |
| | | WHERE |
| | | ss.del_flag=0 |
| | | WHERE 1=1 |
| | | AND ss.del_flag=0 |
| | | AND ssd.del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND ss.orgid = #{orgid} |
| | |
| | | <if test="orgid != null and orgid != ''"> |
| | | and ss.orgid = #{orgid} |
| | | </if> |
| | | AND IFNULL(ssd.matchedtext,ssd.asrtext) IS NOT NULL |
| | | AND IFNULL(ssd.matchedtext,ssd.asrtext) != '' |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND ss.leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," |