package tech.glinfo.enbao.modules.sh.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import tech.glinfo.enbao.modules.sh.entity.ShSpeakerSecondaryKeywordsEntity;

import java.util.List;
import java.util.Map;

/**
 * @author lyt
 * @date 2021/6/29 18:08
 */
@Mapper
public interface SecondaryKeywordsDao extends BaseMapper<ShSpeakerSecondaryKeywordsEntity> {


    @Select("<script> " +
            "SELECT a.id, a.keyword, a.cmd, a.create_time createTime, b.keyword parentKeyword FROM oshare_speaker_secondary_keywords a, oshare_speaker_first_keywords b WHERE a.parent_id = b.id " +
            "ORDER BY a.id DESC"
            +"</script>")
    List<Map<String, Object>> list(Page<Map<String, Object>> page, Map<String, Object> params);
}
