id, user_id, note_id, create_time, `status` INSERT INTO t_note_collection (user_id, note_id, create_time, status) VALUES (#{userId}, #{noteId}, #{createTime}, #{status}) ON DUPLICATE KEY UPDATE create_time = #{createTime}, status = #{status}; update t_note_collection set status = #{status}, create_time = #{createTime} where user_id = #{userId} and note_id = #{noteId} and status = 1 INSERT INTO t_note_collection (user_id, note_id, status, create_time) VALUES (#{item.userId}, #{item.noteId}, #{item.status}, #{item.createTime}) ON DUPLICATE KEY UPDATE status = VALUES(status)