@Insert(value = "INSERT INTO category (cat_name,cat_sort,is_enable) " +
"VALUES (#{catName},#{catSort},#{isEnable})")
//设置主键自增
@Options(useGeneratedKeys = true,keyProperty = "catId",keyColumn = "cat_id")
void insertCategory(Category category);
Mybatis注解设置自增主键
最新推荐文章于 2024-03-08 10:23:37 发布