| | |
| | | where patid = #{patid} and taskid = #{taskid} |
| | | </update> |
| | | |
| | | <!-- 人工随访:软删除患者出院记录对应的未完成随访任务 --> |
| | | <update id="deleteUnfinishedServiceSubtaskByInhospids"> |
| | | update service_subtask |
| | | set del_flag = 1 |
| | | where del_flag = 0 |
| | | and patid = #{patid} |
| | | and sendstate in |
| | | <foreach collection="sendstates" item="sendstate" open="(" separator="," close=")"> |
| | | #{sendstate} |
| | | </foreach> |
| | | and inhospid in |
| | | <foreach collection="inhospids" item="inhospid" open="(" separator="," close=")"> |
| | | #{inhospid} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <!-- 人工随访重复校验:同一患者同一任务下是否已有未完成随访任务 --> |
| | | <select id="countUnfinishedServiceSubtaskByPatidAndTaskid" resultType="int"> |
| | | select count(1) |
| | | from service_subtask |
| | | where del_flag = 0 |
| | | and patid = #{patid} |
| | | and taskid = #{taskid} |
| | | and sendstate in |
| | | <foreach collection="sendstates" item="sendstate" open="(" separator="," close=")"> |
| | | #{sendstate} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getSfStatistics" parameterType="com.smartor.domain.ServiceSubtaskCountReq" |
| | | resultMap="ServiceSubtaskResult"> |
| | | select id, |
| | |
| | | deptname, |
| | | sendstate, |
| | | preachform, |
| | | current_preachform, |
| | | <include refid="effectiveCurrentPreachformExpr"/> AS current_preachform, |
| | | excep, |
| | | nurse_id, |
| | | nurse_name, |
| | |
| | | deptname, |
| | | sendstate, |
| | | preachform, |
| | | current_preachform, |
| | | <include refid="effectiveCurrentPreachformExpr"/> AS current_preachform, |
| | | excep, |
| | | nurse_id, |
| | | nurse_name, |
| | |
| | | </foreach> |
| | | </if> |
| | | <if test="currentPreachform != null"> |
| | | AND current_preachform = #{currentPreachform} |
| | | AND <include refid="effectiveCurrentPreachformExpr"/> = #{currentPreachform} |
| | | <if test="followUpCountStyle != null and followUpCountStyle = '1'"> |
| | | AND sendstate != 4 |
| | | </if> |