LineRegionServiceImpl.java
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.bsth.service.impl;
import com.bsth.entity.LineRegion;
import com.bsth.entity.LsStationRoute;
import com.bsth.repository.LineRegionRepository;
import com.bsth.service.LineRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @Author Hill
*/
@Service
public class LineRegionServiceImpl extends BaseServiceImpl<LineRegion, Integer> implements LineRegionService {
@Autowired
private LineRegionRepository lineRegionRepository;
@Override
public List<LsStationRoute> findStationRoutes(Integer regionId) {
return lineRegionRepository.findStationRoutes(regionId);
}
@Transactional
@Override
public Map<String, Object> add(LineRegion lineRegion) {
Integer seq = lineRegionRepository.getLatestSeq(lineRegion.getLine(), lineRegion.getVersion()) + 1;
lineRegion.setSeq(seq);
lineRegionRepository.save(lineRegion);
return Collections.emptyMap();
}
}