|
@@ -1,7 +1,9 @@
|
1
|
1
|
package com.example.springbootdemo.controller;
|
2
|
2
|
|
3
|
3
|
import com.example.demo.controller.User;
|
|
4
|
+import com.example.springbootdemo.zxyTeST.sql.dao.ArmGrabRepository;
|
4
|
5
|
import com.example.springbootdemo.zxyTeST.sql.dao.ColorRepository;
|
|
6
|
+import com.example.springbootdemo.zxyTeST.sql.entity.ArmGrabEntity;
|
5
|
7
|
import com.example.springbootdemo.zxyTeST.sql.entity.Color;
|
6
|
8
|
import org.springframework.beans.factory.annotation.Autowired;
|
7
|
9
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -13,12 +15,18 @@ import java.util.List;
|
13
|
15
|
public class HelloController {
|
14
|
16
|
@Autowired
|
15
|
17
|
ColorRepository colorRepository;
|
|
18
|
+ @Autowired
|
|
19
|
+ ArmGrabRepository armGrabRepository;
|
16
|
20
|
@RequestMapping("/hello")
|
17
|
21
|
public void hello() {
|
18
|
22
|
List<Color> listColors = colorRepository.findByColorId(2314);
|
19
|
23
|
for (Color color:listColors) {
|
20
|
24
|
System.out.println("color_name="+color.getColorName()+" color_id="+color.getColorId());
|
21
|
25
|
}
|
|
26
|
+ List<ArmGrabEntity> armGrabEntityList = armGrabRepository.findByArmGrabId(1);
|
|
27
|
+ for (ArmGrabEntity armGrabEntity:armGrabEntityList) {
|
|
28
|
+ System.out.println("id="+armGrabEntity.getArmGrabId()+" device_code="+armGrabEntity.getDeviceCode());
|
|
29
|
+ }
|
22
|
30
|
}
|
23
|
31
|
|
24
|
32
|
|