<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fs.store.mapper.FsMiniprogramSubNotifyTaskMapper">
    <insert id="insertBatch">
        INSERT INTO fs_miniprogram_sub_notify_task (
        id,
        task_name,
        template_id,
        touser,
        page,
        data,
        status,
        retry_count,
        max_retries,
        request_params,
        request_body,
        response_body,
        error_message,
        create_time,
        update_time
        ) VALUES
        <foreach collection="list" item="item" separator=",">
            (
            #{item.id},
            #{item.taskName},
            #{item.templateId},
            #{item.touser},
            #{item.page},
            #{item.data},
            #{item.status},
            #{item.retryCount},
            #{item.maxRetries},
            #{item.requestParams},
            #{item.requestBody},
            #{item.responseBody},
            #{item.errorMessage},
            #{item.createTime},
            #{item.updateTime}
            )
        </foreach>
    </insert>

    <update id="updateBatchById" parameterType="java.util.List">
        <foreach collection="list" item="item" separator=";">
            UPDATE fs_miniprogram_sub_notify_task
            SET
            task_name = #{item.taskName},
            template_id = #{item.templateId},
            touser = #{item.touser},
            page = #{item.page},
            data = #{item.data},
            status = #{item.status},
            retry_count = #{item.retryCount},
            max_retries = #{item.maxRetries},
            request_params = #{item.requestParams},
            request_body = #{item.requestBody},
            response_body = #{item.responseBody},
            error_message = #{item.errorMessage},
            update_time = #{item.updateTime}
            WHERE id = #{item.id}
        </foreach>
    </update>

</mapper>
