panlinlin
2021-01-07 9bf87971e7dc6e0bccc0cf9a2301e9c89f9a0ba6
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.genersoft.iot.vmp.storager.dao;
 
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
 
import java.util.List;
 
/**
 * 用于存储上级平台
 */
@Mapper
@Repository
public interface ParentPlatformMapper {
 
    @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp,  " +
            "            devicePort, username, password, expires, keepTimeout, transport, characterSet, PTZEnable, rtcp, " +
            "            status) " +
            "            VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " +
            "            '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${PTZEnable}, ${rtcp}, " +
            "            ${status})")
    int addParentPlatform(ParentPlatform parentPlatform);
 
    @Update("UPDATE parent_platform " +
            "SET enable=#{enable}, " +
            "name=#{name}," +
            "serverGBId=#{serverGBId}," +
            "serverGBDomain=#{serverGBDomain}, " +
            "serverIP=#{serverIP}," +
            "serverPort=#{serverPort}, " +
            "deviceIp=#{deviceIp}, " +
            "devicePort=#{devicePort}, " +
            "username=#{username}, " +
            "password=#{password}, " +
            "expires=#{expires}, " +
            "keepTimeout=#{keepTimeout}, " +
            "transport=#{transport}, " +
            "characterSet=#{characterSet}, " +
            "PTZEnable=#{PTZEnable}, " +
            "rtcp=#{rtcp}, " +
            "status=#{status} " +
            "WHERE deviceGBId=#{deviceGBId}")
    int updateParentPlatform(ParentPlatform parentPlatform);
 
    @Delete("DELETE FROM parent_platform WHERE deviceGBId=#{deviceGBId}")
    int delParentPlatform(ParentPlatform parentPlatform);
 
 
    @Select("SELECT * FROM parent_platform")
    List<ParentPlatform> getParentPlatformList();
 
    @Select("SELECT * FROM parent_platform WHERE enable=#{enable}")
    List<ParentPlatform> getEnableParentPlatformList(boolean enable);
 
    @Select("SELECT * FROM parent_platform WHERE deviceGBId=#{platformGbId}")
    ParentPlatform getParentPlatById(String platformGbId);
 
    @Update("UPDATE parent_platform SET status=false" )
    void outlineForAllParentPlatform();
}