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

import cn.wise.sc.energy.power.plant.business.domain.CharacterParamInfo;
import lombok.Data;
import lombok.NoArgsConstructor;
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 javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
import java.util.Map;

/**
 * @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();

}
