package com.gyee.wisdom.dao.sql.things.repository;

import com.gyee.wisdom.dao.sql.system.entity.UserEntity;
import com.gyee.wisdom.dao.sql.things.entity.TsPointEntity;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.QueryHints;
import org.springframework.stereotype.Repository;

import javax.persistence.QueryHint;
import java.util.List;


@Repository
@CacheConfig(cacheNames = "TsPoints")
public interface TsPointRepository extends JpaRepository<TsPointEntity, String>, JpaSpecificationExecutor {

    @Cacheable
    List<TsPointEntity> findAllByIdIn(String... ids);

    @Cacheable
    List<TsPointEntity> findAllByThingTypeAndThingIdAndUniformCodeIn(String thingType, String thingId, String... uniformCode);

    @Cacheable
    List<TsPointEntity> findAllByThingTypeAndUniformCodeAndThingIdIn(String thingType, String uniformCode, String... thingIds);

    List<TsPointEntity> findAllByThingTypeAndThingId(String thingType  , String thingId);

}
