<?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.AiKuaishouAccountAutoStrategyMapper">

    <select id="queryList" resultType="cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoStrategy">
        SELECT
        id,
        account_id,
        status,
        create_time,
        convert_id,
        ocpx_action_type,
        cpa_bid,
        bid,
        bid_type
        FROM ctop_ai_kuaishou_account_auto_strategy
        <where>
            <if test="accountId != null">
                and account_id = #{accountId}
            </if>
            <if test="userIds != null and userIds.size() > 0">
                and user_id in
                <foreach item="id" index="index" collection="userIds"
                         open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
            <if test="status != null">
                and status = #{status}
            </if>
        </where>
        order by create_time desc
    </select>

</mapper>