package com.xydl.cac.repository;

import com.xydl.cac.entity.NSensor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface NSensorRepository extends JpaRepository<NSensor, Integer>, JpaSpecificationExecutor<NSensor> {

    List<NSensor> findBySensorCode(String sensorCode);

    List<NSensor> findByZsbId(Integer zsbId);

    List<NSensor> findByIcdIdIsNotNull();

    List<NSensor> findByIcdIdAndIdIsNot(Integer icdid, Integer id);

    List<NSensor> findByTypeId(Integer typeId);

    List<NSensor> findByTypeIdIn(List<Integer> typeIdList);

    List<NSensor> findByDevId(Integer devId);

    Long countByZsbIdIn(List<Integer> list);

    Long countByTypeId(Integer typeId);
}