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
da2e34d3
Commit
da2e34d3
authored
Jun 17, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加实体类,mapper,mapper.xml
parent
261dac6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+3
-2
TestUserServiceImpl.java
...va/cn/wisenergy/service/app/impl/TestUserServiceImpl.java
+6
-0
No files found.
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
da2e34d3
...
...
@@ -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>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/TestUserServiceImpl.java
View file @
da2e34d3
...
...
@@ -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
;
}
...
...
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