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

    <select id="getAppInfoList" resultType="com.alibaba.fastjson.JSONObject">
        SELECT
        t1.*, t2.app_name,t2.app_version,t2.platform
        FROM
        (
        SELECT
        *
        FROM
        ctop_ai_kuaishou_app_multiple_bids
        WHERE
        account_id = #{accountId}
        <if test="appIds != null and appIds != '' ">
            and app_id in
            <foreach collection="appIds" item="item" separator=","
                     open="(" close=")">
                #{item}
            </foreach>
        </if>
        ) t1
        LEFT JOIN (
        SELECT
        app_id,
        app_name,
        app_version,
        platform
        FROM
        ctop_kuaishou_app_list
        WHERE
        account_id =#{accountId}
        ) t2 ON t1.app_id = t2.app_id
    </select>
</mapper>