Commit 261dac6d authored by cq990612's avatar cq990612

修改usersxml

parent f749e289
...@@ -171,7 +171,6 @@ ...@@ -171,7 +171,6 @@
</select> </select>
<select id="getDownLevel" resultType="java.lang.Double"> <select id="getDownLevel" resultType="java.lang.Double">
select select
((LENGTH(a.sub_path) - LENGTH(REPLACE(a.sub_path,",", ""))) / LENGTH(",")-2) as down_level from ((LENGTH(a.sub_path) - LENGTH(REPLACE(a.sub_path,",", ""))) / LENGTH(",")-2) as down_level from
...@@ -189,16 +188,10 @@ ...@@ -189,16 +188,10 @@
</select> </select>
<!--*****************************************chenqi***************************************--> <!--*****************************************chenqi***************************************-->
<select id="getDownLevelAndTotalPeopleByUserId" resultType="cn.wisenergy.model.dto.UsersInfoDto"> <select id="getDownLevelAndTotalPeopleByUserId" resultType="cn.wisenergy.model.dto.UsersInfoDto">
SELECT SELECT
MAX(rank)-rank 'bottom', MAX(rank) 'bottom',
count(*)-1 'totalPeople' count(*)-1 'totalPeople'
FROM FROM
users users
......
...@@ -50,7 +50,13 @@ public class TestUserServiceImpl implements TestUserService { ...@@ -50,7 +50,13 @@ public class TestUserServiceImpl implements TestUserService {
public List<UserSimpleInfoDto> getDownUserInfoById(Long userId) { public List<UserSimpleInfoDto> getDownUserInfoById(Long userId) {
log.info("TestUserServiceImpl[]getDownUserInfoById[]input.param.userId:" + userId); log.info("TestUserServiceImpl[]getDownUserInfoById[]input.param.userId:" + userId);
// 1.判断用户是否存在 // 1.判断用户是否存在
userIsEmpty(userId); if (null==userId) {
userId = 1L;
}
Users user = usersMapper.selectById(userId);
if (null == user) {
throw new BaseCustomException(RespCodeEnum.EMPLOYEE_IS_NOT_EXIST_ERROR);
}
// 2.获取用户伞下所有用户的信息 // 2.获取用户伞下所有用户的信息
List<UserSimpleInfoDto> downUsersById = usersMapper.getDownUsersById(userId); List<UserSimpleInfoDto> downUsersById = usersMapper.getDownUsersById(userId);
return downUsersById; return downUsersById;
...@@ -71,6 +77,7 @@ public class TestUserServiceImpl implements TestUserService { ...@@ -71,6 +77,7 @@ public class TestUserServiceImpl implements TestUserService {
Actives userInfo = activesMapper.getByUserId(userId); Actives userInfo = activesMapper.getByUserId(userId);
// 3.查询最深层级数和伞下人员总和 // 3.查询最深层级数和伞下人员总和
UsersInfoDto userInfoDto = usersMapper.getDownLevelAndTotalPeopleByUserId(userId); UsersInfoDto userInfoDto = usersMapper.getDownLevelAndTotalPeopleByUserId(userId);
userInfoDto.setBottom(userInfoDto.getBottom() - user.getRank());
// 4.查询用户充值和提现总额 // 4.查询用户充值和提现总额
Double totalRecharge = userRechargeMapper.getTotalRecharge(userId); Double totalRecharge = userRechargeMapper.getTotalRecharge(userId);
Double totalWithdrawal = userWithdrawsMapper.getTotalWithdrawal(userId); Double totalWithdrawal = userWithdrawsMapper.getTotalWithdrawal(userId);
......
...@@ -44,4 +44,6 @@ public class TestUserController2 extends BaseController { ...@@ -44,4 +44,6 @@ public class TestUserController2 extends BaseController {
return R.ok(user); return R.ok(user);
} }
} }
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