xyc
4 天以前 922823a3f1faaf0293256e3ffb1285eaeb8a3b23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.trafficaudit.observation.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.trafficaudit.observation.dto.ObservationDateSummary;
import com.trafficaudit.observation.entity.ObservationStationFlow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
 
@Mapper
public interface ObservationStationFlowMapper extends BaseMapper<ObservationStationFlow> {
 
    @Select("SELECT obs_date, COUNT(*) AS station_count, "
            + "SUM(small_medium_passenger) AS small_medium_passenger_total, "
            + "MAX(updated_at) AS imported_at "
            + "FROM observation_station_flow GROUP BY obs_date ORDER BY obs_date ASC")
    List<ObservationDateSummary> selectDateSummary();
}