package com.genersoft.iot.vmp.storager.dao; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import org.apache.ibatis.annotations.*; import org.springframework.stereotype.Repository; import java.util.List; @Mapper @Repository public interface MediaServerMapper { @Insert("INSERT INTO media_server (" + "id, " + "ip, " + "hookIp, " + "sdpIp, " + "streamIp, " + "httpPort, " + "httpSSlPort, " + "rtmpPort, " + "rtmpSSlPort, " + "rtpProxyPort, " + "rtspPort, " + "rtspSSLPort, " + "autoConfig, " + "secret, " + "streamNoneReaderDelayMS, " + "rtpEnable, " + "rtpPortRange, " + "sendRtpPortRange, " + "recordAssistPort, " + "defaultServer, " + "createTime, " + "updateTime, " + "hookAliveInterval" + ") VALUES " + "(" + "'${id}', " + "'${ip}', " + "'${hookIp}', " + "'${sdpIp}', " + "'${streamIp}', " + "${httpPort}, " + "${httpSSlPort}, " + "${rtmpPort}, " + "${rtmpSSlPort}, " + "${rtpProxyPort}, " + "${rtspPort}, " + "${rtspSSLPort}, " + "${autoConfig}, " + "'${secret}', " + "${streamNoneReaderDelayMS}, " + "${rtpEnable}, " + "'${rtpPortRange}', " + "'${sendRtpPortRange}', " + "${recordAssistPort}, " + "${defaultServer}, " + "'${createTime}', " + "'${updateTime}', " + "${hookAliveInterval})") int add(MediaServerItem mediaServerItem); @Update(value = {" "}) int update(MediaServerItem mediaServerItem); @Update(value = {" "}) int updateByHostAndPort(MediaServerItem mediaServerItem); @Select("SELECT * FROM media_server WHERE id='${id}'") MediaServerItem queryOne(String id); @Select("SELECT * FROM media_server") List queryAll(); @Delete("DELETE FROM media_server WHERE id='${id}'") void delOne(String id); @Select("DELETE FROM media_server WHERE ip='${host}' and httpPort=${port}") void delOneByIPAndPort(String host, int port); @Delete("DELETE FROM media_server WHERE defaultServer=1") int delDefault(); @Select("SELECT * FROM media_server WHERE ip='${host}' and httpPort=${port}") MediaServerItem queryOneByHostAndPort(String host, int port); @Select("SELECT * FROM media_server WHERE defaultServer=1") MediaServerItem queryDefault(); }