|  |  | 
 |  |  |         <result property="libtemplatename" column="libtemplatename"/> | 
 |  |  |         <result property="libtemplateid" column="libtemplateid"/> | 
 |  |  |         <result property="openid" column="openid"/> | 
 |  |  |         <result property="longSendTime" column="long_send_time"/> | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <sql id="selectServiceSubtaskVo"> | 
 |  |  |         select id, | 
 |  |  |                hosp_type, | 
 |  |  |                long_send_time, | 
 |  |  |                openid, | 
 |  |  |                libtemplateid, | 
 |  |  |                libtemplatename, | 
 |  |  | 
 |  |  |         from service_subtask | 
 |  |  |     </sql> | 
 |  |  |  | 
 |  |  |     <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask" resultMap="ServiceSubtaskResult"> | 
 |  |  |     <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask" | 
 |  |  |             resultMap="ServiceSubtaskResult"> | 
 |  |  |         <include refid="selectServiceSubtaskVo"/> | 
 |  |  |         <where> | 
 |  |  |             del_flag=0 | 
 |  |  | 
 |  |  |             <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="openid != null ">and openid = #{openid},</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> | 
 |  |  |         </where> | 
 |  |  |         order by update_time desc,id desc | 
 |  |  |     </select> | 
 |  |  | 
 |  |  |             <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> | 
 |  |  |  | 
 |  |  |         </trim> | 
 |  |  |         <trim prefix="values (" suffix=")" suffixOverrides=","> | 
 |  |  |             <if test="sendname != null">#{sendname},</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> | 
 |  |  |  | 
 |  |  |         </trim> | 
 |  |  |     </insert> | 
 |  |  |  | 
 |  |  | 
 |  |  |             <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> | 
 |  |  |         </trim> | 
 |  |  |         where id = #{id} | 
 |  |  |     </update> | 
 |  |  | 
 |  |  |             <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> | 
 |  |  |         </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, |