有两种方式:
这个是使用注解
第二种:
写mapper文件
最好是在dao包中写入xml文件
如果不在dao包的话,就要用locations来标明
如果是idea,要先让idea能够识别xml文件,我的另一个文章里有
官方文档:
https://baomidou.gitee.io/mybatis-plus-doc/#/spring-boot
有两种方式:
这个是使用注解
第二种:
写mapper文件
最好是在dao包中写入xml文件
如果不在dao包的话,就要用locations来标明
如果是idea,要先让idea能够识别xml文件,我的另一个文章里有
官方文档:
https://baomidou.gitee.io/mybatis-plus-doc/#/spring-boot