Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
pipeline-network
Commits
5973821a
Commit
5973821a
authored
Jul 27, 2026
by
wujipeng
Browse files
优化
parent
dbb37824
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/example/pipelinenetwork/controller/BasicController.java
View file @
5973821a
...
@@ -33,7 +33,8 @@ public class BasicController {
...
@@ -33,7 +33,8 @@ public class BasicController {
* 各路段检测修复汇总
* 各路段检测修复汇总
*/
*/
@GetMapping
(
"/summary"
)
@GetMapping
(
"/summary"
)
public
Result
<
Map
<
String
,
Integer
>>
roadSummary
(
@RequestParam
(
name
=
"type"
)
String
type
)
{
public
Result
<
Map
<
String
,
Integer
>>
roadSummary
(
@RequestParam
(
name
=
"type"
)
String
type
,
return
Result
.
success
(
basicService
.
roadSummary
(
type
));
@RequestParam
(
name
=
"region"
)
String
region
)
{
return
Result
.
success
(
basicService
.
roadSummary
(
type
,
region
));
}
}
}
}
src/main/java/com/example/pipelinenetwork/service/BasicService.java
View file @
5973821a
...
@@ -15,5 +15,5 @@ import java.util.Map;
...
@@ -15,5 +15,5 @@ import java.util.Map;
public
interface
BasicService
extends
IService
<
BasicEntity
>
{
public
interface
BasicService
extends
IService
<
BasicEntity
>
{
Map
<
String
,
Integer
>
roadDetail
(
RoadDTO
roadDTO
);
Map
<
String
,
Integer
>
roadDetail
(
RoadDTO
roadDTO
);
Map
<
String
,
Integer
>
roadSummary
(
String
type
);
Map
<
String
,
Integer
>
roadSummary
(
String
type
,
String
region
);
}
}
src/main/java/com/example/pipelinenetwork/service/impl/BasicServiceImpl.java
View file @
5973821a
...
@@ -59,10 +59,10 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
...
@@ -59,10 +59,10 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
}
}
@Override
@Override
public
Map
<
String
,
Integer
>
roadSummary
(
String
type
)
{
public
Map
<
String
,
Integer
>
roadSummary
(
String
type
,
String
region
)
{
Map
<
String
,
Integer
>
result
=
new
HashMap
<>();
Map
<
String
,
Integer
>
result
=
new
HashMap
<>();
//获取基础信息
//获取基础信息
List
<
BasicEntity
>
basicList
=
list
();
List
<
BasicEntity
>
basicList
=
list
(
new
LambdaQueryWrapper
<>(
BasicEntity
.
class
).
eq
(
BasicEntity:
:
getRegion
,
region
)
);
Map
<
String
,
String
>
basicMap
=
new
HashMap
<>();
Map
<
String
,
String
>
basicMap
=
new
HashMap
<>();
for
(
BasicEntity
basicEntity
:
basicList
)
{
for
(
BasicEntity
basicEntity
:
basicList
)
{
basicMap
.
put
(
basicEntity
.
getRelId
(),
basicEntity
.
getRoadName
());
basicMap
.
put
(
basicEntity
.
getRelId
(),
basicEntity
.
getRoadName
());
...
...
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