package com.base.track.mapper;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.base.track.model.dto.request.QueryEphListDTO;
import com.base.track.model.entity.SubPointData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
public interface SubPointDataMapper extends BaseMapper<SubPointData> {

    List<SubPointData> getSingleSatelliteSubPointDataList(@Param("code") String satelliteCode, @Param("startTime")  Date startTime, @Param("endTime")  Date endTime);
    List<SubPointData> getSubPointDataLists(@Param("code") String satelliteCode, @Param("startTime")  Date startTime, @Param("endTime")  Date endTime,@Param("updown") String updown);
    List<SubPointData> satelliteSubPointDataList(@Param("code") String satelliteCode, @Param("startTime")  Date startTime, @Param("endTime")  Date endTime);
    void deleteByDate(@Param("startTime") String startTime, @Param("endTime") String endTime);

    List<SubPointData> selectByStaAndTime(@Param("code") List<String> code, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    default List<SubPointData> selectByTime(Date startTime, Date endTime) {
        return this.selectList(new QueryWrapper<SubPointData>().ge("start_time",startTime).le("end_time",endTime));
    }

    List<SubPointData> selectCommonSubPointDataList(@Param("dto") QueryEphListDTO queryEphListDTO);

    List<SubPointData> selectEleSubPointDataList(@Param("dto") QueryEphListDTO queryEphListDTO);

    void batch(@Param("list") List<SubPointData> list,@Param("code") String code);

    List<SubPointData> selectSubPointDataListforStrip1(@Param("code") String code,
                                                       @Param("updownint") int updownint,
                                                       @Param("starttime") String starttime,
                                                       @Param("endtime") String endtime,
                                                       @Param("southlat") double southlat,
                                                       @Param("northlat") double northlat,
                                                       @Param("westlonQuery") double westlonQuery,
                                                       @Param("eastlonQuery") double eastlonQuery);

    List<SubPointData> selectSubPointDataListforStrip2(@Param("code") String code,
                                                       @Param("updownint") int updownint,
                                                       @Param("starttime") String starttime,
                                                       @Param("endtime") String endtime,
                                                       @Param("southlat") double southlat,
                                                       @Param("northlat") double northlat,
                                                       @Param("westlonQuery") double westlonQuery,
                                                       @Param("eastlonQuery") double eastlonQuery);

    List<SubPointData> selectSubPointDataListforStrip3(@Param("code") String code,
                                                       @Param("updownint") int updownint,
                                                       @Param("starttime") String starttime,
                                                       @Param("endtime") String endtime,
                                                       @Param("southlat") double southlat,
                                                       @Param("northlat") double northlat,
                                                       @Param("westlonQuery") double westlonQuery,
                                                       @Param("eastlonQuery") double eastlonQuery);

    List<SubPointData> selectSubPointDataListforStrip4(@Param("code") String code,
                                                       @Param("updownint") int updownint,
                                                       @Param("starttime") String starttime,
                                                       @Param("endtime") String endtime,
                                                       @Param("southlat") double southlat,
                                                       @Param("northlat") double northlat,
                                                       @Param("westlonQuery") double westlonQuery,
                                                       @Param("eastlonQuery") double eastlonQuery);


}
