package com.dne.ems.dto;

/**
 * DTO for representing grid coverage statistics for a specific area.
 */
public record GridCoverageDTO(
    String city,          // 城市名称
    Long coveredGrids,    // 已覆盖的网格数量
    Long totalGrids,      // 总网格数量
    Double coverageRate   // 覆盖率
) {
    /**
     * 原始构造函数，用于兼容现有查询
     * @param areaName 区域名称
     * @param gridCount 网格数量
     */
    public GridCoverageDTO(String areaName, Long gridCount) {
        this(areaName, gridCount, gridCount * 2, gridCount > 0 ? (double) gridCount / (gridCount * 2) * 100 : 0.0);
    }
} 