Commit d16ef82f964214f21e61eea66516bcae8c49b244
1 parent
ba993fd0
update...
Showing
4 changed files
with
17 additions
and
3 deletions
src/main/java/com/bsth/controller/berth/BerthController.java
| ... | ... | @@ -17,4 +17,9 @@ public class BerthController extends BaseController<RegionBerth, Integer> { |
| 17 | 17 | @Autowired |
| 18 | 18 | BerthService berthService; |
| 19 | 19 | |
| 20 | + @RequestMapping("max_order_no") | |
| 21 | + public String maxOrderNo() { | |
| 22 | + String rs = berthService.maxOrderNo(); | |
| 23 | + return rs==null?"0":rs; | |
| 24 | + } | |
| 20 | 25 | } | ... | ... |
src/main/java/com/bsth/repository/berth/BerthRepository.java
| ... | ... | @@ -2,6 +2,7 @@ package com.bsth.repository.berth; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.berth.RegionBerth; |
| 4 | 4 | import com.bsth.repository.BaseRepository; |
| 5 | +import org.springframework.data.jpa.repository.Query; | |
| 5 | 6 | import org.springframework.stereotype.Repository; |
| 6 | 7 | |
| 7 | 8 | /** |
| ... | ... | @@ -10,6 +11,6 @@ import org.springframework.stereotype.Repository; |
| 10 | 11 | @Repository |
| 11 | 12 | public interface BerthRepository extends BaseRepository<RegionBerth, Integer>{ |
| 12 | 13 | |
| 13 | -/* @Query("select max(b.orderNo) from RegionBerth b") | |
| 14 | - String maxOrderNo();*/ | |
| 14 | + @Query("select max(b.orderNo) from RegionBerth b") | |
| 15 | + String maxOrderNo(); | |
| 15 | 16 | } | ... | ... |
src/main/java/com/bsth/service/berth/BerthService.java
src/main/java/com/bsth/service/berth/impl/BerthServiceImpl.java
| ... | ... | @@ -27,6 +27,14 @@ public class BerthServiceImpl extends BaseServiceImpl<RegionBerth, Integer> impl |
| 27 | 27 | @Autowired |
| 28 | 28 | CarParkRealHandler carParkRealHandler; |
| 29 | 29 | |
| 30 | + @Autowired | |
| 31 | + BerthRepository berthRepository; | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public String maxOrderNo() { | |
| 35 | + return berthRepository.maxOrderNo(); | |
| 36 | + } | |
| 37 | + | |
| 30 | 38 | /** |
| 31 | 39 | * 充电枪状态 |
| 32 | 40 | * -404 空闲 | ... | ... |