| | |
| | | |
| | | </resultMap> |
| | | |
| | | <resultMap type="com.smartor.domain.ServiceSubtaskScriptCount" id="ServiceSubtaskScriptCountResult"> |
| | | <result property="scriptid" column="scriptid"/> |
| | | <result property="templateid" column="templateid"/> |
| | | <result property="scriptType" column="script_type"/> |
| | | <result property="scriptContent" column="script_content"/> |
| | | <result property="subtaskType" column="subtask_type"/> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | | <result property="allQuantity" column="all_quantity"/> |
| | | <result property="completedPercentage" column="completed_percentage"/> |
| | | <result property="optionText" column="option_text"/> |
| | | <result property="chosenQuantity" column="chosen_quantity"/> |
| | | <result property="chosenPercentage" column="chosen_percentage"/> |
| | | <result property="options" column="options"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSvyTaskTemplateScriptVo"> |
| | | select id, |
| | | sort, |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="getSvyTemplateScriptListForSubtaskCount" parameterType="com.smartor.domain.ServiceSubtaskCountReq" |
| | | resultMap="ServiceSubtaskScriptCountResult"> |
| | | SELECT |
| | | ss.templateid, |
| | | ssd.scriptid, |
| | | task_script.script_type, |
| | | task_script.script_content, |
| | | task_targetoption.optioncontent AS option_text |
| | | FROM |
| | | service_subtask_detail ssd |
| | | INNER JOIN service_subtask ss ON ssd.sub_id = ss.id |
| | | INNER JOIN svy_task_template_script task_script |
| | | ON task_script.id = ssd.scriptid |
| | | INNER JOIN svy_task_template_targetoption task_targetoption |
| | | ON task_targetoption.scriptid = task_script.id |
| | | where 1=1 |
| | | and ss.del_flag=0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and ss.orgid = #{orgid} |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND ss.leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND ss.deptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," |
| | | close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="serviceType != null and serviceType.size() > 0"> |
| | | AND ss.service_type IN |
| | | <foreach collection="serviceType" item="serviceType" open="(" separator="," |
| | | close=")"> |
| | | #{serviceType} |
| | | </foreach> |
| | | </if> |
| | | <if test="startTime != null and endTime!=null"> |
| | | AND date_format(ss.visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d') |
| | | AND date_format(ss.visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d') |
| | | </if> |
| | | <!-- 目前只统计语音和问卷 --> |
| | | <if test="type != null"> |
| | | and ss.type = #{type} |
| | | </if> |
| | | <if test="configValue != null and configValue != ''"> |
| | | AND ssd.categoryid IN (${configValue}) |
| | | </if> |
| | | group by ss.templateid, ssd.scriptid, |
| | | task_script.script_type, task_script.script_content, |
| | | task_targetoption.optioncontent |
| | | </select> |
| | | </mapper> |