| | |
| | | <result property="currentPreachform" column="current_preachform"/> |
| | | <result property="taskSituation" column="task_situation"/> |
| | | <result property="isabnormal" column="isabnormal"/> |
| | | <result property="continueFlag" column="continue_flag"/> |
| | | <result property="continueTimeNow" column="continue_time_now"/> |
| | | <result property="continueContent" column="continue_content"/> |
| | | <result property="continueCount" column="continue_count"/> |
| | | <result property="continueTimeNext" column="continue_time_next"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2"> |
| | |
| | | visit_type, |
| | | management_doctor, |
| | | management_doctor_code, |
| | | continue_flag, |
| | | continue_time_now, |
| | | continue_content, |
| | | continue_count, |
| | | continue_time_next, |
| | | task_situation |
| | | from service_subtask |
| | | </sql> |
| | | |
| | | <select id="selectServiceSubtaskBySendstate" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | <select id="selectServiceSubtaskBySendstate" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | <if test="serviceType != null ">and service_type = #{serviceType}</if> |
| | | <if test="patid != null ">and patid = #{patid}</if> |
| | | <if test="sendstates!=null"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="visitTime != null"> |
| | | AND date_format(visit_time,'%y%m%d') <= date_format(#{visitTime},'%y%m%d') |
| | | </if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | <select id="queryServiceSubtaskList" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="visitTime != null"> |
| | | AND date_format(visit_time,'%y%m%d') <= date_format(#{visitTime},'%y%m%d') |
| | | </if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | <if test="sendname != null and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if> |
| | | <if test="phone != null and phone != ''">and phone = #{phone}</if> |
| | | <if test="leavehospitaldistrictcode != null and leavehospitaldistrictcode != ''">and |
| | |
| | | <if test="excep != null ">and excep = #{excep}</if> |
| | | <if test="nurseName != null ">and nurse_name = #{nurseName}</if> |
| | | <if test="score != null">and score = #{score}</if> |
| | | <!-- <if test="visitCount != null">and visit_count = #{visitCount}</if>--> |
| | | <if test="visitCount != null and visitCount == 1"> |
| | | AND visit_count = 1 |
| | | </if> |
| | |
| | | <if test="taskGuid != null">and task_guid = #{taskGuid}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | | <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if> |
| | | <!-- <if test="dateLimit != null and dateLimit = '1'"> and CURDATE() + 1 > long_send_time</if>--> |
| | | <!-- <if test="visitTime != null">and visit_time = #{visitTime}</if> --> |
| | | <!--<if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>--> |
| | | <if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0"> |
| | | AND visit_dept_code IN |
| | | <foreach collection="visitDeptCodes" item="visitDeptCodes" open="(" |
| | |
| | | <if test="sort != null and sort==6">order by admindate desc</if> |
| | | <if test="sort != null and sort==7">order by visit_time asc</if> |
| | | <if test="sort != null and sort==8">order by visit_time desc</if> |
| | | |
| | | <!-- order by update_time desc,id desc --> |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | | <select id="getCompensateServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | <select id="getCompensateServiceSubtaskList" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where del_flag = 0 |
| | |
| | | AND date_format(visit_time,'%y%m%d') <= date_format(#{visitTime},'%y%m%d') |
| | | </if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskListByCreateTime" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | <select id="selectServiceSubtaskListByCreateTime" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where del_flag = 0 |
| | |
| | | <if test="managementDoctor != null">and management_doctor = #{managementDoctor}</if> |
| | | <if test="currentPreachform != null">and current_preachform = #{currentPreachform}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectServiceSubtaskListAgain" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | <select id="selectServiceSubtaskListAgain" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | |
| | | <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | | <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if> |
| | | |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | </select> |
| | | |
| | | <select id="selectSendstateByCondition" parameterType="com.smartor.domain.ServiceSubtask" resultType="Integer"> |
| | |
| | | <if test="taskName != null">and task_name like concat('%',#{taskName}, '%')</if> |
| | | <if test="sendstate != null">and sendstate = #{sendstate}</if> |
| | | <if test="orgid != null">and orgid =#{orgid}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | GROUP BY sendname,sendstate,starttime,endtime,nurse_name,phone,sex,task_name,leavediagname,visit_time ORDER BY |
| | | visit_time |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | |
| | | <if test="currentPreachform != null">current_preachform,</if> |
| | | <if test="taskSituation != null">task_situation,</if> |
| | | <if test="isabnormal != null">isabnormal,</if> |
| | | <if test="continueFlag != null ">continue_flag,</if> |
| | | <if test="continueTimeNow != null ">continue_time_now,</if> |
| | | <if test="continueCount != null ">continue_count,</if> |
| | | <if test="continueTimeNext != null ">continue_time_next,</if> |
| | | <if test="continueContent != null ">continue_content,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="sendname != null">#{sendname},</if> |
| | |
| | | <if test="currentPreachform != null">#{currentPreachform},</if> |
| | | <if test="taskSituation != null">#{taskSituation},</if> |
| | | <if test="isabnormal != null">#{isabnormal},</if> |
| | | <if test="continueFlag != null ">#{continueFlag},</if> |
| | | <if test="continueTimeNow != null ">#{continueTimeNow},</if> |
| | | <if test="continueCount != null ">#{continueCount},</if> |
| | | <if test="continueTimeNext != null ">#{continueTimeNext},</if> |
| | | <if test="continueContent != null ">#{continueContent},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="currentPreachform != null">current_preachform=#{currentPreachform},</if> |
| | | <if test="taskSituation != null">task_situation=#{taskSituation},</if> |
| | | <if test="isabnormal != null">isabnormal=#{isabnormal},</if> |
| | | <if test="continueFlag != null ">continue_flag = #{continueFlag},</if> |
| | | <if test="continueTimeNow != null ">continue_time_now = #{continueTimeNow},</if> |
| | | <if test="continueCount != null ">continue_count = #{continueCount},</if> |
| | | <if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext},</if> |
| | | <if test="continueContent != null ">continue_content = #{continueContent},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <if test="currentPreachform != null">current_preachform=#{currentPreachform},</if> |
| | | <if test="taskSituation != null">task_situation=#{taskSituation},</if> |
| | | <if test="isabnormal != null">isabnormal=#{isabnormal},</if> |
| | | <if test="continueFlag != null ">continue_flag = #{continueFlag},</if> |
| | | <if test="continueTimeNow != null ">continue_time_now = #{continueTimeNow},</if> |
| | | <if test="continueCount != null ">continue_count = #{continueCount},</if> |
| | | <if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext},</if> |
| | | <if test="continueContent != null ">continue_content = #{continueContent},</if> |
| | | </trim> |
| | | where 1=1 |
| | | <if test="patid != null ">and patid = #{patid}</if> |
| | |
| | | <if test="currentPreachform != null">current_preachform=#{currentPreachform},</if> |
| | | <if test="taskSituation != null">task_situation=#{taskSituation},</if> |
| | | <if test="isabnormal != null">isabnormal=#{isabnormal},</if> |
| | | <if test="continueFlag != null ">continue_flag = #{continueFlag},</if> |
| | | <if test="continueTimeNow != null ">continue_time_now = #{continueTimeNow},</if> |
| | | <if test="continueCount != null ">continue_count = #{continueCount},</if> |
| | | <if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext},</if> |
| | | <if test="continueContent != null ">continue_content = #{continueContent},</if> |
| | | </trim> |
| | | where patid = #{patid} and taskid = #{taskid} |
| | | </update> |
| | |
| | | <if test="currentPreachform != null">current_preachform=#{currentPreachform},</if> |
| | | <if test="taskSituation != null">task_situation=#{taskSituation},</if> |
| | | <if test="isabnormal != null">isabnormal=#{isabnormal},</if> |
| | | <if test="continueFlag != null ">continue_flag = #{continueFlag},</if> |
| | | <if test="continueTimeNow != null ">continue_time_now = #{continueTimeNow},</if> |
| | | <if test="continueCount != null ">continue_count = #{continueCount},</if> |
| | | <if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext},</if> |
| | | <if test="continueContent != null ">continue_content = #{continueContent},</if> |
| | | </trim> |
| | | where task_guid = #{taskGuid} and task_name = #{taskName} |
| | | </update> |
| | |
| | | send_type, |
| | | recordid, |
| | | exrecallcount, |
| | | continue_flag, |
| | | continue_time_now, |
| | | continue_content, |
| | | continue_count, |
| | | continue_time_next, |
| | | task_situation |
| | | from service_subtask |
| | | where 1=1 |
| | |
| | | <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | <!-- 目前只统计语音和问卷 --> |
| | | <if test="type != null"> |
| | | and type = #{type} |
| | |
| | | <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | <!-- 目前只统计语音和问卷 --> |
| | | <if test="type != null"> |
| | | and type = #{type} |
| | |
| | | </select> |
| | | |
| | | <!-- 优化的统计查询:直接在数据库层完成聚合计算 --> |
| | | <select id="countByCondition" parameterType="com.smartor.domain.ServiceSubtaskVO" resultType="map"> |
| | | <select id="countByCondition" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" resultType="map"> |
| | | SELECT |
| | | SUM(CASE WHEN sendstate = 4 THEN 1 ELSE 0 END) AS wzx, |
| | | SUM(CASE WHEN sendstate != 4 AND sendstate != 2 THEN 1 ELSE 0 END) AS ysf, |