kaiyu
2022-01-17 21a44d6cb9a372bce5c7418d2a82c88bb0485e60
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
package com.moral.api.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.moral.api.entity.CityAqiYearly;
import com.moral.api.mapper.CityAqiYearlyMapper;
import com.moral.api.service.CityAqiYearlyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
import java.util.List;
 
/**
 * <p>
 * 城市aqi年数据表 服务实现类
 * </p>
 *
 * @author moral
 * @since 2021-11-05
 */
@Service
public class CityAqiYearlyServiceImpl extends ServiceImpl<CityAqiYearlyMapper, CityAqiYearly> implements CityAqiYearlyService {
 
    @Autowired
    CityAqiYearlyMapper cityAqiYearlyMapper;
 
    @Override
    public List<CityAqiYearly> getCityAqiYearlyByRegionCodeAndTime(Integer regionCode, Date startDate, Date endDate) {
        QueryWrapper<CityAqiYearly> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("city_code",regionCode);
        queryWrapper.between("time",startDate,endDate);
        return cityAqiYearlyMapper.selectList(queryWrapper);
    }
}