zxl
2026-03-20 ee8b4f41b25d510eda0b1c7ec553b73f6d7dd7e6
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
32
33
34
package com.tievd.jyz.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tievd.jyz.dto.DeviceStatusStatDTO;
import com.tievd.jyz.entity.Camera;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.Date;
 
/**
 * Camera
 * @author      cube
 * @since       2023-02-27
 * @version     V2.0.0
 */
public interface CameraMapper extends BaseMapper<Camera> {
 
    /**
     * 获取设备上终端的最大的修改/创建时间
     * @param deviceId
     * @return
     */
    Date findMaxChangeTime(@Param("deviceId") Long deviceId);
 
    /** 设备在线状态统计 */
    @Select("select count(if(tc.status =1,1,null)) onlineCount, count(if(tc.status =2,1,null)) offlineCount from t_camera tc where tc.org_code like concat(#{orgCode},'%')")
    DeviceStatusStatDTO cameraStatusStat(String orgCode);
 
    /** 根据网关id删除 */
    @Delete("delete from t_camera where device_id = #{id} ")
    void deleteByDeviceId(String id);
}