Forráskód Böngészése

用户状态统计列表开发

gao.qiang 17 órája
szülő
commit
c83cc6f6e0

+ 4 - 5
business-service/src/main/resources/mapper/service/UserStateStatisticsMapper.xml

@@ -46,16 +46,15 @@
         WHEN 2 THEN '离线'
         END AS isDisableName,
         u.user_id AS userId,
+        u.is_disable AS isDisable,
         ROW_NUMBER() OVER (PARTITION BY u.nike_name ORDER BY u.create_time DESC) as rn
         FROM
         user_state_statistics u
-        <where>
-            <if test="isDisable != null and isDisable != 0">
-                AND u.is_disable = #{isDisable}
-            </if>
-        </where>
         ) t
         WHERE t.rn = 1
+        <if test="isDisable != null and isDisable != 0">
+            AND t.isDisable = #{isDisable}
+        </if>
         ORDER BY t.createTime DESC
     </select>
 </mapper>