INSERT INTO mini_stray_animal_note_collect
(uuid, note_id, mini_user_id, create_time, create_timestamp, create_by, update_time, update_timestamp, update_by, is_deleted)
VALUES
(#{uuid}, #{noteId}, #{miniUserId}, #{createTime}, #{createTimestamp}, #{createBy}, #{updateTime}, #{updateTimestamp}, #{updateBy}, #{deleted})
ON DUPLICATE KEY UPDATE
is_deleted = 0,
update_time = VALUES(update_time),
update_timestamp = VALUES(update_timestamp),
update_by = VALUES(update_by)
UPDATE mini_stray_animal_note_collect
SET is_deleted = 1,
update_time = NOW(),
update_timestamp = #{currentTime},
update_by = #{userId}
WHERE note_id = #{noteId}
AND mini_user_id = #{userId}
AND is_deleted = 0