package cn.wise.sc.energy.power.plant.business.repository;

import cn.wise.sc.energy.power.plant.business.domain.CharacterParamInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description: 测点特征仓储
 * @author: qh
 * @create: 2020-07-14 16:24
 **/
@Repository
public interface CharacterParamRepository extends
        JpaRepository<CharacterParamInfo, String>,
        JpaSpecificationExecutor<CharacterParamInfo> {
    /**
     * 查询报警点数统计
     *
     * @return map
     */
    @Query(value = "SELECT COUNT(deviceId),deviceId FROM CharacterParamInfo GROUP BY deviceId")
    List<Object[]> countAlert();

    List<CharacterParamInfo> findAllByPlantId(String plantId);


}
