Selaa lähdekoodia

feat:关联用户绑定渠道信息优化

chenjianhua 1 kuukausi sitten
vanhempi
commit
c65d013c75
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9 2
      service-base/src/main/resources/mapper/daq/ChannelMapper.xml

+ 9 - 2
service-base/src/main/resources/mapper/daq/ChannelMapper.xml

@@ -39,9 +39,12 @@
                info.channel_name,
                info.channel_remark
         from channel_info info
+        <if test="userId !=null and userId !=''">
+            join user_channel_mapping ucm on ucm.channel_id = info.id and ucm.isvalid=1
+        </if>
         where info.isvalid=1
         <if test="userId !=null and userId !=''">
-            and e.user_id=#{userId}
+            and ucm.user_id=#{userId}
         </if>
         limit #{offset},#{pageSize}
     </select>
@@ -49,7 +52,11 @@
         select count(distinct info.id) from channel_info info
         where info.isvalid=1
         <if test="userId !=null and userId !=''">
-            and e.user_id=#{userId}
+            join user_channel_mapping ucm on ucm.channel_id = info.id and ucm.isvalid=1
+        </if>
+        where info.isvalid=1
+        <if test="userId !=null and userId !=''">
+            and ucm.user_id=#{userId}
         </if>
     </select>
     <select id="selectChannelIdByEmail" resultType="java.lang.Integer">