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
9c56ffa8
Commit
9c56ffa8
authored
Jul 24, 2026
by
wujipeng
Browse files
道路详情优化
parent
58730fff
Changes
9
Show whitespace changes
Inline
Side-by-side
src/main/java/com/example/pipelinenetwork/mapper/DefectMapper.java
View file @
9c56ffa8
...
...
@@ -3,6 +3,9 @@ package com.example.pipelinenetwork.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.example.pipelinenetwork.pojo.entity.DefectEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Author: wujipeng
...
...
@@ -12,4 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
DefectMapper
extends
BaseMapper
<
DefectEntity
>
{
List
<
DefectEntity
>
roadDetail
(
@Param
(
"relIds"
)
List
<
String
>
relIds
,
@Param
(
"defectType"
)
String
defectType
,
@Param
(
"lev"
)
String
lev
);
}
src/main/java/com/example/pipelinenetwork/mapper/RepairMapper.java
View file @
9c56ffa8
...
...
@@ -3,6 +3,9 @@ package com.example.pipelinenetwork.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.example.pipelinenetwork.pojo.entity.RepairEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Author: wujipeng
...
...
@@ -12,4 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
RepairMapper
extends
BaseMapper
<
RepairEntity
>
{
List
<
RepairEntity
>
roadDetail
(
@Param
(
"relIds"
)
List
<
String
>
relIds
,
@Param
(
"defectType"
)
String
defectType
,
@Param
(
"lev"
)
String
lev
);
}
src/main/java/com/example/pipelinenetwork/service/DefectService.java
View file @
9c56ffa8
...
...
@@ -2,9 +2,11 @@ package com.example.pipelinenetwork.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.example.pipelinenetwork.pojo.entity.DefectEntity
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.util.List
;
/**
* @Author: wujipeng
...
...
@@ -15,4 +17,6 @@ import java.io.IOException;
public
interface
DefectService
extends
IService
<
DefectEntity
>
{
Boolean
importDefectData
(
MultipartFile
file
)
throws
IOException
;
List
<
DefectEntity
>
roadDetail
(
@Param
(
"relIds"
)
List
<
String
>
relIds
,
@Param
(
"defectType"
)
String
defectType
,
@Param
(
"lev"
)
String
lev
);
}
src/main/java/com/example/pipelinenetwork/service/RepairService.java
View file @
9c56ffa8
...
...
@@ -5,6 +5,7 @@ import com.example.pipelinenetwork.pojo.entity.RepairEntity;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.util.List
;
/**
* @Author: wujipeng
...
...
@@ -16,4 +17,6 @@ public interface RepairService extends IService<RepairEntity> {
Boolean
importDefectData
(
MultipartFile
file
)
throws
IOException
;
List
<
RepairEntity
>
roadDetail
(
List
<
String
>
relIds
,
String
defectType
,
String
lev
);
}
src/main/java/com/example/pipelinenetwork/service/impl/BasicServiceImpl.java
View file @
9c56ffa8
...
...
@@ -37,10 +37,7 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
//获取relId
List
<
String
>
relIds
=
baseMapper
.
getRelIdsByRegion
(
roadDTO
.
getRegion
());
if
(
"检测"
.
equals
(
roadDTO
.
getType
()))
{
List
<
DefectEntity
>
defectList
=
defectService
.
list
(
new
LambdaQueryWrapper
<
DefectEntity
>()
.
in
(
DefectEntity:
:
getRelId
,
relIds
).
eq
(
DefectEntity:
:
getType
,
roadDTO
.
getDefectType
())
.
eq
(
DefectEntity:
:
getLevel
,
roadDTO
.
getLev
())
);
List
<
DefectEntity
>
defectList
=
defectService
.
roadDetail
(
relIds
,
roadDTO
.
getDefectType
(),
roadDTO
.
getLev
());
for
(
DefectEntity
defectEntity
:
defectList
)
{
if
(
result
.
containsKey
(
defectEntity
.
getName
()))
{
result
.
put
(
defectEntity
.
getName
(),
result
.
get
(
defectEntity
.
getName
())
+
defectEntity
.
getNum
());
...
...
@@ -49,10 +46,7 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
}
}
}
else
if
(
"修复"
.
equals
(
roadDTO
.
getType
()))
{
List
<
RepairEntity
>
repairList
=
repairService
.
list
(
new
LambdaQueryWrapper
<
RepairEntity
>()
.
in
(
RepairEntity:
:
getRelId
,
relIds
).
eq
(
RepairEntity:
:
getType
,
roadDTO
.
getDefectType
())
.
eq
(
RepairEntity:
:
getLevel
,
roadDTO
.
getLev
())
);
List
<
RepairEntity
>
repairList
=
repairService
.
roadDetail
(
relIds
,
roadDTO
.
getDefectType
(),
roadDTO
.
getLev
());
for
(
RepairEntity
repairEntity
:
repairList
)
{
if
(
result
.
containsKey
(
repairEntity
.
getName
()))
{
result
.
put
(
repairEntity
.
getName
(),
result
.
get
(
repairEntity
.
getName
())
+
repairEntity
.
getNum
());
...
...
src/main/java/com/example/pipelinenetwork/service/impl/DefectServiceImpl.java
View file @
9c56ffa8
...
...
@@ -42,6 +42,11 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
}
}
@Override
public
List
<
DefectEntity
>
roadDetail
(
List
<
String
>
relIds
,
String
defectType
,
String
lev
)
{
return
baseMapper
.
roadDetail
(
relIds
,
defectType
,
lev
);
}
/**
* 安全获取字符串单元格值
*/
...
...
src/main/java/com/example/pipelinenetwork/service/impl/RepairServiceImpl.java
View file @
9c56ffa8
...
...
@@ -43,6 +43,11 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, RepairEntity> i
}
}
@Override
public
List
<
RepairEntity
>
roadDetail
(
List
<
String
>
relIds
,
String
defectType
,
String
lev
)
{
return
baseMapper
.
roadDetail
(
relIds
,
defectType
,
lev
);
}
/**
* 安全获取字符串单元格值
*/
...
...
src/main/resources/com/example/pipelinenetwork/mapper/DefectMapper.xml
0 → 100644
View file @
9c56ffa8
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.example.pipelinenetwork.mapper.DefectMapper"
>
<select
id=
"roadDetail"
resultType=
"com.example.pipelinenetwork.pojo.entity.DefectEntity"
>
select
id,
type,
name,
level,
num,
rel_id
from
defect
where
rel_id
in
<foreach
item=
"item"
index=
"index"
collection=
"relIds"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
<if
test=
"defectType != null and defectType != ''"
>
and type = #{defectType}
</if>
<if
test=
"lev != null and lev != ''"
>
and level = #{lev}
</if>
</select>
</mapper>
src/main/resources/com/example/pipelinenetwork/mapper/RepairMapper.xml
0 → 100644
View file @
9c56ffa8
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.example.pipelinenetwork.mapper.RepairMapper"
>
<select
id=
"roadDetail"
resultType=
"com.example.pipelinenetwork.pojo.entity.RepairEntity"
>
select
id,
type,
name,
level,
num,
rel_id
from
repair
where
rel_id
in
<foreach
item=
"item"
index=
"index"
collection=
"relIds"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
<if
test=
"defectType != null and defectType != ''"
>
and type = #{defectType}
</if>
<if
test=
"lev != null and lev != ''"
>
and level = #{lev}
</if>
</select>
</mapper>
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