int insert(T record);
int insertSelective(T record);
insertSelective 对应的 SQL 语句加入了 NULL 检验,只会插入数据不为 null 的字段,而 insert会插入所有字段,会插入 null 数据。
insertSelective
insert
也就意味着如果定义了表 default 字段,使用 insert 还是会插入 null 而忽略 default
insertSelective 当字段为 null 时会用 default 自动填充