leutu
2024-05-08 543e4eb01ca210b20876e8139cb3d0403d7d065c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.skyline.electricity.mapper;
 
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skyline.electricity.pojo.Information;
import com.skyline.electricity.pojo.Monitor;
import com.skyline.electricity.pojo.MonitorInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
 
 
@Mapper
public interface   InformationMapper extends BaseMapper<Information> {
    @Select("SELECT * from information where userid=#{userid} " )
    Information getInformationByUserid(String userid);
 
 
    @Select("SELECT * from information where (to_timestamp(starttime::BIGINT)+ (hb||' sec')::interval) > (now()::timestamp) " )
    List<Information> listInformations();
 
      @Select("select gid,monitor_name, monitor_type, belong_device, aisle_no, aisle_type, video_ip, monitor_id, belong_area, monitor_index," +
              "x, y, z, hk_rtsp,ST_AsText(geom) as geom from monitor where gid in " +
              "(select gid from (select *,ST_Distance((geom)," +
            "ST_GeomFromText('Point(${lat} ${lon})')) as dis from monitor" +
 
            " order by dis limit 1 ) as foo)")
    MonitorInfo queryMinDistance(String lon, String lat);
}