陈昶聿
9 天以前 126d76bf7498be4f508bc66496e06ae217faee36
smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml
@@ -247,22 +247,39 @@
        </trim>
        where 1=1
            <if test="subid != null">and subid =
                #{subid},
                #{subid}
            </if>
            <if test="taskid != null">and taskid =
                #{taskid},
                #{taskid}
            </if>
            <if test="preachform != null">and preachform =
                #{preachform},
                #{preachform}
            </if>
            <if test="remark != null">and remark =
                #{remark},
                #{remark}
            </if>
            <if test="orgid != null">and orgid =
                #{orgid},
                #{orgid}
            </if>
    </update>
    <!-- 微信公众号已领取未填写按默认选项完成:仅更新当前子任务的当前公众号行。
         只允许从已发送(2)/已领取(3)迁移到完成(9),避免并发或重复补偿覆盖其他状态。 -->
    <update id="updateWechatPreachformComplete" parameterType="com.smartor.domain.ServiceSubtaskPreachform">
        update service_subtask_preachform
        set sendstate = '9',
            remark = case
                         when remark is null or remark = '' then #{remark}
                         else concat(remark, ',', #{remark})
                     end,
            update_time = now()
        where id = #{id}
          and subid = #{subid}
          and orgid = #{orgid}
          and preachform = #{preachform}
          and sendstate in ('2', '3')
    </update>
    <update id="deleteServiceSubtaskPreachformById" parameterType="Long">
        update service_subtask_preachform