01.
02.
03.
04.
05.
<Route(
"GetGoogleMapLocations"
)>
06.
<HttpGet>
07.
Public
Async
Function
GetGoogleMapLocations()
As
Task(Of IActionResult)
08.
Dim
lstLocation
As
New
List(Of GoogleMapLocations)
09.
Dim
sb
As
New
System.Text.StringBuilder()
10.
11.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddMinutes(-5).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
12.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddMinutes(-15).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
13.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddMinutes(-30).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
14.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddMinutes(-45).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
15.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddHours(-1).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
16.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddHours(-3).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
17.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddHours(-6).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
18.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddHours(-12).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
19.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddHours(-18).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"';"
)
20.
sb.Append(
"select sum(rain_mm) as rain_mm from tran_node_data where time >= '"
& DateTime.Now.AddHours(-24).ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"' and time <= '"
& DateTime.Now.ToString(
"yyyy-MM-ddTHH:mm:ssZ"
, CultureInfo.CreateSpecificCulture(
"en-US"
)) &
"'"
)
21.
22.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC10"
, .PKName =
"บ้านท่าตะคร้อ"
, .Lat = 13.116442, .Lng = 99.73253, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
23.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC11"
, .PKName =
"บ้านห้วยกวางจริง"
, .Lat = 13.005129, .Lng = 99.74265, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
24.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC12"
, .PKName =
"เขื่อนเพชร (เหนือน้ำ)"
, .Lat = 12.91296, .Lng = 99.85525, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
25.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC13"
, .PKName =
"เขื่อนเพชร (ท้ายน้ำ)"
, .Lat = 12.914403, .Lng = 99.85451, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
26.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC14"
, .PKName =
"ท่ายาง"
, .Lat = 12.973196, .Lng = 99.88275, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
27.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC15"
, .PKName =
"บ้านลาด"
, .Lat = 13.048535, .Lng = 99.91988, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
28.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC16"
, .PKName =
"เมืองเพชร"
, .Lat = 13.121885, .Lng = 99.95282, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
29.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC17"
, .PKName =
"บ้านแหลม"
, .Lat = 13.2124, .Lng = 99.98281, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
30.
lstLocation.Add(
New
GoogleMapLocations()
With
{.PK =
"TTC17"
, .PKName =
"บ้านชอบเลียหอย"
, .Lat = 69.2124, .Lng = 96.98281, .Title =
""
, .Description =
""
, .MarkerColor =
"red"
})
31.
Await Task.Delay(0)
32.
Return
Ok(lstLocation.ToList())
33.
End
Function