package com.reyun.saas.report.realtimecommon.dao;

import com.reyun.saas.common.core.TkMapper;
import com.reyun.saas.report.realtimecommon.domain.ChannelInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 查询实时数据库中的渠道
 */
public interface ChannelInfoMapper extends TkMapper<ChannelInfo> {

    /**
     * 查询实时表中位同步的渠道
     */
    @Select("SELECT cid,appkey FROM channel_info WHERE sync_status is false ")
    public List<ChannelInfo> findChannelInfoByDate();


    /**
     * 修改同步状态
     */
    @Update("UPDATE channel_info SET sync_status = 1 WHERE appkey = #{appkey} AND cid = #{cid}")
    public int updateSyncStatus(@Param("appkey")String appkey,@Param("cid")String cid);
}
