int insert(T record);
int insertSelective(T record);
insertSelective
對應的 SQL 語句加入了 NULL 檢驗,只會插入數據不為 null 的字段,而 insert
會插入所有字段,會插入 null 數據。
也就意味着如果定義了表 default 字段,使用 insert 還是會插入 null 而忽略 default
insertSelective 當字段為 null 時會用 default 自動填充