|
@@ -701,4 +701,62 @@ class RouteMap extends CatchController
|
|
|
return $response;
|
|
|
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 统计条数
|
|
|
+ * @time 2022年09月18日 10:15
|
|
|
+ *
|
|
|
+ */
|
|
|
+ public function queryDeviceRouteCount(Request $request)
|
|
|
+ {
|
|
|
+
|
|
|
+ $params=$request->param();
|
|
|
+ if($params['route_type']!='1'){
|
|
|
+ $response=[
|
|
|
+ 'code'=>10000,
|
|
|
+ 'message'=>'查询成功',
|
|
|
+ 'count'=>0,
|
|
|
+ ];
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
+ $cond=[];
|
|
|
+ // $cond=[
|
|
|
+ // '_string'=>'a.RF_FLAGID = s.RFID_SN AND o.rfid_id = s.id',
|
|
|
+ // ];
|
|
|
+
|
|
|
+ if($params['name']){
|
|
|
+ $mac=Db::table('stations')->whereLike('name',$params['name'])->value('mac');
|
|
|
+ $cond['RF_ID']=['=',$mac];
|
|
|
+ }
|
|
|
+ if($params['rfid_sn']){
|
|
|
+ $cond['RF_FLAGID']=['=',$params['rfid_sn']];
|
|
|
+ }
|
|
|
+
|
|
|
+ if($params['plate_no']){
|
|
|
+ $conn=getOracleConnect();
|
|
|
+ $rfid_sn='';
|
|
|
+ $vehicle_sql='SELECT s.RFID_SN FROM DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_RFID_TAGS s WHERE o.PLATE_NO =\''.$params['plate_no'].'\' AND o.rfid_id = s.id ';
|
|
|
+ $vtid = oci_parse($conn, $vehicle_sql);
|
|
|
+ oci_define_by_name($vtid, 'RFID_SN', $rfid_sn);
|
|
|
+ oci_execute($vtid);
|
|
|
+ oci_fetch($vtid);
|
|
|
+ $cond['RF_FLAGID']=['=',$rfid_sn];
|
|
|
+ }
|
|
|
+ $start_time = date('Y-m-d 00:00:00',time());
|
|
|
+ $end_time = date('Y-m-d 23:59:59',time());
|
|
|
+ if(isset($params['timeRange']) && $params['timeRange'] != ''){
|
|
|
+ $start_time=date('Y-m-d H:i:s',strtotime($params['timeRange'][0]));
|
|
|
+ $end_time=date('Y-m-d H:i:s',strtotime($params['timeRange'][1]));
|
|
|
+ $cond['a.RF_DATE']=['timeRange',$start_time,$end_time];
|
|
|
+ }
|
|
|
+ $count=queryOracleCount('DSSC2.W_DW_RF_RECORD a',$cond);
|
|
|
+
|
|
|
+ $response=[
|
|
|
+ 'code'=>10000,
|
|
|
+ 'message'=>'查询成功',
|
|
|
+ 'count'=>$count,
|
|
|
+
|
|
|
+ ];
|
|
|
+ return $response;
|
|
|
+
|
|
|
+ }
|
|
|
}
|