Commit da2e34d3 authored by cq990612's avatar cq990612

增加实体类,mapper,mapper.xml

parent 261dac6d
......@@ -196,7 +196,8 @@
FROM
users
WHERE
FIND_IN_SET(#{userId},path)
path like CONCAT((SELECT path FROM users WHERE id=#{userId}), '%')
</select>
......@@ -228,7 +229,7 @@ WHERE user_id in (SELECT id from users WHERE parent_id = #{userId}) and status =
GROUP BY user_id
) uw ON uw.user_id=u.id
WHERE
u.parent_id = #{userId}
u.parent_id = #{userId} or u.id = #{userId}
ORDER BY u.id
</select>
......
......@@ -68,6 +68,7 @@ public class TestUserServiceImpl implements TestUserService {
* @param userId 用户id
* @return
*/
@Override
public UsersInfoDto getUserInfoById(Long userId) {
log.info("TestUserServiceImpl[]getUserInfoById[]input.param.userId:" + userId);
......@@ -76,14 +77,17 @@ public class TestUserServiceImpl implements TestUserService {
// 2.获取用户详细信息
Actives userInfo = activesMapper.getByUserId(userId);
// 3.查询最深层级数和伞下人员总和
long startTime=System.currentTimeMillis();
UsersInfoDto userInfoDto = usersMapper.getDownLevelAndTotalPeopleByUserId(userId);
userInfoDto.setBottom(userInfoDto.getBottom() - user.getRank());
long endTime=System.currentTimeMillis();
// 4.查询用户充值和提现总额
Double totalRecharge = userRechargeMapper.getTotalRecharge(userId);
Double totalWithdrawal = userWithdrawsMapper.getTotalWithdrawal(userId);
// 5.计算OTC买入卖出
Double buyTotal = usdtOrderDetailsMapper.getBuyTotal(userId);
Double saleTotal = usdtOrderDetailsMapper.getSaleTotal(userId);
// 5.将查询出来的信息整合到dto类
userInfoDto.setUserId(userId);
BeanUtils.copyProperties(user, userInfoDto);
......@@ -94,6 +98,8 @@ public class TestUserServiceImpl implements TestUserService {
userInfoDto.setTotalWithdrawal(totalWithdrawal == null ? MONEYISEMPTY : totalWithdrawal.toString());
userInfoDto.setBuyTotal(buyTotal == null ? MONEYISEMPTY : buyTotal.toString());
userInfoDto.setSaleTotal(saleTotal == null ? MONEYISEMPTY : saleTotal.toString());
System.out.println("程序运行时间: "+(endTime-startTime)+"ms");
return userInfoDto;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment