Merge branch 'master' into kai_整合電站取得方式
This commit is contained in:
commit
b6df06db6c
@ -88,6 +88,7 @@ namespace SolarPower.Repository.Implement
|
||||
LEFT JOIN city c ON ps.CityId = c.Id
|
||||
WHERE ps.Id IN @PowerStationIds
|
||||
GROUP BY ps.CityId
|
||||
ORDER BY c.Priority
|
||||
";
|
||||
|
||||
result = (await conn.QueryAsync<CapacityDataTable>(sql, new { PowerStationIds = powerStationIds })).ToList();
|
||||
|
||||
@ -4508,8 +4508,8 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = $@"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,city.Name AS CityName FROM {tableName} ps
|
||||
LEFT JOIN city ON city.Id = ps.CityId";
|
||||
var sql = $@"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,c.Name AS CityName FROM {tableName} ps
|
||||
LEFT JOIN city c ON c.Id = ps.CityId";
|
||||
|
||||
if (myUser.Role.Layer == 2)
|
||||
{
|
||||
@ -4525,6 +4525,8 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
||||
}
|
||||
|
||||
sql += " ORDER BY c.Priority";
|
||||
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { CompanyId = myUser.CompanyId, UserId = myUser.Id, Filter = filter })).ToList();
|
||||
}
|
||||
catch (Exception exception)
|
||||
@ -4542,14 +4544,16 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = @$"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,city.Name AS CityName FROM {tableName} ps
|
||||
LEFT JOIN city ON city.Id = ps.CityId WHERE ps.Deleted = 0";
|
||||
var sql = @$"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,c.Name AS CityName FROM {tableName} ps
|
||||
LEFT JOIN city c ON c.Id = ps.CityId WHERE ps.Deleted = 0 ";
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(filter))
|
||||
{
|
||||
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
||||
}
|
||||
|
||||
sql += " ORDER BY c.Priority";
|
||||
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { Filter = filter })).ToList();
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user