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 39 40
|
@Service public class NextLineFlowServiceImpl extends ServiceImpl<NextLineFlowMapper, NextLineFlow> implements NextLineFlowService {
@Autowired private NextLineFlowMapper nextLineFlowMapper;
@Override public NextLineFlow sumFlowByLineNameAndTime(List<String> lineNames, Date startTime, Date endTime, String tabSuffix) { MybatisPlusConfig.tableNameLocal.set(tabSuffix); return this.query() .select("linename", "SUM(entryflow) entryflow", "SUM(exitflow) exitflow", "SUM(transferinflow) transferinflow", "SUM(transferoutflow) transferoutflow", "SUM(passengerflow) passengerflow") .in("linename", lineNames) .ge("starttime", startTime) .le("endtime", endTime) .groupBy("linename") .one();
}
@Override public List<NextLineFlow> findByStartTimeGreaterThanEqualAndEndTimeLessThanEqualAndLineNameIn (Date startTime, Date endTime, List<String> stationNames, String tabName) {
return this.lambdaQuery() .in(NextLineFlow::getLineName, stationNames) .ge(NextLineFlow::getStartTime, startTime) .le(NextLineFlow::getEndTime, endTime) .list(); }
}
|