huliguo
2025-05-30 925219ebfda2a480df99ca06a13033c78ae8d81f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?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="com.ruoyi.system.mapper.AppUserMapper">
 
 
    <select id="getAppUserPage" resultType="com.ruoyi.system.pojo.vo.AppUserPageVO">
        select
            tbu.id,
            tbu.user_name,
            tbu.phone,
            tbu.create_time,
            tbu.balance,
            tbu.status,
            ifnull(bingding.num , 0) as bingDingUser,
            ifnull(buy.num , 0)  as buyNum,
            ifnull(sell.num , 0) as sellNum
        from tb_user tbu
        LEFT JOIN tb_user u2 ON u1.id = u2.invite_id
        left join (select user_id, count(1) as num from tb_order  where  status = 6  group by user_id) buy on tbu.id=buy.user_id
    </select>
</mapper>