| | |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and sendstate != 5 |
| | | <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,jdbcType=TIMESTAMP}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | | <if test="continueTimeNext != null ">and continue_time_next = #{continueTimeNext}</if> |
| | | UNION ALL |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and sendstate = 5 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="subId != null"> |
| | | AND id = #{subId} |
| | | </if> |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="visitTime != null"> |
| | | AND date_format(visit_time,'%y%m%d') <= date_format(DATE_ADD(#{visitTime}, INTERVAL 1 DAY),'%y%m%d') |
| | | </if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | |
| | | <foreach collection="taskIds" item="itemTaskId" open="(" separator="," |
| | | close=")"> |
| | | #{itemTaskId} |
| | | </foreach> |
| | | </if> |
| | | <if test="operationItemIds != null and operationItemIds.size() > 0"> |
| | | AND operation_item_id IN |
| | | <foreach collection="operationItemIds" item="operationItemIdItem" open="(" separator="," close=")"> |
| | | #{operationItemIdItem} |
| | | </foreach> |
| | | </if> |
| | | <if test="templateid != null and templateid != ''">and templateid = #{templateid}</if> |
| | |
| | | <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename}</if> |
| | | <if test="openid != null ">and openid = #{openid}</if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | <if test="operationItemId != null ">and operation_item_id = #{operationItemId}</if> |
| | | <if test="drname != null and drname != ''">and drname like concat('%', #{drname}, '%')</if> |
| | | <if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if> |
| | | <if test="drcode != null and drcode != ''">and (drcode = #{drcode}</if> |
| | |
| | | <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</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="(" |
| | | <foreach collection="visitDeptCodes" item="visitDeptCode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{visitDeptCodes} |
| | | #{visitDeptCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="sort != null and sort==0">order by endtime asc</if> |
| | |
| | | <if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext,jdbcType=TIMESTAMP},</if> |
| | | <if test="continueContent != null ">continue_content = #{continueContent},</if> |
| | | </trim> |
| | | where |
| | | <if test="patid != null "> |
| | | patid = #{patid} |
| | | </if> |
| | | <if test="taskid != null "> |
| | | and taskid = #{taskid} |
| | | </if> |
| | | <if test="id != null "> |
| | | and id = #{id} |
| | | </if> |
| | | <where> |
| | | <if test="patid != null "> |
| | | patid = #{patid} |
| | | </if> |
| | | <if test="taskid != null "> |
| | | and taskid = #{taskid} |
| | | </if> |
| | | <if test="id != null "> |
| | | and id = #{id} |
| | | </if> |
| | | </where> |
| | | </update> |
| | | |
| | | <update id="updateServiceSubtaskByTaskGuid" parameterType="com.smartor.domain.ServiceSubtask"> |
| | |
| | | continue_content, |
| | | continue_count, |
| | | continue_time_next, |
| | | task_situation |
| | | task_situation, |
| | | remark |
| | | from service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | |
| | | </if> |
| | | </if> |
| | | <if test="deptOrDistrict==2"> |
| | | AND (1=1 |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND (leavehospitaldistrictcode IN |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | OR deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close="))"> |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | </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="(" |
| | | <foreach collection="visitDeptCodes" item="visitDeptCode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{visitDeptCodes} |
| | | #{visitDeptCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''"> |
| | |
| | | continue_content, |
| | | continue_count, |
| | | continue_time_next, |
| | | task_situation |
| | | task_situation, |
| | | remark |
| | | from service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | |
| | | SELECT |
| | | d.questiontext AS questiontext, |
| | | t.taskid AS taskid, |
| | | t.task_name AS taskName, |
| | | d.asrtext AS optionresult, |
| | | COUNT(*) AS count, |
| | | CONCAT(ROUND(COUNT(*) * 100.0 / t2.total_count, 2), '%') AS ratio |
| | |
| | | #{taskId} |
| | | </foreach> |
| | | and s.sendstate=6 |
| | | and d.del_flag=0 |
| | | GROUP BY |
| | | t.taskid, |
| | | d.questiontext |
| | |
| | | #{taskId} |
| | | </foreach> |
| | | AND s.sendstate = 6 |
| | | and d.del_flag=0 |
| | | <if test="startOutHospTime != null"> |
| | | AND date_format(s.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d') |
| | | </if> |
| | |
| | | t.taskid |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskListDeadLine" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and visit_count = 1 |
| | | and endtime |
| | | </select> |
| | | |
| | | </mapper> |
| | | |