<?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.kuaishou.modules.ai.mapper.AiKuaishouAccountAutoTargetMapper">

    <select id="queryPageList" resultType="cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoTarget">
        SELECT
        *
        FROM ctop_ai_kuaishou_account_auto_target
        where account_id = #{accountId}
        <if test="targetName != null">
            and target_name LIKE CONCAT(CONCAT('%', #{targetName}), '%')
        </if>
        AND (platform_os =0 or platform_os = #{platformOs})
        order by create_time desc
    </select>

    <select id="getAutoTargetByIds" resultType="cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoTarget">
        SELECT *
        FROM ctop_ai_kuaishou_account_auto_target
        WHERE id in
        <foreach collection="ids" item="ids" separator="," open="(" close=")">
            #{ids}
        </foreach>
    </select>

</mapper>