Commit 82ae531afcafa043ce135b841e537c986a8dac45
1 parent
afdd1ef3
新增接口
Showing
3 changed files
with
49 additions
and
0 deletions
src/main/java/com/example/demo/control/Ticket.java
0 → 100644
| 1 | +package com.example.demo.control; | |
| 2 | + | |
| 3 | +import com.example.demo.mapper.db1.SiteMapper1; | |
| 4 | +import com.example.demo.model.TJRLDB; | |
| 5 | +import org.slf4j.Logger; | |
| 6 | +import org.slf4j.LoggerFactory; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 10 | +import org.springframework.web.bind.annotation.RestController; | |
| 11 | +import java.util.ArrayList; | |
| 12 | +import java.util.HashMap; | |
| 13 | +import java.util.List; | |
| 14 | +import java.util.Map; | |
| 15 | + | |
| 16 | + | |
| 17 | +@RestController | |
| 18 | +@RequestMapping("ticket") | |
| 19 | +public class Ticket { | |
| 20 | + | |
| 21 | + @Autowired | |
| 22 | + private SiteMapper1 siteMapper1; | |
| 23 | + | |
| 24 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 25 | + | |
| 26 | + @RequestMapping("getList") | |
| 27 | + public List<TJRLDB> getSchedules(@RequestParam String date,@RequestParam String nbbm){ | |
| 28 | + List<TJRLDB> tjrldbList = new ArrayList<>(); | |
| 29 | + try { | |
| 30 | + Map<String, String> map = new HashMap<>(); | |
| 31 | + map.put("date",date); | |
| 32 | + map.put("nbbm",nbbm); | |
| 33 | + tjrldbList=siteMapper1.getT_jc_result(map); | |
| 34 | + } catch (Exception e) { | |
| 35 | + e.printStackTrace(); | |
| 36 | + } | |
| 37 | + logger.info(">>>>>>>>>>>>>>>>路单信息返回:"+tjrldbList.size()); | |
| 38 | + return tjrldbList; | |
| 39 | + } | |
| 40 | + | |
| 41 | + | |
| 42 | +} | |
| 0 | 43 | \ No newline at end of file | ... | ... |
src/main/java/com/example/demo/mapper/db1/SiteMapper1.java
src/main/resources/mapping/db1/Site-mapper1.xml
| ... | ... | @@ -70,5 +70,8 @@ |
| 70 | 70 | from ${table} where TJRLRDATE >= '${start}' and TJRLRDATE < '${end}' |
| 71 | 71 | </select> |
| 72 | 72 | |
| 73 | + <select id="getT_jc_result" resultType="com.example.demo.model.TJRLDB"> | |
| 74 | + SELECT * from passenger_flow.t_jc_result where TJRLRDATE = '${date}' and BUS_CODE = '${nbbm}' | |
| 75 | + </select> | |
| 73 | 76 | |
| 74 | 77 | </mapper> |
| 75 | 78 | \ No newline at end of file | ... | ... |