Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
aad8d98c
Commit
aad8d98c
authored
Jan 20, 2021
by
田涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
执行记录分页列表
parent
f0953cd0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
51 deletions
+119
-51
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+12
-10
PlanOperationRecordMapper.java
...os/fas/business/dao/mapper/PlanOperationRecordMapper.java
+6
-2
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+22
-10
IContingencyPlanService.java
...s/fas/business/service/intfc/IContingencyPlanService.java
+3
-1
PlanOperationRecordMapper.xml
...rc/main/resources/db/mapper/PlanOperationRecordMapper.xml
+76
-28
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
aad8d98c
...
@@ -183,21 +183,23 @@ public class ContingencyPlanController extends BaseController {
...
@@ -183,21 +183,23 @@ public class ContingencyPlanController extends BaseController {
}
}
@ApiOperation
(
value
=
"预案启动记录分页列表"
)
@ApiOperation
(
value
=
"预案启动记录分页列表"
)
@RequestMapping
(
value
=
"/record
List
"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/record
/page
"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
recordList
(
public
ResponseModel
recordList
(
@RequestParam
int
current
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
int
pageSize
,
@RequestParam
(
value
=
"size"
)
int
pageSize
,
@ApiParam
(
value
=
"预案类型"
)
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
List
<
Long
>
classifyId
,
@ApiParam
(
value
=
"预案类型"
)
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
List
<
Long
>
classifyId
,
@ApiParam
(
value
=
"
预案类型
"
)
@RequestParam
(
value
=
"startTimeLeft"
,
required
=
false
)
Long
startTimeLeftStamp
,
@ApiParam
(
value
=
"
启动时间左边界
"
)
@RequestParam
(
value
=
"startTimeLeft"
,
required
=
false
)
Long
startTimeLeftStamp
,
@ApiParam
(
value
=
"
预案类型
"
)
@RequestParam
(
value
=
"startTimeRight"
,
required
=
false
)
Long
startTimeRightStamp
,
@ApiParam
(
value
=
"
启动时间右边界
"
)
@RequestParam
(
value
=
"startTimeRight"
,
required
=
false
)
Long
startTimeRightStamp
,
@ApiParam
(
value
=
"
预案类型
"
)
@RequestParam
(
value
=
"executionType"
,
required
=
false
)
Integer
executionType
,
@ApiParam
(
value
=
"
执行方式
"
)
@RequestParam
(
value
=
"executionType"
,
required
=
false
)
Integer
executionType
,
@ApiParam
(
value
=
"
预案类型
"
)
@RequestParam
(
value
=
"planPattern"
,
required
=
false
)
Integer
planPattern
,
@ApiParam
(
value
=
"
运行模式
"
)
@RequestParam
(
value
=
"planPattern"
,
required
=
false
)
Integer
planPattern
,
@ApiParam
(
value
=
"预案名称"
)
@RequestParam
(
value
=
"planName"
,
required
=
false
)
String
planName
)
{
@ApiParam
(
value
=
"预案名称"
)
@RequestParam
(
value
=
"planName"
,
required
=
false
)
String
planName
)
{
Date
startTimeLeft
=
startTimeLeftStamp
==
null
?
null
:
new
Date
(
startTimeLeftStamp
);
Date
startTimeLeft
=
startTimeLeftStamp
==
null
?
null
:
new
Date
(
startTimeLeftStamp
);
Date
startTimeRight
=
startTimeRightStamp
==
null
?
null
:
new
Date
(
startTimeRightStamp
);
Date
startTimeRight
=
startTimeRightStamp
==
null
?
null
:
new
Date
(
startTimeRightStamp
);
if
(
current
<
1
||
pageSize
<
1
)
{
Page
page
=
contingencyPlanService
.
recordListByPage
(
current
,
pageSize
,
planName
);
throw
new
YeeException
(
"分页参数有误"
);
return
CommonResponseUtil2
.
success
(
page
);
}
Page
page
=
new
Page
(
current
,
pageSize
);
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
recordListByPage
(
page
,
planName
,
classifyId
,
startTimeLeft
,
startTimeRight
,
executionType
,
planPattern
));
}
}
@ApiOperation
(
value
=
"第一次查看预案记录"
)
@ApiOperation
(
value
=
"第一次查看预案记录"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanOperationRecordMapper.java
View file @
aad8d98c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -14,6 +15,9 @@ import java.util.Map;
...
@@ -14,6 +15,9 @@ import java.util.Map;
*/
*/
@Repository
@Repository
public
interface
PlanOperationRecordMapper
{
public
interface
PlanOperationRecordMapper
{
Integer
PlanOperationRecordListByCount
(
Map
<
String
,
Object
>
params
);
List
<
HashMap
<
String
,
Object
>>
PlanOperationRecordListByPage
(
Map
<
String
,
Object
>
params
);
int
filterCount
(
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
filterList
(
Map
<
String
,
Object
>
params
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
aad8d98c
...
@@ -271,18 +271,30 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -271,18 +271,30 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
@Override
@Override
public
Page
recordListByPage
(
int
current
,
int
pageSize
,
String
planName
)
{
public
Page
recordListByPage
(
Page
page
,
String
planName
,
List
<
Long
>
classifyId
,
Date
startTimeLeft
,
Date
startTimeRight
,
Integer
executionType
,
Integer
planPattern
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"planName"
,
planName
);
params
.
put
(
"planName"
,
planName
);
params
.
put
(
"offset"
,
(
current
-
1
)
*
pageSize
);
params
.
put
(
"start"
,
(
int
)
((
page
.
getCurrent
()
-
1
)
*
page
.
getSize
()));
params
.
put
(
"pageSize"
,
pageSize
);
params
.
put
(
"size"
,
(
int
)
page
.
getSize
());
List
<
HashMap
<
String
,
Object
>>
result
=
planOperationRecordMapper
.
PlanOperationRecordListByPage
(
params
);
params
.
put
(
"classifyId"
,
classifyId
);
Integer
count
=
planOperationRecordMapper
.
PlanOperationRecordListByCount
(
params
);
params
.
put
(
"startTimeLeft"
,
startTimeLeft
);
Page
page
=
new
Page
();
params
.
put
(
"startTimeRight"
,
startTimeRight
);
page
.
setRecords
(
result
);
params
.
put
(
"executionType"
,
executionType
);
page
.
setTotal
(
count
);
params
.
put
(
"planPattern"
,
planPattern
);
page
.
setSize
(
pageSize
);
page
.
setCurrent
(
current
);
int
total
=
planOperationRecordMapper
.
filterCount
(
params
);
page
.
setTotal
(
total
);
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
if
(
total
==
0
)
{
page
.
setCurrent
(
1
);
}
else
{
if
(
total
<
start
)
{
page
.
setCurrent
(
1
);
params
.
put
(
"start"
,
0
);
}
List
<
Map
<
String
,
Object
>>
planList
=
planOperationRecordMapper
.
filterList
(
params
);
page
.
setRecords
(
planList
);
}
return
page
;
return
page
;
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyPlanService.java
View file @
aad8d98c
...
@@ -29,7 +29,6 @@ public interface IContingencyPlanService {
...
@@ -29,7 +29,6 @@ public interface IContingencyPlanService {
ContingencyPlanParamVo
equipmentScene
(
Long
equipmentId
,
String
riskType
);
ContingencyPlanParamVo
equipmentScene
(
Long
equipmentId
,
String
riskType
);
Page
recordListByPage
(
int
current
,
int
pageSize
,
String
planName
);
/**
/**
* 创建
* 创建
* @param planDetail
* @param planDetail
...
@@ -114,4 +113,7 @@ public interface IContingencyPlanService {
...
@@ -114,4 +113,7 @@ public interface IContingencyPlanService {
Map
<
String
,
Object
>
firstGetRecord
(
String
batchNo
);
Map
<
String
,
Object
>
firstGetRecord
(
String
batchNo
);
List
<
HashMap
<
String
,
Object
>>
getRecordList
(
String
batchNo
);
List
<
HashMap
<
String
,
Object
>>
getRecordList
(
String
batchNo
);
Page
recordListByPage
(
Page
page
,
String
planName
,
List
<
Long
>
classifyId
,
Date
startTimeLeft
,
Date
startTimeRight
,
Integer
executionType
,
Integer
planPattern
);
}
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanOperationRecordMapper.xml
View file @
aad8d98c
<?xml version="1.0" encoding="UTF-8"?>
<?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">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper"
>
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper"
>
<select
id=
"
PlanOperationRecordListByPage"
parameterType=
"hashmap"
resultType=
"java.util.HashMap
"
>
<select
id=
"
filterCount"
parameterType=
"map"
resultType=
"java.lang.Integer
"
>
SELECT
SELECT
record.batch_No AS batchNo,
count(1)
detail.plan_name AS planName,
original.fire_Equipment_Name AS fireEquipmentName,
record.start_time AS startTime,
TIMESTAMPDIFF(second,record.start_time,record.end_time) as executionTime,
record.plan_pattern as planPattern,
'' AS executionType
FROM
FROM
`c_plan_operation_record` record
c_plan_operation_record cpor
LEFT JOIN c_plan_detail detail ON detail.id = record.plan_id
LEFT JOIN c_plan_detail cpd ON
LEFT JOIN contingency_original_data original ON original.batch_no = record.batch_no
cpor.plan_id = cpd.id
<where>
<where>
<if
test=
"planName !=null and planName != ''"
>
( detail.plan_name like concat(concat("%",#{planName}),"%"))
</if>
<if
test=
"planName != null and planName.length > 0"
>
</where>
AND cpd.plan_name LIKE CONCAT('%', #{planName},'%')
limit #{offset},#{pageSize}
</if>
<if
test=
"classifyId != null and classifyId.size > 0"
>
AND cpd.classify_id IN
<foreach
collection=
"classifyId"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"planPattern != null"
>
AND cpd.plan_pattern = #{planPattern}
</if>
<if
test=
"executionType != null"
>
AND cpd.execution_type LIKE #{executionType}
</if>
<if
test=
"startTimeLeft != null"
>
AND cpd.start_time
<![CDATA[ >= ]]>
#{implementationTimeLeft}
</if>
<if
test=
"startTimeRight != null"
>
AND cpd.start_time
<![CDATA[ < ]]>
#{implementationTimeRight}
</if>
</where>
</select>
<select
id=
"filterList"
parameterType=
"map"
resultType=
"map"
>
SELECT
cpor.id
, cpor.batch_no batchNo
, cpor.plan_id planId
, cpor.start_time startTime
, cpor.end_time endTime
, cpor.status
, cpor.equipment_code equipmentCode
, cpor.equipment_name equipmentName
, cpor.execution_type executionType
, cpor.plan_pattern planPattern
, cpor.start_user_name startUserName
, cpd.plan_name planName
, (SELECT classify_name FROM c_plan_classify_tree cpct WHERE id = cpd.classify_id) classifyName
, cpd.plan_range planRange
, TIMESTAMPDIFF(SECOND, cpor.start_time, ifnull(cpor.end_time, now())) spendTime
FROM
c_plan_operation_record cpor
LEFT JOIN c_plan_detail cpd ON
cpor.plan_id = cpd.id
<where>
<if
test=
"planName != null and planName.length > 0"
>
AND cpd.plan_name LIKE CONCAT('%', #{planName},'%')
</if>
<if
test=
"classifyId != null and classifyId.size > 0"
>
AND cpd.classify_id IN
<foreach
collection=
"classifyId"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"planPattern != null"
>
AND cpd.plan_pattern = #{planPattern}
</if>
<if
test=
"executionType != null"
>
AND cpd.execution_type LIKE #{executionType}
</if>
<if
test=
"startTimeLeft != null"
>
AND cpd.start_time
<![CDATA[ >= ]]>
#{implementationTimeLeft}
</if>
<if
test=
"startTimeRight != null"
>
AND cpd.start_time
<![CDATA[ < ]]>
#{implementationTimeRight}
</if>
</where>
ORDER BY cpor.id ASC
LIMIT #{start}, #{size}
</select>
</select>
<select
id=
"PlanOperationRecordListByCount"
parameterType=
"hashmap"
resultType=
"java.lang.Integer"
>
SELECT
COUNT(*)
FROM
`c_plan_operation_record` record
LEFT JOIN c_plan_detail detail ON detail.id = record.plan_id
LEFT JOIN contingency_original_data original ON original.batch_no = record.batch_no
<where>
<if
test=
"planName !=null and planName != ''"
>
( detail.plan_name like concat(concat("%",#{planName}),"%"))
</if>
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
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