|
@@ -1,8 +1,10 @@
|
1
|
1
|
package com.example.springbootdemo.controller;
|
2
|
2
|
|
|
3
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
4
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
3
|
5
|
import com.example.springbootdemo.entity.FootScanEntity;
|
4
|
6
|
import com.example.springbootdemo.entity.FootScanGroup;
|
5
|
|
-import com.example.springbootdemo.mapper.FootScanGroupMapper;
|
|
7
|
+import com.example.springbootdemo.mapper.FootScanMapper;
|
6
|
8
|
import com.example.springbootdemo.service.FootScanGroupService;
|
7
|
9
|
import com.example.springbootdemo.service.FootScanService;
|
8
|
10
|
import com.example.springbootdemo.zxyTeST.sql.dao.ArmGrabRepository;
|
|
@@ -28,6 +30,10 @@ public class HelloController {
|
28
|
30
|
FootScanService footScanService;
|
29
|
31
|
@Autowired
|
30
|
32
|
FootScanGroupService footScanGroupService;
|
|
33
|
+ @Autowired
|
|
34
|
+ FootScanMapper footScanMapper;
|
|
35
|
+
|
|
36
|
+
|
31
|
37
|
@RequestMapping("/hello")
|
32
|
38
|
public void hello() {
|
33
|
39
|
List<Color> listColors = colorRepository.findByColorId(2314);
|
|
@@ -52,19 +58,29 @@ public class HelloController {
|
52
|
58
|
|
53
|
59
|
}
|
54
|
60
|
@RequestMapping("mybatis")
|
55
|
|
- public List<FootScanEntity> getById(@RequestParam("foot_scan_id") Long foot_scan_id) {
|
|
61
|
+ public FootScanEntity getById(@RequestParam("foot_scan_id") Long foot_scan_id) {
|
56
|
62
|
return footScanService.getFootScanById(foot_scan_id);
|
57
|
63
|
|
58
|
64
|
}
|
59
|
65
|
@RequestMapping("mybatis1")
|
60
|
66
|
public FootScanGroup getFootScanGroup(@RequestParam("foot_scan_group_id") Long foot_scan_group_id) {
|
61
|
|
- return footScanGroupService.findByFootScanGroupId(foot_scan_group_id);
|
|
67
|
+ return footScanGroupService.getById(foot_scan_group_id);
|
62
|
68
|
}
|
63
|
69
|
@RequestMapping(value = "/mybatis2",method = RequestMethod.POST)
|
64
|
70
|
public FootScanGroup addFootScanGroup(@RequestBody FootScanGroup footScanGroup) {
|
65
|
|
- footScanGroupService.addFootScanGroup(footScanGroup);
|
|
71
|
+ footScanGroupService.save(footScanGroup);
|
66
|
72
|
return footScanGroup;
|
67
|
73
|
}
|
|
74
|
+ @RequestMapping("mybatis3")
|
|
75
|
+ public FootScanEntity getFootScanInfo(@RequestParam("foot_scan_id") Long foot_scan_id) {
|
|
76
|
+ return footScanMapper.queryFootScanInfo(foot_scan_id);
|
|
77
|
+ }
|
|
78
|
+ @RequestMapping("mybatis4")
|
|
79
|
+ public List<FootScanEntity> getFootScanListPage() {
|
|
80
|
+ Page<FootScanEntity> footScanEntityPage = new Page<>(1,20);
|
|
81
|
+ footScanService.page(footScanEntityPage,null);
|
|
82
|
+ return footScanEntityPage.getRecords();
|
|
83
|
+ }
|
68
|
84
|
|
69
|
85
|
}
|
70
|
86
|
|