package space.nstart.pcp.pcp_request_service.repository

import jakarta.transaction.Transactional
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param
import space.nstart.pcp.pcp_request_service.entity.AscNodeEntity
import space.nstart.pcp.pcp_request_service.entity.EarthCellViewsEntity

interface EarthCellViewRepository : JpaRepository<EarthCellViewsEntity, Long>{
    @Modifying
    @Transactional
    @Query("DELETE FROM  cell_covering WHERE satellite_id =:sat", nativeQuery = true)
    fun deleteBySatId(@Param("sat") sat : Long) : Int


    fun findBySatelliteId(id : Long) : List<EarthCellViewsEntity>

    fun findByCellNum(num : Long) : List<EarthCellViewsEntity>

}