隐藏页面特效

IDEA自身的数据库连接及Mybatis-plus插件使用方法

1|0IDEA自身的数据库连接介绍:


1|1IDEA连接创建连接数据库:



1|2创建表:




使用sql语句:

create table user
(
id bigint auto_increment comment 'id'
primary key,
username varchar(256)
null comment '用户昵称',
userAccount varchar(256)
null comment '账号',
avatarUrl varchar(1024) default
'https://img1.baidu.com/it/u=1966616150,2146512490&fm=253&fmt=auto&app=138&f=JPE
G?w=751&h=500' null comment '用户头像',
gender tinyint
null comment '性别',
userPassword varchar(512)
not null comment '密码',
phone varchar(128)
null comment '电话',
email varchar(512)
null comment '邮箱',
userStatus int default 0
not null comment '状态 0 - 正
常',
createTime datetime default CURRENT_TIMESTAMP
null comment '创建时间',
updateTime datetime default CURRENT_TIMESTAMP
null on update
CURRENT_TIMESTAMP comment '更新时间',
isDelete tinyint default 0
not null comment '是否删除(逻
辑删除)',
userRole int default 0
not null comment '用户权限 0
- 普通用户 1 - 管理员',
);

2|0Mybatis-plus日常使用:


插件mybatis-x:


2|1tips:使用插件 GenerateAllSetter 生成对象的 set 方法



配置如下:

# mybatis-plus的配置
mybatis-plus:
configuration:
# 解决 mybatis-plus 框架中 “ Unknown column 'user_account' in 'field
list'”
map-underscore-to-camel-case: false


__EOF__

本文作者techgy
本文链接https://www.cnblogs.com/techgy/p/17524113.html
关于博主:I am a good person
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   AI未来10Y  阅读(365)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
点击右上角即可分享
微信分享提示