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
王蔡翾
operation_platform
Commits
f2f9d720
Commit
f2f9d720
authored
Apr 08, 2025
by
王蔡翾
Browse files
移动端优化
parent
3aad554e
Changes
16
Show whitespace changes
Inline
Side-by-side
src/main/java/com/example/operation_platform/controller/OperationDoController.java
View file @
f2f9d720
...
@@ -53,8 +53,8 @@ public class OperationDoController extends BaseController {
...
@@ -53,8 +53,8 @@ public class OperationDoController extends BaseController {
return
getDataTable
(
operationDoService
.
queryDoRunLog
(
operationDoDTO
));
return
getDataTable
(
operationDoService
.
queryDoRunLog
(
operationDoDTO
));
}
}
@GetMapping
(
"/count"
)
@GetMapping
(
"/count"
)
public
Result
<
AllCountVO
>
count
()
{
public
Result
<
AllCountVO
>
count
(
String
username
)
{
return
Result
.
data
(
operationDoService
.
querycount
());
return
Result
.
data
(
operationDoService
.
querycount
(
username
));
}
}
@GetMapping
(
"/equipment"
)
@GetMapping
(
"/equipment"
)
public
Result
<
List
<
OperationDoVO
>>
equipment
()
{
public
Result
<
List
<
OperationDoVO
>>
equipment
()
{
...
...
src/main/java/com/example/operation_platform/controller/OperationJobController.java
View file @
f2f9d720
package
com.example.operation_platform.controller
;
package
com.example.operation_platform.controller
;
import
com.example.operation_platform.model.dto.MessageDTO
;
import
com.example.operation_platform.model.dto.OperationJobDTO
;
import
com.example.operation_platform.model.dto.OperationJobDTO
;
import
com.example.operation_platform.model.vo.OperationJobVO
;
import
com.example.operation_platform.model.vo.OperationJobVO
;
import
com.example.operation_platform.service.OperationJobService
;
import
com.example.operation_platform.service.OperationJobService
;
...
...
src/main/java/com/example/operation_platform/mapper/OperationDoMapper.java
View file @
f2f9d720
...
@@ -34,7 +34,7 @@ public interface OperationDoMapper extends BaseMapper<OperationDoEntity> {
...
@@ -34,7 +34,7 @@ public interface OperationDoMapper extends BaseMapper<OperationDoEntity> {
List
<
OperationDoVO
>
queryDoRunLog
(
OperationDoDTO
operationDoDTO
);
List
<
OperationDoVO
>
queryDoRunLog
(
OperationDoDTO
operationDoDTO
);
List
<
Integer
>
queryRunLogIdList
();
List
<
Integer
>
queryRunLogIdList
();
AllCountVO
querycount
();
AllCountVO
querycount
(
String
username
);
List
<
RunLogWarnMessageVO
>
queryNeedMessageRunLog
();
List
<
RunLogWarnMessageVO
>
queryNeedMessageRunLog
();
List
<
OperationDoVO
>
queryEquipment
();
//获取设备和id
List
<
OperationDoVO
>
queryEquipment
();
//获取设备和id
}
}
...
...
src/main/java/com/example/operation_platform/model/dto/OperationJobDTO.java
View file @
f2f9d720
...
@@ -16,7 +16,6 @@ public class OperationJobDTO extends OperationJob {
...
@@ -16,7 +16,6 @@ public class OperationJobDTO extends OperationJob {
private
String
workerName
;
private
String
workerName
;
private
Integer
status
;
private
Integer
status
;
private
String
operationType
;
private
String
operationType
;
private
Integer
finishStatus
;
private
String
username
;
private
String
username
;
private
LocalDate
date
;
private
LocalDate
date
;
private
Integer
year
;
private
Integer
year
;
...
...
src/main/java/com/example/operation_platform/model/dto/OperationRecordDTO.java
View file @
f2f9d720
...
@@ -17,4 +17,5 @@ public class OperationRecordDTO extends TbOperationRecordEntity {
...
@@ -17,4 +17,5 @@ public class OperationRecordDTO extends TbOperationRecordEntity {
private
String
username
;
private
String
username
;
private
String
stationName
;
private
String
stationName
;
private
Integer
run_log_id
;
private
Integer
run_log_id
;
private
Integer
operation_job_id
;
}
}
src/main/java/com/example/operation_platform/model/entity/TbOperationRecordEntity.java
View file @
f2f9d720
...
@@ -30,6 +30,8 @@ public class TbOperationRecordEntity {
...
@@ -30,6 +30,8 @@ public class TbOperationRecordEntity {
private
Integer
operationJobId
;
private
Integer
operationJobId
;
@TableField
(
"note"
)
@TableField
(
"note"
)
private
String
note
;
private
String
note
;
@TableField
(
"runlog_or_operation"
)
private
Integer
runLogOrOperation
;
}
}
src/main/java/com/example/operation_platform/model/vo/OperationDoVO.java
View file @
f2f9d720
...
@@ -8,6 +8,7 @@ import java.util.Date;
...
@@ -8,6 +8,7 @@ import java.util.Date;
@Data
@Data
public
class
OperationDoVO
{
public
class
OperationDoVO
{
private
Integer
id
;
private
Integer
id
;
private
String
operationJobId
;
private
String
robotName
;
//设备名称
private
String
robotName
;
//设备名称
private
String
stationName
;
//泵站名称
private
String
stationName
;
//泵站名称
private
String
operationType
;
//维保任务
private
String
operationType
;
//维保任务
...
@@ -24,4 +25,6 @@ public class OperationDoVO {
...
@@ -24,4 +25,6 @@ public class OperationDoVO {
private
String
droneId
;
//无人机id
private
String
droneId
;
//无人机id
private
String
lastTime
;
//最近维保时间
private
String
lastTime
;
//最近维保时间
private
String
runLogId
;
//告警日志id
private
String
runLogId
;
//告警日志id
private
String
createTime
;
//计划创建时间
private
String
nearTime
;
//最近维保时间
}
}
src/main/java/com/example/operation_platform/model/vo/OperationJobVO.java
View file @
f2f9d720
...
@@ -24,7 +24,7 @@ public class OperationJobVO extends OperationJob {
...
@@ -24,7 +24,7 @@ public class OperationJobVO extends OperationJob {
private
String
stationId
;
private
String
stationId
;
private
String
itemId
;
private
String
itemId
;
private
String
operationItems
;
private
String
operationItems
;
//经维度
private
String
lon
;
private
String
lon
;
private
String
lat
;
private
String
lat
;
...
...
src/main/java/com/example/operation_platform/model/vo/OperationRecordVO.java
View file @
f2f9d720
...
@@ -20,6 +20,7 @@ public class OperationRecordVO {
...
@@ -20,6 +20,7 @@ public class OperationRecordVO {
private
String
note
;
private
String
note
;
private
String
warnMessage
;
private
String
warnMessage
;
private
Integer
runLogId
;
private
Integer
runLogId
;
private
Date
nearTime
;
}
}
src/main/java/com/example/operation_platform/service/OperationDoService.java
View file @
f2f9d720
...
@@ -28,7 +28,7 @@ public interface OperationDoService extends IService<OperationDoEntity> {
...
@@ -28,7 +28,7 @@ public interface OperationDoService extends IService<OperationDoEntity> {
List
<
OperationDoVO
>
queryDoRunLog
(
OperationDoDTO
operationDoDTO
);
List
<
OperationDoVO
>
queryDoRunLog
(
OperationDoDTO
operationDoDTO
);
List
<
Integer
>
queryRunLogIdList
();
List
<
Integer
>
queryRunLogIdList
();
//首页统计
//首页统计
AllCountVO
querycount
();
AllCountVO
querycount
(
String
username
);
List
<
RunLogWarnMessageVO
>
queryNeedMessageRunLog
();
List
<
RunLogWarnMessageVO
>
queryNeedMessageRunLog
();
List
<
OperationDoVO
>
queryEquipment
();
//获取设备和id
List
<
OperationDoVO
>
queryEquipment
();
//获取设备和id
...
...
src/main/java/com/example/operation_platform/service/impl/GuideServiceImpl.java
View file @
f2f9d720
...
@@ -2,7 +2,6 @@ package com.example.operation_platform.service.impl;
...
@@ -2,7 +2,6 @@ package com.example.operation_platform.service.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.example.operation_platform.mapper.GuideMapper
;
import
com.example.operation_platform.mapper.GuideMapper
;
import
com.example.operation_platform.model.dto.GuideDTO
;
import
com.example.operation_platform.model.dto.GuideDTO
;
import
com.example.operation_platform.model.entity.GuideEntity
;
import
com.example.operation_platform.model.entity.GuideEntity
;
import
com.example.operation_platform.model.vo.GuideVO
;
import
com.example.operation_platform.model.vo.GuideVO
;
...
@@ -10,7 +9,6 @@ import com.example.operation_platform.service.GuideService;
...
@@ -10,7 +9,6 @@ import com.example.operation_platform.service.GuideService;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
@Service
@Service
public
class
GuideServiceImpl
extends
ServiceImpl
<
GuideMapper
,
GuideEntity
>
implements
GuideService
{
public
class
GuideServiceImpl
extends
ServiceImpl
<
GuideMapper
,
GuideEntity
>
implements
GuideService
{
@Override
@Override
...
@@ -25,4 +23,6 @@ public class GuideServiceImpl extends ServiceImpl<GuideMapper, GuideEntity> impl
...
@@ -25,4 +23,6 @@ public class GuideServiceImpl extends ServiceImpl<GuideMapper, GuideEntity> impl
public
void
updateall
(
GuideDTO
guideDTO
)
{
public
void
updateall
(
GuideDTO
guideDTO
)
{
baseMapper
.
updateall
(
guideDTO
);
baseMapper
.
updateall
(
guideDTO
);
}
}
}
}
src/main/java/com/example/operation_platform/service/impl/OperationDoServiceImpl.java
View file @
f2f9d720
...
@@ -29,38 +29,7 @@ public class OperationDoServiceImpl extends ServiceImpl<OperationDoMapper, Opera
...
@@ -29,38 +29,7 @@ public class OperationDoServiceImpl extends ServiceImpl<OperationDoMapper, Opera
@Override
@Override
public
List
<
OperationDoVO
>
queryDoList
(
OperationDoDTO
operationDoDTO
)
{
public
List
<
OperationDoVO
>
queryDoList
(
OperationDoDTO
operationDoDTO
)
{
return
baseMapper
.
queryDoList
(
operationDoDTO
);
//查看机器人运维项目
List
<
OperationDoVO
>
operationVOList
=
baseMapper
.
queryDoList
(
operationDoDTO
);
//处理items
Set
<
String
>
items
=
new
HashSet
<>();
operationVOList
.
forEach
(
operationDoVO
->
{
if
(
StringUtils
.
isNotEmpty
(
operationDoVO
.
getItemId
()))
{
List
<
String
>
itemIdList
=
Arrays
.
asList
(
operationDoVO
.
getItemId
().
split
(
","
));
itemIdList
.
forEach
(
itemId
->
items
.
add
(
itemId
));
}
});
//通过itemId数组查看item信息
List
<
OperationItem
>
operationItemList
=
operationItemService
.
queryByIdList
(
Lists
.
newArrayList
(
items
));
operationVOList
.
forEach
(
operationDoVO
->
{
if
(
StringUtils
.
isNotEmpty
(
operationDoVO
.
getItemId
()))
{
List
<
String
>
itemIdList
=
Arrays
.
asList
(
operationDoVO
.
getItemId
().
split
(
","
));
itemIdList
.
forEach
(
itemId
->
{
for
(
OperationItem
operationItem
:
operationItemList
)
{
String
itemName
=
null
;
if
(
itemId
.
equals
(
operationItem
.
getId
()))
{
if
(
StringUtils
.
isEmpty
(
itemName
))
{
itemName
=
operationItem
.
getOperationItem
();
}
else
{
itemName
=
itemName
+
","
+
operationItem
.
getOperationItem
();
}
operationDoVO
.
setOperationItems
(
itemName
);
}
}
});
}
});
return
operationVOList
;
}
}
@Override
@Override
...
@@ -76,8 +45,8 @@ public class OperationDoServiceImpl extends ServiceImpl<OperationDoMapper, Opera
...
@@ -76,8 +45,8 @@ public class OperationDoServiceImpl extends ServiceImpl<OperationDoMapper, Opera
return
this
.
baseMapper
.
queryRunLogIdList
();
return
this
.
baseMapper
.
queryRunLogIdList
();
}
}
@Override
@Override
public
AllCountVO
querycount
()
{
public
AllCountVO
querycount
(
String
username
)
{
return
this
.
baseMapper
.
querycount
();
return
this
.
baseMapper
.
querycount
(
username
);
}
}
@Override
@Override
public
List
<
RunLogWarnMessageVO
>
queryNeedMessageRunLog
()
{
public
List
<
RunLogWarnMessageVO
>
queryNeedMessageRunLog
()
{
...
...
src/main/resources/mapper/GuideMapper.xml
View file @
f2f9d720
...
@@ -4,13 +4,11 @@
...
@@ -4,13 +4,11 @@
<select
id=
"queryByName"
resultType=
"com.example.operation_platform.model.vo.GuideVO"
>
<select
id=
"queryByName"
resultType=
"com.example.operation_platform.model.vo.GuideVO"
>
select
select
tg.id id,
tg.robotcontent robotcontent,
tg.content content,
tg.stationcontent stationcontent
tg.img img
from
from
tb_guide tg
tb_guide tg
where
tg.name = #{name}
</select>
</select>
<select
id =
"queryguidelist"
resultType=
"com.example.operation_platform.model.vo.GuideVO"
>
<select
id =
"queryguidelist"
resultType=
"com.example.operation_platform.model.vo.GuideVO"
>
select
select
...
...
src/main/resources/mapper/OperationDoMapper.xml
View file @
f2f9d720
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<select
id=
"queryDoList"
resultType=
"com.example.operation_platform.model.vo.OperationDoVO"
>
<select
id=
"queryDoList"
resultType=
"com.example.operation_platform.model.vo.OperationDoVO"
>
SELECT
SELECT
top.id AS id,
top.id AS id,
tj.id AS operationJobId,
top.operation_cycle AS operationCycle,
top.operation_cycle AS operationCycle,
top.start_time AS startTime,
top.start_time AS startTime,
COALESCE(br.name, dr.name) AS robotName,
COALESCE(br.name, dr.name) AS robotName,
...
@@ -17,7 +18,9 @@
...
@@ -17,7 +18,9 @@
top.item_id AS itemId,
top.item_id AS itemId,
top.finish_time AS finishTime,
top.finish_time AS finishTime,
top.drone_id AS droneId,
top.drone_id AS droneId,
latest_rd.operation_date AS lastTime,
top.create_time AS createTime,
latest_job.start_time AS lastTime,
latest_record.operation_date AS nearTime,
(
(
SELECT GROUP_CONCAT(DISTINCT bti.operation_item SEPARATOR ', ')
SELECT GROUP_CONCAT(DISTINCT bti.operation_item SEPARATOR ', ')
FROM tb_operation_item bti
FROM tb_operation_item bti
...
@@ -30,15 +33,21 @@
...
@@ -30,15 +33,21 @@
AND (top.robot_id = tb.robot_id OR (top.robot_id IS NULL AND top.drone_id = tb.drone_id))
AND (top.robot_id = tb.robot_id OR (top.robot_id IS NULL AND top.drone_id = tb.drone_id))
LEFT JOIN tb_worker bw ON tb.operation_worker = bw.id
LEFT JOIN tb_worker bw ON tb.operation_worker = bw.id
LEFT JOIN uav_drone dr ON top.drone_id = dr.id
LEFT JOIN uav_drone dr ON top.drone_id = dr.id
LEFT JOIN tb_operation_job tj ON top.id = tj.operation_id
LEFT JOIN (
LEFT JOIN (
SELECT rd1.*
SELECT operation_id, MAX(start_time) AS start_time
FROM tb_operation_job
GROUP BY operation_id
) latest_job ON top.id = latest_job.operation_id
LEFT JOIN (
SELECT rd1.operation_id, rd1.operation_date
FROM tb_operation_record rd1
FROM tb_operation_record rd1
INNER JOIN (
INNER JOIN (
SELECT operation_id, MAX(operation_date) AS max_date
SELECT operation_id, MAX(operation_date) AS max_date
FROM tb_operation_record
FROM tb_operation_record
GROUP BY operation_id
GROUP BY operation_id
) rd2 ON rd1.operation_id = rd2.operation_id AND rd1.operation_date = rd2.max_date
) rd2 ON rd1.operation_id = rd2.operation_id AND rd1.operation_date = rd2.max_date
) latest_rd ON top.id = latest_rd.operation_id
) latest_
reco
rd ON top.id = latest_
reco
rd.operation_id
<where>
<where>
top.runlog_or_operation = 0
top.runlog_or_operation = 0
<if
test=
"robotName != null and robotName != ''"
>
<if
test=
"robotName != null and robotName != ''"
>
...
@@ -51,7 +60,7 @@
...
@@ -51,7 +60,7 @@
<if
test=
"workerName != null and workerName != ''"
>
<if
test=
"workerName != null and workerName != ''"
>
AND bw.worker_name LIKE CONCAT('%', #{workerName}, '%')
AND bw.worker_name LIKE CONCAT('%', #{workerName}, '%')
</if>
</if>
<if
test=
"status != null
and status != ''
"
>
<if
test=
"status != null "
>
AND top.status = #{status}
AND top.status = #{status}
</if>
</if>
<if
test=
"startTime != null"
>
<if
test=
"startTime != null"
>
...
@@ -60,7 +69,7 @@
...
@@ -60,7 +69,7 @@
<if
test=
"endTime != null"
>
<if
test=
"endTime != null"
>
AND top.start_time
<
= #{endTime}
<!-- 注意字段名是finish_time还是end_time -->
AND top.start_time
<
= #{endTime}
<!-- 注意字段名是finish_time还是end_time -->
</if>
</if>
<if
test=
"id != null
and id != ''
"
>
<if
test=
"id != null "
>
AND top.id = #{id}
AND top.id = #{id}
</if>
</if>
<if
test=
"username != null and username != ''"
>
<if
test=
"username != null and username != ''"
>
...
@@ -93,6 +102,7 @@
...
@@ -93,6 +102,7 @@
<select
id=
"queryDoRunLog"
resultType=
"com.example.operation_platform.model.vo.OperationDoVO"
>
<select
id=
"queryDoRunLog"
resultType=
"com.example.operation_platform.model.vo.OperationDoVO"
>
SELECT
SELECT
top.id AS id,
top.id AS id,
tj.id AS operationJobId,
top.operation_cycle AS operationCycle,
top.operation_cycle AS operationCycle,
top.start_time AS startTime,
top.start_time AS startTime,
COALESCE(br.name, dr.name) AS robotName,
COALESCE(br.name, dr.name) AS robotName,
...
@@ -105,7 +115,9 @@
...
@@ -105,7 +115,9 @@
top.item_id AS itemId,
top.item_id AS itemId,
top.finish_time AS finishTime,
top.finish_time AS finishTime,
top.drone_id AS droneId,
top.drone_id AS droneId,
latest_rd.operation_date AS lastTime,
top.create_time AS createTime,
latest_job.start_time AS lastTime,
latest_record.operation_date AS nearTime,
(
(
SELECT GROUP_CONCAT(DISTINCT bti.operation_item SEPARATOR ', ')
SELECT GROUP_CONCAT(DISTINCT bti.operation_item SEPARATOR ', ')
FROM tb_operation_item bti
FROM tb_operation_item bti
...
@@ -118,15 +130,21 @@
...
@@ -118,15 +130,21 @@
AND (top.robot_id = tb.robot_id OR (top.robot_id IS NULL AND top.drone_id = tb.drone_id))
AND (top.robot_id = tb.robot_id OR (top.robot_id IS NULL AND top.drone_id = tb.drone_id))
LEFT JOIN tb_worker bw ON tb.operation_worker = bw.id
LEFT JOIN tb_worker bw ON tb.operation_worker = bw.id
LEFT JOIN uav_drone dr ON top.drone_id = dr.id
LEFT JOIN uav_drone dr ON top.drone_id = dr.id
LEFT JOIN tb_operation_job tj ON top.id = tj.operation_id
LEFT JOIN (
SELECT operation_id, MAX(start_time) AS start_time
FROM tb_operation_job
GROUP BY operation_id
) latest_job ON top.id = latest_job.operation_id
LEFT JOIN (
LEFT JOIN (
SELECT rd1.
*
SELECT rd1.
operation_id, rd1.operation_date
FROM tb_operation_record rd1
FROM tb_operation_record rd1
INNER JOIN (
INNER JOIN (
SELECT operation_id, MAX(operation_date) AS max_date
SELECT operation_id, MAX(operation_date) AS max_date
FROM tb_operation_record
FROM tb_operation_record
GROUP BY operation_id
GROUP BY operation_id
) rd2 ON rd1.operation_id = rd2.operation_id AND rd1.operation_date = rd2.max_date
) rd2 ON rd1.operation_id = rd2.operation_id AND rd1.operation_date = rd2.max_date
) latest_rd ON top.id = latest_rd.operation_id
) latest_
reco
rd ON top.id = latest_
reco
rd.operation_id
<where>
<where>
top.runlog_or_operation = 1
top.runlog_or_operation = 1
<if
test=
"robotName != null and robotName != ''"
>
<if
test=
"robotName != null and robotName != ''"
>
...
@@ -139,7 +157,7 @@
...
@@ -139,7 +157,7 @@
<if
test=
"workerName != null and workerName != ''"
>
<if
test=
"workerName != null and workerName != ''"
>
AND bw.worker_name LIKE CONCAT('%', #{workerName}, '%')
AND bw.worker_name LIKE CONCAT('%', #{workerName}, '%')
</if>
</if>
<if
test=
"status != null
and status != ''
"
>
<if
test=
"status != null "
>
AND top.status = #{status}
AND top.status = #{status}
</if>
</if>
<if
test=
"startTime != null"
>
<if
test=
"startTime != null"
>
...
@@ -148,7 +166,7 @@
...
@@ -148,7 +166,7 @@
<if
test=
"endTime != null"
>
<if
test=
"endTime != null"
>
AND top.start_time
<
= #{endTime}
<!-- 注意字段名是finish_time还是end_time -->
AND top.start_time
<
= #{endTime}
<!-- 注意字段名是finish_time还是end_time -->
</if>
</if>
<if
test=
"id != null
and id != ''
"
>
<if
test=
"id != null "
>
AND top.id = #{id}
AND top.id = #{id}
</if>
</if>
<if
test=
"username != null and username != ''"
>
<if
test=
"username != null and username != ''"
>
...
@@ -165,11 +183,27 @@
...
@@ -165,11 +183,27 @@
top.runlog_or_operation = 1
top.runlog_or_operation = 1
</select>
</select>
<!-- 统计维保计划,维保待办,运行告警数量-->
<select
id=
"querycount"
resultType=
"com.example.operation_platform.model.vo.AllCountVO"
>
<select
id=
"querycount"
resultType=
"com.example.operation_platform.model.vo.AllCountVO"
>
select
SELECT
(select count(*) from tb_operation top where top.runlog_or_operation = 0) as operationDoCount,
(SELECT COUNT(*) FROM tb_operation top
(select count(*) from tb_operation_job tp where tp.runlog_or_operation = 0) as JobCount,
INNER JOIN tb_message tb ON top.station_id = tb.station_id
(select count(*) from tb_operation top where top.runlog_or_operation = 1) as warnCount
AND (top.robot_id = tb.robot_id OR (top.robot_id IS NULL AND top.drone_id = tb.drone_id))
INNER JOIN tb_worker bw ON tb.operation_worker = bw.id
WHERE top.runlog_or_operation = 0 AND bw.username = #{username}) AS operationDoCount,
(SELECT COUNT(*) FROM tb_operation_job tp
INNER JOIN tb_operation top ON tp.operation_id = top.id
INNER JOIN tb_message tb ON top.station_id = tb.station_id
AND (top.robot_id = tb.robot_id OR (top.robot_id IS NULL AND top.drone_id = tb.drone_id))
INNER JOIN tb_worker bw ON tb.operation_worker = bw.id
WHERE tp.finish_status = 1 AND bw.username = #{username}) AS JobCount,
(SELECT COUNT(*) FROM tb_operation top
INNER JOIN tb_message tb ON top.station_id = tb.station_id
AND (top.robot_id = tb.robot_id OR (top.robot_id IS NULL AND top.drone_id = tb.drone_id))
INNER JOIN tb_worker bw ON tb.operation_worker = bw.id
WHERE top.runlog_or_operation = 1 AND bw.username = #{username}) AS warnCount
</select>
</select>
<!-- 查询运行告警信息,且在进行中的任务-->
<!-- 查询运行告警信息,且在进行中的任务-->
<select
id=
"queryNeedMessageRunLog"
resultType=
"com.example.operation_platform.model.vo.RunLogWarnMessageVO"
>
<select
id=
"queryNeedMessageRunLog"
resultType=
"com.example.operation_platform.model.vo.RunLogWarnMessageVO"
>
...
...
src/main/resources/mapper/OperationJobMapper.xml
View file @
f2f9d720
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
top.runlog_or_operation = 0
top.runlog_or_operation = 0
AND top.finish_status NOT IN (2, 4)
AND top.finish_status NOT IN (2, 4)
<if
test=
"date != null"
>
<if
test=
"date != null"
>
AND
#{date} BETWEEN top.start_time AND top.end_time
AND
top.start_time like concat('%',#{date},'%')
</if>
</if>
<if
test=
"year != null and month != null"
>
<if
test=
"year != null and month != null"
>
AND
AND
...
@@ -156,12 +156,12 @@
...
@@ -156,12 +156,12 @@
LEFT JOIN tb_worker bw ON tm.operation_worker = bw.id
LEFT JOIN tb_worker bw ON tm.operation_worker = bw.id
<where>
<where>
<if
test=
"stationId != null and stationId != ''"
>
<if
test=
"stationId != null and stationId != ''"
>
and
tp.station_id = #{stationId}
tp.station_id = #{stationId}
</if>
</if>
<if
test=
"username != null and username != ''"
>
<if
test=
"username != null and username != ''"
>
and bw.username = #{username}
and bw.username = #{username}
</if>
</if>
<if
test=
"finishStatus != null
and finishStatus != ''
"
>
<if
test=
"finishStatus != null"
>
and top.finish_status = #{finishStatus}
and top.finish_status = #{finishStatus}
</if>
</if>
</where>
</where>
...
...
src/main/resources/mapper/OperationRecordMapper.xml
View file @
f2f9d720
...
@@ -4,27 +4,35 @@
...
@@ -4,27 +4,35 @@
<!--维保记录查询-->
<!--维保记录查询-->
<select
id=
"queryrecordList"
resultType=
"com.example.operation_platform.model.vo.OperationRecordVO"
>
<select
id=
"queryrecordList"
resultType=
"com.example.operation_platform.model.vo.OperationRecordVO"
>
SELECT
SELECT
tor.id id,
tor.id AS id,
COALESCE ( br.NAME, dr.NAME ) robotName,
COALESCE(br.name, dr.name) AS robotName,
tor.content content,
tor.content AS content,
top.operation_type operationType,
top.operation_type AS operationType,
tor.img img,
tor.img AS img,
tor.operation_date operationDate,
tor.operation_date AS operationDate,
bs.NAME stationName,
bs.name AS stationName,
tw.worker_name workerName,
tw.worker_name AS workerName,
tor.note note
tor.note AS note,
latest_job.start_time AS nearTime
FROM
FROM
tb_operation_record tor
tb_operation_record tor
LEFT JOIN tb_operation top ON tor.operation_id = top.id
LEFT JOIN tb_operation top ON tor.operation_id = top.id
LEFT JOIN bs_station bs ON top.station_id = bs.id
LEFT JOIN bs_station bs ON top.station_id = bs.id
LEFT JOIN tb_operation_job oj ON tor.operation_job_id = oj.id
LEFT JOIN tb_operation_job oj ON tor.operation_job_id = oj.id
LEFT JOIN tb_message tb ON top.station_id = tb.station_id
LEFT JOIN tb_message tb ON top.station_id = tb.station_id
AND (
AND (top.robot_id = tb.robot_id OR (top.robot_id IS NULL AND top.drone_id = tb.drone_id))
top.robot_id = tb.robot_id
OR ( top.robot_id IS NULL AND top.drone_id = tb.drone_id ))
LEFT JOIN bs_robot br ON top.robot_id = br.id
LEFT JOIN bs_robot br ON top.robot_id = br.id
LEFT JOIN uav_drone dr ON top.drone_id = dr.id
LEFT JOIN uav_drone dr ON top.drone_id = dr.id
LEFT JOIN tb_worker tw ON tb.operation_worker=tw.id
LEFT JOIN tb_worker tw ON tb.operation_worker = tw.id
LEFT JOIN (
SELECT
operation_id,
MAX(start_time) AS start_time
FROM
tb_operation_job
GROUP BY
operation_id
) latest_job ON top.id = latest_job.operation_id
<where>
<where>
tor.runlog_or_operation = 0
tor.runlog_or_operation = 0
<if
test=
"operationId != null and operationId != ''"
>
<if
test=
"operationId != null and operationId != ''"
>
...
@@ -111,7 +119,7 @@
...
@@ -111,7 +119,7 @@
OR ( top.robot_id IS NULL AND top.drone_id = tb.drone_id ))
OR ( top.robot_id IS NULL AND top.drone_id = tb.drone_id ))
LEFT JOIN bs_robot br ON top.robot_id = br.id
LEFT JOIN bs_robot br ON top.robot_id = br.id
LEFT JOIN uav_drone dr ON top.drone_id = dr.id
LEFT JOIN uav_drone dr ON top.drone_id = dr.id
WHERE
<where>
tor.runlog_or_operation = 1
tor.runlog_or_operation = 1
<if
test=
"stationId != null and stationId != ''"
>
<if
test=
"stationId != null and stationId != ''"
>
and top.station_id= #{stationId}
and top.station_id= #{stationId}
...
@@ -119,6 +127,10 @@
...
@@ -119,6 +127,10 @@
<if
test=
"stationName != null and stationName != ''"
>
<if
test=
"stationName != null and stationName != ''"
>
and bs.name LIKE CONCAT('%', #{stationName}, '%')
and bs.name LIKE CONCAT('%', #{stationName}, '%')
</if>
</if>
<if
test=
"operationJobId != null "
>
and tor.operation_job_id= #{operationJobId}
</if>
</where>
order by tor.operation_date desc
order by tor.operation_date desc
</select>
</select>
<!-- 异常维保记录包含告警信息,可以根据泵站名或id查询-->
<!-- 异常维保记录包含告警信息,可以根据泵站名或id查询-->
...
...
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