Commit c09245a20b3918bca26373195a01de4c80d5772f
1 parent
b1122571
接口参数中加线路的权证配车数
Showing
1 changed file
with
11 additions
and
1 deletions
src/main/java/com/bsth/server_rs/bigdata/BigdataService.java
| ... | ... | @@ -1786,7 +1786,8 @@ public class BigdataService { |
| 1786 | 1786 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 1787 | 1787 | Date rq = sdf.parse(date); |
| 1788 | 1788 | |
| 1789 | - String xlSql="SELECT line_code, name, nature from bsth_c_line where name is not null and name != ''"; | |
| 1789 | + String xlSql="SELECT line_code, name, nature, ifnull(warrant_car, '') warrant_car" | |
| 1790 | + + " from bsth_c_line where name is not null and name != ''"; | |
| 1790 | 1791 | List<Map<String, Object>> xlList=jdbcTemplate.query(xlSql, |
| 1791 | 1792 | new RowMapper<Map<String, Object>>(){ |
| 1792 | 1793 | @Override |
| ... | ... | @@ -1795,14 +1796,17 @@ public class BigdataService { |
| 1795 | 1796 | m.put("lineCode", rs.getString("line_code")); |
| 1796 | 1797 | m.put("lineName", rs.getString("name")); |
| 1797 | 1798 | m.put("nature", rs.getString("nature")); |
| 1799 | + m.put("warrantCar", rs.getString("warrant_car")); | |
| 1798 | 1800 | return m; |
| 1799 | 1801 | } |
| 1800 | 1802 | }); |
| 1801 | 1803 | Set<String> yyLine = new HashSet<String>(); |
| 1802 | 1804 | Map<String, Object> allLineMap = new HashMap<String, Object>(); |
| 1805 | + Map<String, String> warrantCarMap = new HashMap<String, String>(); | |
| 1803 | 1806 | for(Map<String, Object> t : xlList){ |
| 1804 | 1807 | if(t.get("lineCode") != null){ |
| 1805 | 1808 | allLineMap.put(t.get("lineCode").toString(), t.get("lineName").toString()); |
| 1809 | + warrantCarMap.put(t.get("lineCode").toString(), t.get("warrantCar").toString()); | |
| 1806 | 1810 | String nature = t.get("nature")!=null?t.get("nature").toString():""; |
| 1807 | 1811 | if("yxl".equals(nature) || "cgxl".equals(nature) || "gjxl".equals(nature) |
| 1808 | 1812 | || "csbs".equals(nature) || "cctxl".equals(nature)){ |
| ... | ... | @@ -2047,6 +2051,12 @@ public class BigdataService { |
| 2047 | 2051 | for(String key : xlMap.keySet()){ |
| 2048 | 2052 | Map<String, Object> m = xlMap.get(key); |
| 2049 | 2053 | m.put("cars", carsMap.get(key)); |
| 2054 | + String xl = m.get("xl").toString(); | |
| 2055 | + if(warrantCarMap.containsKey(xl)){ | |
| 2056 | + m.put("warrantCar", warrantCarMap.get(xl)); | |
| 2057 | + } else { | |
| 2058 | + m.put("warrantCar", ""); | |
| 2059 | + } | |
| 2050 | 2060 | resList.add(m); |
| 2051 | 2061 | } |
| 2052 | 2062 | ... | ... |