引言
MyBatisX一款基于 IDEA 的快速开发插件,为效率而生
1.在idea中下载MyBatisX插件
![](https://img-blog.csdnimg.cn/img_convert/2b1057a2c89a1e799f25b1c745dbd60b.png)
安装重启就下载好了
1.1MyBatisX中XML文件与mapper相对应
![](https://img-blog.csdnimg.cn/img_convert/8256debee1ae44775a58d4fcd1c12552.png)
好处:两个小鸽子点的话可以相互对应,方便我们在开发大项目的时候快速找到对应xml文件
2.MyBatisX自动生成配置类文件
2.1用idea连接数据库
![](https://img-blog.csdnimg.cn/img_convert/f5a02b4e3e2e8a7319e0dfc852c0270f.png)
2.2点击对应的表使用MybatisX打开
![](https://img-blog.csdnimg.cn/img_convert/facffef11fb87378308444b1b3396956.png)
2.3.设置相应的属性
![](https://img-blog.csdnimg.cn/img_convert/7873cfbfc61f658e6a99cd3c05fd588c.png)
![](https://img-blog.csdnimg.cn/img_convert/b29893f8ca2246cf453c5598e3bb8489.png)
2.4.创建成功
![](https://img-blog.csdnimg.cn/img_convert/cc0e268b274d78652496508665545b04.png)
3.MyBatisX的使用
3.1编写常见的CRUD
![](https://img-blog.csdnimg.cn/img_convert/9c18677e923deedfe94dacec24eaf6cb.png)
在Usermapper中编写相应的CRUD方法的时候,应该键名实意,然后再使用快捷键
Alt+Enter.就直接生成相应方法和对应的mapper.XML文件
![](https://img-blog.csdnimg.cn/img_convert/ce2a7bd0a4aeb8e81a0d5b55dce6a291.png)
![](https://img-blog.csdnimg.cn/img_convert/f5a994eea543bfb298dd8c08a69dbfd4.png)
3.2使用来联合查询的方式
![](https://img-blog.csdnimg.cn/img_convert/42a074a62d5e371ff71e9b9b8b7b8938.png)
两者直接键实意,外加And连接下一个语句即可
总结
MyBatisX插件在开发的过程中非常的遍历与快捷
MyBatisX插件可以快速的编写相应CRUD代码
MyBatisX插件告诉我们更要键名实意
MyBatisX插件告诉我们约定大于配置