|
@@ -1,14 +1,24 @@
|
1
|
1
|
package com.controller;
|
2
|
2
|
|
|
3
|
+import com.pojo.entity.AEntity;
|
|
4
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
5
|
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
6
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
3
|
7
|
import org.springframework.stereotype.Controller;
|
4
|
8
|
import org.springframework.web.bind.annotation.RequestMapping;
|
5
|
9
|
import org.springframework.web.bind.annotation.ResponseBody;
|
6
|
10
|
|
7
|
11
|
@Controller
|
8
|
12
|
public class UserController {
|
|
13
|
+ @Autowired
|
|
14
|
+ JdbcTemplate jdbcTemplate;
|
9
|
15
|
@RequestMapping("uu")
|
10
|
16
|
@ResponseBody
|
11
|
17
|
public String uu() {
|
|
18
|
+ AEntity aEntity = jdbcTemplate.queryForObject("select * from wb_tbl_a where id = ?",
|
|
19
|
+ new BeanPropertyRowMapper<AEntity>(AEntity.class),
|
|
20
|
+ "10"
|
|
21
|
+ );
|
12
|
22
|
return "uu";
|
13
|
23
|
}
|
14
|
24
|
}
|