一 映射匹配兼容机制
1.映射数据库的字段名
问题描述:
当数据库表字段和实体类的属性名称出现不匹配时:

解决:

知识点:

2.忽略实体类的部分字段
问题描述:
当要表示如 显示用户是否在线等消息,,这类消息不在数据库中存储,但是在实体类中应用
解决:

知识点:
 
3. 关闭部分字段的查询
问题描述:
默认查询会直接查询出所有数据,例如密码数据是不应该被查询的
解决:
 
知识点:
 
4.表名与实体类名不同步
问题描述:
解决:
知识点:
还可以在配置文件中 搞全局配置。。。
spring:datasource:type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/www?serverTimezone=UTCusername: rootpassword: rootmain:banner-mode: offmybatis-plus:configuration:log-impl: org.apache.ibatis.logging.stdout.StdOutImplglobal-config:banner: falsedb-config:table-prefix: tbl_id-type: assign_id
二 id自动生成机制

雪花算法:格式如下图

字段前加:@TableId(type = IdType.AUTO)

全局配置:
spring:datasource:type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/www?serverTimezone=UTCusername: rootpassword: rootmain:banner-mode: offmybatis-plus:configuration:log-impl: org.apache.ibatis.logging.stdout.StdOutImplglobal-config:banner: falsedb-config:table-prefix: tbl_   //全局配置实体类映射的数据库表前缀id-type: assign_id   //全局配置数据库表中id的自增效果三 多数据操作
