Mybatis注解设置自增主键

@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);
发布了33 篇原创文章 · 获赞 0 · 访问量 366

猜你喜欢

转载自blog.csdn.net/weixin_43596905/article/details/104868356