Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
engine-class-work
Project
Project
Details
Activity
Releases
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
liuchengjiu
engine-class-work
Commits
45c08615
Commit
45c08615
authored
Feb 16, 2022
by
Mindfaker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
b8abc2c6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
StudentVo.java
...va/cn/exploring/engine/server/db/domain/vo/StudentVo.java
+18
-0
StudentInfoService.java
...xploring/engine/server/db/service/StudentInfoService.java
+7
-5
No files found.
server-db/src/main/java/cn/exploring/engine/server/db/domain/vo/StudentVo.java
0 → 100644
View file @
45c08615
package
cn
.
exploring
.
engine
.
server
.
db
.
domain
.
vo
;
import
cn.exploring.engine.server.db.domain.StudentInfo
;
/**
* @author Liu_c
*/
public
class
StudentVo
extends
StudentInfo
{
public
String
ClassName
;
public
String
getClassName
()
{
return
ClassName
;
}
public
void
setClassName
(
String
className
)
{
ClassName
=
className
;
}
}
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentInfoService.java
View file @
45c08615
...
@@ -4,9 +4,10 @@ import cn.exploring.engine.server.db.dao.SpecialSqlMapper;
...
@@ -4,9 +4,10 @@ import cn.exploring.engine.server.db.dao.SpecialSqlMapper;
import
cn.exploring.engine.server.db.dao.StudentInfoMapper
;
import
cn.exploring.engine.server.db.dao.StudentInfoMapper
;
import
cn.exploring.engine.server.db.domain.StudentInfo
;
import
cn.exploring.engine.server.db.domain.StudentInfo
;
import
cn.exploring.engine.server.db.domain.StudentInfoExample
;
import
cn.exploring.engine.server.db.domain.StudentInfoExample
;
import
c
om.alibaba.fastjson.JSON
;
import
c
n.exploring.engine.server.db.domain.vo.StudentVo
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -126,10 +127,11 @@ public class StudentInfoService {
...
@@ -126,10 +127,11 @@ public class StudentInfoService {
example
.
setOrderByClause
(
sort
+
" "
+
order
);
example
.
setOrderByClause
(
sort
+
" "
+
order
);
List
<
StudentInfo
>
studentInfoList
=
studentInfoMapper
.
selectByExample
(
example
);
List
<
StudentInfo
>
studentInfoList
=
studentInfoMapper
.
selectByExample
(
example
);
Map
<
Integer
,
String
>
classMap
=
classService
.
getClassNameMap
();
Map
<
Integer
,
String
>
classMap
=
classService
.
getClassNameMap
();
List
<
Map
>
dataList
=
studentInfoList
.
stream
().
map
(
x
->
{
List
<
StudentVo
>
dataList
=
studentInfoList
.
stream
().
map
(
x
->
{
Map
oneData
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
x
),
Map
.
class
);
StudentVo
voData
=
new
StudentVo
();
oneData
.
put
(
"className"
,
classMap
.
get
(
classId
));
BeanUtils
.
copyProperties
(
x
,
voData
);
return
oneData
;
voData
.
setClassName
(
classMap
.
get
(
x
.
getClassId
()));
return
voData
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
Long
total
=
PageInfo
.
of
(
studentInfoList
).
getTotal
();
Long
total
=
PageInfo
.
of
(
studentInfoList
).
getTotal
();
return
new
HashMap
(){{
return
new
HashMap
(){{
...
...
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