Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
licc
data-server
Commits
96afd609
Commit
96afd609
authored
Jun 16, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
4e52601c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+17
-0
UserSimpleInfoDto.java
...c/main/java/cn/wisenergy/model/dto/UserSimpleInfoDto.java
+14
-0
TestUserController2.java
...senergy/web/admin/controller/app/TestUserController2.java
+1
-1
No files found.
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
96afd609
...
...
@@ -213,13 +213,30 @@ WHERE
u.id 'userId',
a.real_name ,
u.rank,
a.id_number,
u.phone,
if(ur.totalRecharge is NULL,0.00, round(ur.totalRecharge,2)) 'totalRecharge',
if(uw.totalWithdrawal is NULL,0.00,round(uw.totalWithdrawal,2)) 'totalWithdrawal',
u.parent_id,
aa.real_name 'parentName'
FROM users u
LEFT JOIN actives a ON u.id = a.user_id
LEFT JOIN actives aa ON u.parent_id = aa.user_id
LEFT JOIN (
SELECT user_id,round(SUM(amount),2) 'totalRecharge'
FROM user_recharge
WHERE user_id in (SELECT id from users WHERE parent_id = #{userId}) and status = 1
GROUP BY user_id
) ur ON ur.user_id=u.id
LEFT JOIN (
SELECT user_id,round(SUM(amount),2) 'totalWithdrawal'
FROM user_withdraws
WHERE user_id in (SELECT id from users WHERE parent_id = #{userId}) and status = 1
GROUP BY user_id
) uw ON uw.user_id=u.id
WHERE
u.parent_id = #{userId}
ORDER BY u.id
</select>
</mapper>
wisenergy-model/src/main/java/cn/wisenergy/model/dto/UserSimpleInfoDto.java
View file @
96afd609
...
...
@@ -22,9 +22,23 @@ public class UserSimpleInfoDto {
@ApiModelProperty
(
name
=
"rank"
,
value
=
"层级"
)
private
Integer
rank
;
@ApiModelProperty
(
name
=
"idNumber"
,
value
=
"身份证号"
)
private
String
idNumber
;
@ApiModelProperty
(
name
=
"phone"
,
value
=
"用户手机号"
)
private
String
phone
;
@ApiModelProperty
(
name
=
"totalRecharge"
,
value
=
"充值总额"
)
private
String
totalRecharge
;
@ApiModelProperty
(
name
=
"totalWithdrawal"
,
value
=
"提现总额"
)
private
String
totalWithdrawal
;
@ApiModelProperty
(
name
=
"parentId"
,
value
=
"直接上级id"
)
private
Integer
parentId
;
@ApiModelProperty
(
name
=
"parentName"
,
value
=
"直接上级姓名"
)
private
String
parentName
;
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/TestUserController2.java
View file @
96afd609
...
...
@@ -26,7 +26,7 @@ public class TestUserController2 extends BaseController {
@Autowired
private
TestUserService
testUserService
;
@ApiOperation
(
value
=
"获取下一级用户
得信息"
,
notes
=
"获取下一级用户得
信息"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取下一级用户
的信息"
,
notes
=
"获取下一级用户的
信息"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
dataType
=
"int"
)
@GetMapping
(
"/users/getDownUsersInfoById"
)
public
R
<
List
<
UserSimpleInfoDto
>>
getDownUserInfoById
(
Long
userId
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment