diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index 2eae156..2d1d161 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -1333,20 +1333,20 @@ namespace SolarPower.Repository.Implement } if (User.Role.Layer == 0 || User.Role.Layer == 1) { - var sql = "SELECT * FROM power_station WHERE CityId IN(@Ids)"; - powerstation = (await conn.QueryAsync(sql, new { Ids = ids })).ToList(); + var sql = "SELECT * FROM power_station WHERE CityId IN @IDs"; + powerstation = (await conn.QueryAsync(sql, new { IDs = CityId })).ToList(); trans.Commit(); } else if (User.Role.Layer == 2) { - var sql = "SELECT * FROM power_station WHERE CityId IN(@Ids) AND CompanyId=@CompanyId"; - powerstation = (await conn.QueryAsync(sql, new { Ids = ids ,CompanyId = User.CompanyId })).ToList(); + var sql = "SELECT * FROM power_station WHERE CityId IN @IDs AND CompanyId=@CompanyId"; + powerstation = (await conn.QueryAsync(sql, new { IDs = CityId,CompanyId = User.CompanyId })).ToList(); trans.Commit(); } else { - var sql = "SELECT power_station.* FROM power_station LEFT JOIN power_station_operation_personnel ON power_station.Id = power_station_operation_personnel.PowerStationId WHERE CityId IN(@Ids) AND Userid = @UserId"; - powerstation = (await conn.QueryAsync(sql, new { UserId = User.Id })).ToList(); + var sql = "SELECT power_station.* FROM power_station LEFT JOIN power_station_operation_personnel ON power_station.Id = power_station_operation_personnel.PowerStationId WHERE CityId IN @IDs AND Userid = @UserId"; + powerstation = (await conn.QueryAsync(sql, new { IDs = CityId, UserId = User.Id })).ToList(); trans.Commit(); } } diff --git a/SolarPower/Views/PowerStation/Index.cshtml b/SolarPower/Views/PowerStation/Index.cshtml index a3f8fe4..dcac41c 100644 --- a/SolarPower/Views/PowerStation/Index.cshtml +++ b/SolarPower/Views/PowerStation/Index.cshtml @@ -406,190 +406,128 @@ @section Scripts{