package com.bfr.telinksemifourm.manage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bfr.telinksemifourm.manage.util.MyPage;
import com.bfr.telinksemifourm.shared.model.Tag;
import com.bfr.telinksemifourm.shared.model.Topic;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Created by .
* Copyright (c) 2020, All Rights Reserved.
*
*/
public interface TagMapper extends BaseMapper<Tag> {
MyPage<Map<String, Object>> selectTopicByTagId(MyPage<Map<String, Object>> iPage, @Param("tagId") Integer tagId);
int countToday();
@Select("SELECT t.* FROM tag t WHERE subtag != 0 and subtag=#{topicId}")
List<Tag> selectByTopicIdCh(Integer topicId);
@Select("select id from tag where id in (select DISTINCT subtag from tag where subtag != 0 ) ")
List<Tag> selectTagSub();
List<Tag> tagAjaxCompletion2();
List<Tag> tagAjaxCompletion(String tag);
@Update("UPDATE tag SET index_time = #{indexTime} WHERE id = #{id}")
int updateIndexTime(Integer id, Date indexTime);
@Select("SELECT * FROM tag WHERE index_time IS NULL")
List<Tag> selectAllIndexTimeIsNull();
@Select("SELECT * FROM tag WHERE index_time IS NOT NULL")
List<Tag> selectAllIndexTimeIsNotNull();
// 更新所有索引时间
int updateAllIndexTime(@Param("indexTime") Date indexTime);
}