浏览代码

渠道号。。。获取已使用渠道号列表

zhaoxian 4 年之前
父节点
当前提交
9cbbddac41

+ 11 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelMapper.xml

@@ -107,12 +107,18 @@
 
     <select id="channelNumberUsageDetailsList" resultType="com.alibaba.fastjson.JSONObject">
         SELECT IFNULL((SELECT MAX(tt.create_time)
-                FROM ctop_kuaishou_creative tt
-                WHERE tt.unit_id = t1.unit_id),'-') as 'createTime', CASE t1.usage_range WHEN 1 THEN '账户' WHEN 2 THEN '项目' ELSE '' END as 'usageRange', IFNULL(t1.channel_code, '') as 'channelCode', IFNULL(t1.project_name, '') as 'projectName', IFNULL(t2.auth_name, '') as 'authName', IFNULL(t1.account_id, '') as 'accountId', IFNULL(t1.campaign_id, '') as 'campaignId', IFNULL(t1.unit_id, '') as 'unitId'
-        FROM ctop_kuaishou_channel t1
+                       FROM ctop_kuaishou_creative tt
+                       WHERE tt.unit_id = t3.unit_id),'-') as 'createTime',
+               CASE t1.usage_range WHEN 1 THEN '账户' WHEN 2 THEN '项目' ELSE '' END as 'usageRange',
+               IFNULL(t3.channel_code, '') as 'channelCode', IFNULL(t1.project_name, '') as 'projectName',
+               IFNULL(t2.auth_name, '') as 'authName', IFNULL(t3.account_id, '') as 'accountId',
+               IFNULL(t3.campaign_id, '') as 'campaignId',
+               IFNULL(t3.unit_id, '') as 'unitId'
+        FROM ctop_kuaishou_channel_rel t3
+                 INNER JOIN  ctop_kuaishou_channel t1 ON t1.account_id = t3.account_id AND t1.channel_code = t3.channel_code
                  LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
-        WHERE t1.account_id = #{accountId}
-          AND t1.channel_code = #{channelCode}
+        WHERE t3.account_id = #{accountId}
+          AND t3.channel_code = #{channelCode}
     </select>
 
     <select id="channelNumberBindingItemInfo" resultType="com.alibaba.fastjson.JSONObject">