查询
运行类,添加@MapperScan(“路径”)注解扫描Mapper
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/ec4018e7ef74564925821a4eeed1b152.png)
Controller层
使用RequsetMapping(“路径”)注解设置总请求path,请求使用@GetMapping(),有请求参数时里面加上"/{xx}"并在参数列表对于属性添加@PathVariable注解
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/80a4d1b3a1ee8ea710379a4a0c75ca8c.png)
Service层接口
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/8f6589cd47c39de2d548acb0faf04a28.png)
Service接口层实现类Impl,添加@Service注解
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/b2444a8284ee06124accc6fa68e0b5a9.png)
Mapper编写(未使用Mybatis Plus)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/1b3918029879d3acfe6163b608191bb0.png)
增
使用@PostMapping注解
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/571e9a55c2368966211ee40c542f88bb.png)
删
使用@DeleteMapping注解
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/023b04b9a4d6a999a7e59d2c143c04cb.png)
改
使用@PutMapping注解
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/6701449b6ecdd30e2a37685515d6ee31.png)