Commit c75f40dd5423404940b3594180befbe0401bfef7
1 parent
508e68eb
单日每车加油加电查询接口BUG修
Showing
1 changed file
with
7 additions
and
5 deletions
src/main/java/com/bsth/server_rs/bigdata/BigdataService.java
| @@ -1579,11 +1579,13 @@ public class BigdataService { | @@ -1579,11 +1579,13 @@ public class BigdataService { | ||
| 1579 | 1579 | ||
| 1580 | //单日每车加油加电 | 1580 | //单日每车加油加电 |
| 1581 | @GET | 1581 | @GET |
| 1582 | - @Path("/findCarEnergySupplement/{data}") | 1582 | + @Path("/findCarEnergySupplement/{date}") |
| 1583 | public Map<String, Object> findWaybill(@PathParam("date") String date) { | 1583 | public Map<String, Object> findWaybill(@PathParam("date") String date) { |
| 1584 | Map<String, Object> resMap = new HashMap<String, Object>(); | 1584 | Map<String, Object> resMap = new HashMap<String, Object>(); |
| 1585 | 1585 | ||
| 1586 | - String ylbSql = "select nbbm, sum(jzl) jzl from bsth_c_ylb where rq = ? group by nbbm"; | 1586 | + date = date + " 00:00:00"; |
| 1587 | + | ||
| 1588 | + String ylbSql = "select nbbm, sum(jzl) jzl from bsth_c_ylb where rq = str_to_date(?, '%Y-%m-%d') group by nbbm"; | ||
| 1587 | List<Map<String, Object>> ylbList=jdbcTemplate.query(ylbSql, | 1589 | List<Map<String, Object>> ylbList=jdbcTemplate.query(ylbSql, |
| 1588 | new Object[] {date}, | 1590 | new Object[] {date}, |
| 1589 | new RowMapper<Map<String, Object>>(){ | 1591 | new RowMapper<Map<String, Object>>(){ |
| @@ -1596,8 +1598,8 @@ public class BigdataService { | @@ -1596,8 +1598,8 @@ public class BigdataService { | ||
| 1596 | } | 1598 | } |
| 1597 | }); | 1599 | }); |
| 1598 | 1600 | ||
| 1599 | - String dlbSql = "select nbbm, sum(cdl) cdl from bsth_c_dlb where rq = ? group by nbbm"; | ||
| 1600 | - List<Map<String, Object>> dlbList=jdbcTemplate.query(ylbSql, | 1601 | + String dlbSql = "select nbbm, sum(cdl) cdl from bsth_c_dlb where rq = str_to_date(?, '%Y-%m-%d') group by nbbm"; |
| 1602 | + List<Map<String, Object>> dlbList=jdbcTemplate.query(dlbSql, | ||
| 1601 | new Object[] {date}, | 1603 | new Object[] {date}, |
| 1602 | new RowMapper<Map<String, Object>>(){ | 1604 | new RowMapper<Map<String, Object>>(){ |
| 1603 | @Override | 1605 | @Override |
| @@ -1611,7 +1613,7 @@ public class BigdataService { | @@ -1611,7 +1613,7 @@ public class BigdataService { | ||
| 1611 | 1613 | ||
| 1612 | resMap.put("oilList", ylbList); | 1614 | resMap.put("oilList", ylbList); |
| 1613 | resMap.put("electricList", dlbList); | 1615 | resMap.put("electricList", dlbList); |
| 1614 | - return null; | 1616 | + return resMap; |
| 1615 | } | 1617 | } |
| 1616 | 1618 | ||
| 1617 | } | 1619 | } |