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
e01ccc1b
Commit
e01ccc1b
authored
Jan 18, 2021
by
田涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数字预案分页查询接口
parent
b437c0ec
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
0 deletions
+153
-0
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+23
-0
PlanDetailMapper.java
...eejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
+8
-0
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+21
-0
ContingencyPlanService.java
...os/fas/business/service/intfc/ContingencyPlanService.java
+16
-0
PlanDetailMapper.xml
...ysStart/src/main/resources/db/mapper/PlanDetailMapper.xml
+85
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
e01ccc1b
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.service.intfc.ContingencyPlanService
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -70,6 +72,27 @@ public class ContingencyPlanController extends BaseController {
}
/**
* 数字预案分页查询
*/
@Permission
@ApiOperation
(
value
=
"查看数字预案详情"
,
notes
=
"查看数字预案详情"
)
@GetMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
pageFilter
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"planName"
,
required
=
false
)
String
planName
,
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
Long
[]
classifyId
,
@RequestParam
(
value
=
"planRange"
,
required
=
false
)
String
[]
planRange
,
@RequestParam
(
value
=
"editOrgName"
,
required
=
false
)
String
editOrgName
,
@RequestParam
(
value
=
"implementationTimeLeft"
,
required
=
false
)
Date
implementationTimeLeft
,
@RequestParam
(
value
=
"implementationTimeRight"
,
required
=
false
)
Date
implementationTimeRight
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
if
(
current
<
1
||
size
<
1
)
{
throw
new
YeeException
(
"分页参数有误"
);
}
Page
page
=
new
Page
(
current
,
size
);
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
pageFilter
(
page
,
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
));
}
/**
* 启用预案
*/
@Permission
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
View file @
e01ccc1b
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -17,4 +19,10 @@ public interface PlanDetailMapper {
int
updatePlanStatusByIdList
(
@Param
(
"idList"
)
List
<
Long
>
idList
,
@Param
(
"status"
)
Integer
status
);
int
updateIsDeleteByIdList
(
@Param
(
"idList"
)
List
<
Long
>
idList
,
@Param
(
"isDelete"
)
Boolean
isDelete
);
Integer
filterCount
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
Long
[]
classifyId
,
@Param
(
"planRange"
)
String
[]
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
);
List
<
PlanDetailVo
>
filterList
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
Long
[]
classifyId
,
@Param
(
"planRange"
)
String
[]
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
,
@Param
(
"start"
)
long
start
,
@Param
(
"size"
)
long
size
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
e01ccc1b
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanDetailMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.service.intfc.ContingencyPlanService
;
...
...
@@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
...
...
@@ -189,4 +191,22 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
planDetailMapper
.
updateIsDeleteByIdList
(
idList
,
true
);
return
true
;
}
@Override
public
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
[]
classifyId
,
String
[]
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
)
{
int
total
=
planDetailMapper
.
filterCount
(
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
);
page
.
setTotal
(
total
);
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
if
(
total
==
0
)
{
page
.
setCurrent
(
1
);
}
else
{
if
(
total
<
start
)
{
page
.
setCurrent
(
1
);
start
=
0
;
}
List
<
PlanDetailVo
>
planList
=
planDetailMapper
.
filterList
(
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
,
start
,
page
.
getSize
());
page
.
setRecords
(
planList
);
}
return
page
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/ContingencyPlanService.java
View file @
e01ccc1b
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -53,4 +55,18 @@ public interface ContingencyPlanService {
* @return
*/
Boolean
delete
(
List
<
Long
>
idList
);
/**
* 分页查询
* @param page 分页
* @param planName 预案名称
* @param classifyId 预案类型
* @param planRange 适用范围
* @param editOrgName 编写部门
* @param implementationTimeLeft 实施时间左界限
* @param implementationTimeRight 实施时间右界限
* @return Page
*/
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
[]
classifyId
,
String
[]
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
);
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanDetailMapper.xml
View file @
e01ccc1b
...
...
@@ -16,4 +16,88 @@
</foreach>
</update>
<select
id=
"filterCount"
parameterType=
"string"
resultType=
"int"
>
SELECT
count(1)
FROM
c_plan_detail cpd
<where>
<if
test=
"planName != null and planName.length > 0"
>
AND plan_name LIKE concat('%', #{planName}, '%')
</if>
<if
test=
"classifyId != null and classifyId.size > 0"
>
AND classify_id IN
<foreach
collection=
"classifyId"
separator=
","
item=
"cid"
open=
"("
close=
")"
>
#{cid}
</foreach>
</if>
<if
test=
"planRange != null and planRange.size > 0"
>
AND plan_range IN
<foreach
collection=
"planRange"
separator=
","
item=
"pr"
open=
"("
close=
")"
>
#{pr}
</foreach>
</if>
<if
test=
"editOrgName != null and editOrgName.length > 0"
>
AND edit_org_name LIKE concat('%', #{editOrgName}, '%')
</if>
<if
test=
"implementationTimeLeft != null"
>
AND implementation_time
<![CDATA[ >= ]]>
#{implementationTimeLeft}
</if>
<if
test=
"implementationTimeRight != null"
>
AND implementation_time
<![CDATA[ < ]]>
#{implementationTimeRight}
</if>
AND is_delete = 0
</where>
</select>
<select
id=
"filterList"
parameterType=
"string"
resultType=
"com.yeejoin.amos.fas.business.vo.PlanDetailVo"
>
SELECT
id
, create_date createDate
, plan_name planName
, code
, classify_id classifyId
, plan_range planRange
, edit_org_name editOrgName
, edition
, implementation_time implementationTime
, remark
, status
, creator
, reviser
, update_time updateTime
, org_code orgCode
, is_delete isDelete
, (SELECT classify_name FROM c_plan_classify_tree cpct WHERE id = cpd.classify_id) classifyName
, (SELECT count(1) FROM c_plan_operation_record cpor WHERE plan_id = cpd.id) executionTimes
FROM
c_plan_detail cpd
<where>
<if
test=
"planName != null and planName.length > 0"
>
AND plan_name LIKE concat('%', #{planName}, '%')
</if>
<if
test=
"classifyId != null and classifyId.size > 0"
>
AND classify_id IN
<foreach
collection=
"classifyId"
separator=
","
item=
"cid"
open=
"("
close=
")"
>
#{cid}
</foreach>
</if>
<if
test=
"planRange != null and planRange.size > 0"
>
AND plan_range IN
<foreach
collection=
"planRange"
separator=
","
item=
"pr"
open=
"("
close=
")"
>
#{pr}
</foreach>
</if>
<if
test=
"editOrgName != null and editOrgName.length > 0"
>
AND edit_org_name LIKE concat('%', #{editOrgName}, '%')
</if>
<if
test=
"implementationTimeLeft != null"
>
AND implementation_time
<![CDATA[ >= ]]>
#{implementationTimeLeft}
</if>
<if
test=
"implementationTimeRight != null"
>
AND implementation_time
<![CDATA[ < ]]>
#{implementationTimeRight}
</if>
AND is_delete = 0
</where>
</select>
</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