SELECT nextval('batch_log_seq')
INSERT INTO batch_log (id, type, status, start_at, created_at)
VALUES (#{id}, #{type}, #{status}, #{startAt}, now())
UPDATE batch_log
SET status = #{status},
error_message = #{errorMessage},
end_at = now()
WHERE id = #{id}