Ver código fonte

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

zhaoxian 4 anos atrás
pai
commit
fb88f59cbd

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

@@ -16,7 +16,9 @@
         FROM ctop_kuaishou_channel t1
         LEFT JOIN sys_user t2 ON t1.user_id = t2.id
         where account_id is not null
+        <if test="userId != null">
         and t1.user_id = #{userId}
+        </if>
         <if test="projectId != null">
             and project_id = #{projectId}
         </if>
@@ -40,7 +42,9 @@
         FROM ctop_kuaishou_channel t1
         LEFT JOIN sys_user t2 ON t1.user_id = t2.id
         where account_id is null
-        and t1.user_id = #{userId}
+        <if test="userId != null">
+            and t1.user_id = #{userId}
+        </if>
         <if test="projectId != null">
             and project_id = #{projectId}
         </if>

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelItemsServiceImpl.java

@@ -109,7 +109,7 @@ public class KuaishouChannelItemsServiceImpl extends ServiceImpl<KuaishouChannel
             }
             QueryWrapper<KuaishouChannelItemsRel> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("channel_id", object.getLong("channelId"));
-            queryWrapper.eq("item_id", object.getLong("id"));
+            queryWrapper.eq("item_id", object.getLong("id")).last("limit 1");
             KuaishouChannelItemsRel one = channelItemsRelService.getOne(queryWrapper);
             if (Check.isNull(one)) {
                 KuaishouChannelItemsRel rel = new KuaishouChannelItemsRel();