| | |
| | | <result property="patid" column="patid"/> |
| | | <result property="libtemplatename" column="libtemplatename"/> |
| | | <result property="libtemplateid" column="libtemplateid"/> |
| | | <result property="openid" column="openid"/> |
| | | <result property="longSendTime" column="long_send_time"/> |
| | | <result property="serviceType" column="service_type"/> |
| | | <result property="score" column="score"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2"> |
| | | <result property="month" column="month"/> |
| | | <result property="serviceType" column="service_type"/> |
| | | <result property="subTaskId" column="subTaskId"/> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectServiceSubtaskVo"> |
| | | select id, |
| | | hosp_type, |
| | | long_send_time, |
| | | openid, |
| | | service_type, |
| | | libtemplateid, |
| | | libtemplatename, |
| | | hospno, |
| | | score, |
| | | phone, |
| | | sex, |
| | | age, |
| | |
| | | from service_subtask |
| | | </sql> |
| | | |
| | | <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask" resultMap="ServiceSubtaskResult"> |
| | | <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | <where> |
| | | del_flag=0 |
| | |
| | | <if test="phone != null and phone != ''">and phone = #{phone}</if> |
| | | <if test="sex != null and sex != ''">and sex = #{sex}</if> |
| | | <if test="age != null ">and age = #{age}</if> |
| | | <if test="serviceType != null ">and service_type = #{serviceType}</if> |
| | | <if test="patid != null ">and patid = #{patid}</if> |
| | | <if test="sfzh != null and sfzh != ''">and sfzh = #{sfzh}</if> |
| | | <if test="addr != null and addr != ''">and addr = #{addr}</if> |
| | |
| | | <if test="operatorNo != null and operatorNo != ''">and operator_no = #{operatorNo}</if> |
| | | <if test="wechat != null and wechat != ''">and wechat = #{wechat}</if> |
| | | <if test="hospType != null and hospType != ''">and hosp_type = #{hospType}</if> |
| | | <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid},</if> |
| | | <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename},</if> |
| | | <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if> |
| | | <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename}</if> |
| | | <if test="openid != null ">and openid = #{openid}</if> |
| | | <if test="longSendTime != null ">and long_send_time = #{longSendTime}</if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | <if test="score != null"> |
| | | and score = #{score} |
| | | </if> |
| | | </where> |
| | | order by update_time desc,id desc |
| | | </select> |
| | |
| | | <if test="libtemplateid != null ">libtemplateid,</if> |
| | | <if test="libtemplatename != null ">libtemplatename,</if> |
| | | <if test="patid != null ">patid,</if> |
| | | <if test="openid != null ">openid,</if> |
| | | <if test="longSendTime != null ">long_send_time,</if> |
| | | <if test="serviceType != null ">service_type,</if> |
| | | <if test="score != null ">score,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="sendname != null">#{sendname},</if> |
| | |
| | | <if test="libtemplateid != null ">#{libtemplateid},</if> |
| | | <if test="libtemplatename != null ">#{libtemplatename},</if> |
| | | <if test="patid != null ">#{patid},</if> |
| | | <if test="openid != null ">#{openid},</if> |
| | | <if test="longSendTime != null ">#{longSendTime},</if> |
| | | <if test="serviceType != null ">#{serviceType},</if> |
| | | <if test="score != null ">#{score},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if> |
| | | <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> |
| | | <if test="patid != null ">patid = #{patid},</if> |
| | | <if test="openid != null ">openid = #{openid},</if> |
| | | <if test="longSendTime != null ">long_send_time = #{longSendTime},</if> |
| | | <if test="sendstate != null ">sendstate = #{sendstate},</if> |
| | | <if test="serviceType != null ">service_type = #{serviceType},</if> |
| | | <if test="score != null ">score = #{score},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if> |
| | | <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> |
| | | <if test="patid != null ">patid = #{patid},</if> |
| | | <if test="openid != null ">openid = #{openid},</if> |
| | | <if test="longSendTime != null ">long_send_time = #{longSendTime},</if> |
| | | <if test="serviceType != null ">service_type = #{serviceType},</if> |
| | | <if test="score != null ">score = #{score},</if> |
| | | |
| | | </trim> |
| | | where patid = #{patid} and taskid = #{taskid} |
| | | </update> |
| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="deleteServiceSubtaskByCondition" > |
| | | <update id="deleteServiceSubtaskByCondition"> |
| | | update service_subtask |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | del_flag =1 |
| | |
| | | |
| | | select id, |
| | | sendname, |
| | | long_send_time, |
| | | phone, |
| | | sex, |
| | | age, |
| | | openid, |
| | | sfzh, |
| | | addr, |
| | | senderdetail, |
| | |
| | | roomno, |
| | | admindate, |
| | | patid, |
| | | service_type, |
| | | deptname, |
| | | score, |
| | | diagname |
| | | FROM service_subtask, |
| | | JSON_TABLE(send_time_slot, '$[*]' COLUMNS ( |
| | |
| | | AND del_flag = 0 |
| | | </select> |
| | | |
| | | <!-- 获取随访门诊每月的数量--> |
| | | <select id="getSfFzInfoEveryMonth" parameterType="com.smartor.domain.ServiceSubtaskCountReq" |
| | | resultMap="ServiceSubtaskResult2"> |
| | | SELECT DATE_FORMAT(st.finishtime, '%Y-%m') AS month, |
| | | st.service_type as service_type, |
| | | st.id as subTaskId, |
| | | COUNT(*) AS count |
| | | FROM |
| | | service_subtask st |
| | | JOIN |
| | | sys_user_dept dd |
| | | ON dep.dept_id = dd.dept_id |
| | | WHERE |
| | | dd.user_id =#{userId} |
| | | AND st.finishtime IS NOT NULL |
| | | and DATE_FORMAT(st.finishtime |
| | | , '%Y-%m') >= #{startTime} |
| | | and DATE_FORMAT(st.finishtime |
| | | , '%Y-%m') <= #{endTime} |
| | | GROUP BY |
| | | month, st.service_type, st.id |
| | | ORDER BY |
| | | month, st.service_type, st.id; |
| | | </select> |
| | | |
| | | </mapper> |