|  |  |  | 
|---|
|  |  |  | package com.genersoft.iot.vmp.storager.dao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; | 
|---|
|  |  |  | import org.apache.ibatis.annotations.*; | 
|---|
|  |  |  | import org.springframework.stereotype.Repository; | 
|---|
|  |  |  | 
|---|
|  |  |  | public interface StreamPushMapper { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Insert("INSERT INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " + | 
|---|
|  |  |  | "createStamp, aliveSecond) VALUES" + | 
|---|
|  |  |  | "createStamp, aliveSecond, mediaServerId) VALUES" + | 
|---|
|  |  |  | "('${app}', '${stream}', '${totalReaderCount}', '${originType}', '${originTypeStr}', " + | 
|---|
|  |  |  | "'${createStamp}', '${aliveSecond}' )") | 
|---|
|  |  |  | "'${createStamp}', '${aliveSecond}', '${mediaServerId}' )") | 
|---|
|  |  |  | int add(StreamPushItem streamPushItem); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Update("UPDATE stream_push " + | 
|---|
|  |  |  | "SET app=#{app}," + | 
|---|
|  |  |  | "stream=#{stream}," + | 
|---|
|  |  |  | "mediaServerId=#{mediaServerId}," + | 
|---|
|  |  |  | "totalReaderCount=#{totalReaderCount}, " + | 
|---|
|  |  |  | "originType=#{originType}," + | 
|---|
|  |  |  | "originTypeStr=#{originTypeStr}, " + | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Insert("<script>"  + | 
|---|
|  |  |  | "INSERT INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " + | 
|---|
|  |  |  | "createStamp, aliveSecond) " + | 
|---|
|  |  |  | "createStamp, aliveSecond, mediaServerId) " + | 
|---|
|  |  |  | "VALUES <foreach collection='streamPushItems' item='item' index='index' >" + | 
|---|
|  |  |  | "( '${item.app}', '${item.stream}', '${item.totalReaderCount}', '${item.originType}', " + | 
|---|
|  |  |  | "'${item.originTypeStr}','${item.createStamp}', '${item.aliveSecond}' )" + | 
|---|
|  |  |  | "'${item.originTypeStr}','${item.createStamp}', '${item.aliveSecond}', '${item.mediaServerId}' )" + | 
|---|
|  |  |  | " </foreach>" + | 
|---|
|  |  |  | "</script>") | 
|---|
|  |  |  | void addAll(List<StreamPushItem> streamPushItems); | 
|---|