package org.jeecg.modules.demo.linkouterouterstatistics.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.linkouterouterstatistics.entity.LinkOuterouterStatistics;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: 外链信息统计
 * @Author: jeecg-boot
 * @Date:   2023-04-13
 * @Version: V1.0
 */
@Mapper
public interface LinkOuterouterStatisticsMapper extends BaseMapper<LinkOuterouterStatistics> {

    @Select("select id,create_by createBy,create_time createTime,update_by updateBy,update_time updateTime,update_time scanTime,main_site_id mainSiteId,main_site_name mainSiteName,main_site_url mainSiteUrl,count(*) linkNumber from link_outer_chain_detection GROUP BY main_site_url")
    List<LinkOuterouterStatistics> listCount();

    @Select("select id,create_by createBy,create_time createTime,update_by updateBy,update_time updateTime,update_time scanTime,main_site_id mainSiteId,main_site_name mainSiteName,main_site_url mainSiteUrl,count(*) linkNumber from link_outer_chain_detection where main_site_url = #{mainUrl}  GROUP BY main_site_url limit 1")
    LinkOuterouterStatistics listCountByMainUrl(@Param("mainUrl") String mainUrl);
}
