| | |
| | | <resultMap type="com.smartor.domain.SvyTaskTemplateScript" id="SvyTaskTemplateScriptResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="taskid" column="taskid"/> |
| | | <result property="ishide" column="ishide"/> |
| | | <result property="scriptno" column="scriptno"/> |
| | | <result property="templateID" column="templateID"/> |
| | | <result property="scriptid" column="scriptid"/> |
| | |
| | | <result property="score" column="score"/> |
| | | <result property="prompt" column="prompt"/> |
| | | <result property="groupName" column="group_name"/> |
| | | <result property="categoryid" column="categoryid"/> |
| | | |
| | | </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, |
| | | ishide, |
| | | prompt, |
| | | categoryid, |
| | | group_name, |
| | | branch_flag, |
| | | branch_nextscriptno, |
| | |
| | | <select id="selectSvyTaskTemplateScriptList" parameterType="com.smartor.domain.SvyTaskTemplateScript" |
| | | resultMap="SvyTaskTemplateScriptResult"> |
| | | <include refid="selectSvyTaskTemplateScriptVo"/> |
| | | <where> |
| | | where 1=1 |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="categoryid != null ">and categoryid = #{categoryid}</if> |
| | | <if test="ishide != null ">and ishide = #{ishide}</if> |
| | | <if test="scriptno != null ">and scriptno = #{scriptno}</if> |
| | | <if test="templateID != null ">and templateID = #{templateID}</if> |
| | | <if test="scriptid != null ">and scriptid = #{scriptid}</if> |
| | |
| | | <if test="branchNextscriptno != null and branchNextscriptno != ''">and branch_nextscriptno = |
| | | #{branchNextscriptno} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectSvyTaskTemplateScriptByID" parameterType="Long" resultMap="SvyTaskTemplateScriptResult"> |
| | |
| | | <if test="score != null ">score,</if> |
| | | <if test="prompt != null ">prompt,</if> |
| | | <if test="groupName != null ">group_name,</if> |
| | | <if test="ishide != null ">ishide,</if> |
| | | <if test="categoryid != null ">categoryid,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="taskid != null">#{taskid},</if> |
| | |
| | | <if test="score != null ">#{score},</if> |
| | | <if test="prompt != null ">#{prompt},</if> |
| | | <if test="groupName != null ">#{groupName},</if> |
| | | <if test="ishide != null ">#{ishide},</if> |
| | | <if test="categoryid != null ">#{categoryid},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="score != null">score = #{score},</if> |
| | | <if test="prompt != null">prompt = #{prompt},</if> |
| | | <if test="groupName != null ">group_name = #{groupName},</if> |
| | | <if test="ishide != null ">ishide = #{ishide},</if> |
| | | <if test="categoryid != null ">categoryid = #{categoryid},</if> |
| | | </trim> |
| | | where id = #{d} |
| | | </update> |
| | |
| | | #{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> |