<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.ctop.crawler.modules.account.mapper.KuaishouAdAccountMapper">

    <resultMap id="KuaishouAdAccount" type="cn.com.ctop.crawler.modules.account.entity.KuaishouAdAccount">
        <result column="ksid" property="ksid" jdbcType="BIGINT"/>
        <result column="kaid" property="kaid" jdbcType="BIGINT"/>
        <result column="name" property="name" jdbcType="VARCHAR"/>
        <result column="industry_category" property="industryCategory" jdbcType="VARCHAR"/>
        <result column="first_industry" property="firstIndustry" jdbcType="VARCHAR"/>
        <result column="second_industry" property="secondIndustry" jdbcType="VARCHAR"/>
        <result column="company" property="company" jdbcType="VARCHAR"/>
        <result column="product" property="product" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
    </resultMap>
    <select id="companySugest" resultType="java.lang.String">
		select distinct company from ctop_kuaishou_advertiser_info where company like concat('%',#{company},'%')
	</select>

    <select id="productSugest" resultType="java.lang.String">
		select distinct product from ctop_kuaishou_advertiser_info where product like concat('%',#{product},'%')
	</select>

    <select id="querySyncAccount" resultMap="KuaishouAdAccount">
	   select * from ctop_kuaishou_advertiser_info where status=1 and ksid not in (select user_id from ctop_kuaishou_app_video) order by create_time desc
	</select>
</mapper>