This commit is contained in:
JiaHao Liu 2022-01-24 19:15:17 +08:00
commit 0325c7197e
2 changed files with 77 additions and 72 deletions

View File

@ -151,6 +151,7 @@ namespace SolarPower.Controllers
analysisDevice.MultipleYaxes = new Dictionary<string, string>() analysisDevice.MultipleYaxes = new Dictionary<string, string>()
{ {
{ "KWH", "發電量"}, { "KWH", "發電量"},
{ "IrrDay", "累計日照度"},
{ "Irradiance", "日照度"}, { "Irradiance", "日照度"},
{ "KWHKWP", "發電小時"}, { "KWHKWP", "發電小時"},
{ "PR", "PR %"}, { "PR", "PR %"},
@ -551,6 +552,10 @@ namespace SolarPower.Controllers
var YaxesKey = ""; var YaxesKey = "";
switch (device.Type) switch (device.Type)
{ {
case "TPY": //日照計
suffix = analysisDevice.MultipleYaxes["IrrDay"];
YaxesKey = "IrrDay";
break;
case "PYR": //日照計 case "PYR": //日照計
suffix = analysisDevice.MultipleYaxes["Irradiance"]; suffix = analysisDevice.MultipleYaxes["Irradiance"];
YaxesKey = "Irradiance"; YaxesKey = "Irradiance";

View File

@ -543,79 +543,79 @@ namespace SolarPower.Repository.Implement
-- power_station -- power_station
CREATE TABLE IF NOT EXISTS `power_station` ( CREATE TABLE IF NOT EXISTS `power_station` (
`Id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `Id` int(10) unsigned NOT NULL DEFAULT '0',
`Deleted` TINYINT(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:', `Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:',
`CompanyId` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '', `CompanyId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`CityId` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '', `CityId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`AreaId` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '', `AreaId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`Status` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT ' 0: 1:', `Status` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT ' 0: 1:',
`HealthStatus` TINYINT(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1: 2: 3:', `HealthStatus` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '1: 2: 3:',
`Address` VARCHAR(100) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `Address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`Name` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`MainDisplay` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `MainDisplay` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`Code` VARCHAR(50) NULL DEFAULT NULL COMMENT '++' COLLATE 'utf8mb4_unicode_ci', `Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '++',
`SerialNumber` VARCHAR(4) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`IsEscrow` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '0: 1:', `IsEscrow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: 1:',
`EscrowName` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `EscrowName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`ElectricityMeterAt` TIMESTAMP NULL DEFAULT NULL COMMENT '', `ElectricityMeterAt` timestamp NULL DEFAULT NULL COMMENT '',
`EstimatedRecoveryTime` VARCHAR(10) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `EstimatedRecoveryTime` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`GeneratingCapacity` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '()', `GeneratingCapacity` decimal(10,4) NOT NULL DEFAULT '0.0000' COMMENT '()',
`PowerRate` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '', `PowerRate` decimal(10,4) NOT NULL DEFAULT '0.0000' COMMENT '',
`Coordinate` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `Coordinate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterBrand` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `InverterBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterProductModel` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `InverterProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterAmount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '', `InverterAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`PhotovoltaicPanelBrand` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `PhotovoltaicPanelBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelProductModel` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `PhotovoltaicPanelProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelSpecification` VARCHAR(100) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `PhotovoltaicPanelSpecification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelAmount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '', `PhotovoltaicPanelAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`BoEFileName` VARCHAR(255) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `BoEFileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoEFile` VARCHAR(255) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `BoEFile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoEDiscountRate` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '', `BoEDiscountRate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`BoEDeviceRegisterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `BoEDeviceRegisterNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoERentRatio` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '(%)', `BoERentRatio` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '(%)',
`BoERegisterPostAt` TIMESTAMP NULL DEFAULT NULL COMMENT '', `BoERegisterPostAt` timestamp NULL DEFAULT NULL COMMENT '',
`GUINumber` VARCHAR(16) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `GUINumber` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TPCContractNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `TPCContractNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TPCInvoiceBuyer` VARCHAR(100) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `TPCInvoiceBuyer` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TPCInvoiceAddress` VARCHAR(100) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `TPCInvoiceAddress` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TPCContractAt` TIMESTAMP NULL DEFAULT NULL COMMENT '', `TPCContractAt` timestamp NULL DEFAULT NULL COMMENT '',
`TPCSellDeadline` INT(10) UNSIGNED NULL DEFAULT '0' COMMENT '()', `TPCSellDeadline` int(10) unsigned DEFAULT '0' COMMENT '()',
`TPCMeterReading` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '', `TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`TPCPurchaseElectricityAt` TIMESTAMP NULL DEFAULT NULL COMMENT '', `TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '',
`TPCSellElectricityAt` TIMESTAMP NULL DEFAULT NULL COMMENT '', `TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '',
`TPCMeterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `TPCMeterNumber` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`SolarType` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '', `SolarType` tinyint(4) NOT NULL DEFAULT '0' COMMENT '',
`kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000', `kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
`Today_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '', `Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '',
`Total_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '', `Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '',
`today_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT 'kwhkwp', `today_kwhkwp` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT 'kwhkwp',
`avg_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT '30kwhkwp', `avg_kwhkwp` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT '30kwhkwp',
`today_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '', `today_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '',
`total_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '', `total_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '',
`today_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT 'Pr值', `today_PR` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT 'Pr值',
`avg_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT 'Pr值', `avg_PR` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT 'Pr值',
`today_carbon` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '', `today_carbon` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '',
`total_carbon` DECIMAL(10,2) NOT NULL COMMENT '', `total_carbon` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '',
`today_irradiance` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '', `today_irradiance` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '',
`avg_irradiance` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '', `avg_irradiance` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '',
`SolarHour` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '', `SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '',
`SiteDB` VARCHAR(20) NULL DEFAULT NULL COMMENT ' DB name: solar_com' COLLATE 'utf8mb4_unicode_ci', `SiteDB` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT ' DB name: solar_com',
`TodayWeather` VARCHAR(20) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `TodayWeather` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TodayWeatherTemp` DECIMAL(5,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '', `TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '',
`WeathersStationId` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `WeathersStationId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`RateOfRain` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci', `RateOfRain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`line_token` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci', `line_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`Estimate_kwh` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '', `Estimate_kwh` decimal(10,2) DEFAULT '0.00' COMMENT '',
`EstimateEfficacy` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '', `EstimateEfficacy` decimal(10,2) DEFAULT '0.00' COMMENT '',
`CreatedBy` INT(10) UNSIGNED NOT NULL COMMENT '', `CreatedBy` int(10) unsigned NOT NULL COMMENT '',
`CreatedAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '', `CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`UpdatedBy` INT(10) UNSIGNED NULL DEFAULT NULL COMMENT '', `UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '',
`UpdatedAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '', `UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`),
KEY `IDX_01` (`Deleted`) USING BTREE, KEY `IDX_01` (`Deleted`),
KEY `IDX_02` (`CompanyId`) USING BTREE, KEY `IDX_02` (`CompanyId`),
KEY `IDX_03` (`CityId`,`AreaId`) USING BTREE KEY `IDX_03` (`CityId`,`AreaId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT=''; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='';