<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class AutoRFStationController extends Controller
{
    public function stationListARF(Request $request)
    {
        $data = DB::select("select station_id,station_name,latitude,longitude,upzl_name,district_name
        from sw_station_auto_manual where data_read_type in ('AUTO','BOTH') and (',' || STATION_TYPE || ',' LIKE '%,' || '2' ||',%' OR ',' || STATION_TYPE || ',' LIKE '%,' || '10' ||',%')");

        return response()->json([
            'status' => 'success',
            'surface_water_list' => $data,
        ], 200);
    }
}
