package com.cyksj.mapper.channel;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyksj.model.entity.ChannelPopularize;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author chan
 * @date 2022/12/13 2:29 PM
 */
public interface ChannelPopularizeMapper extends BaseMapper<ChannelPopularize> {
	@Select("select id from channel_popularize where channel_id = #{channelId}")
	List<Long> getPopularizeIdByChannelId(Long channelId);

	@Select("select c.name from (select channel_id from channel_popularize where id = #{popularizeId}) cp inner join channel c on c.id = cp.channel_id")
	String selectChannelByPid(Long popularizeId);
}
