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
6cc85104
Commit
6cc85104
authored
Aug 12, 2024
by
张森
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
演练场景相关API开发
parent
591608fb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
231 additions
and
26 deletions
+231
-26
PlanReport.java
...main/java/com/yeejoin/amos/fas/dao/entity/PlanReport.java
+34
-20
PlanReportController.java
...in/amos/fas/business/controller/PlanReportController.java
+65
-3
PlanReportMapper.java
...eejoin/amos/fas/business/dao/mapper/PlanReportMapper.java
+18
-1
PlanReportServiceImpl.java
...amos/fas/business/service/impl/PlanReportServiceImpl.java
+17
-1
IPlanReportService.java
...n/amos/fas/business/service/intfc/IPlanReportService.java
+6
-1
PlanReportMapper.xml
...ysStart/src/main/resources/db/mapper/PlanReportMapper.xml
+91
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanReport.java
View file @
6cc85104
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
java.util.Date
;
@Data
@Entity
@Table
(
name
=
"c_plan_report"
)
public
class
PlanReport
extends
BasicEntity
{
@TableName
(
"c_plan_report"
)
public
class
PlanReport
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@
Column
(
name
=
"batch_no"
)
@
TableField
(
"batch_no"
)
private
String
batchNo
;
@
Column
(
name
=
"report_url"
)
@
TableField
(
"report_url"
)
private
String
reportUrl
;
@
Column
(
name
=
"title"
)
@
TableField
(
"title"
)
private
String
title
;
@Column
(
name
=
"create_date"
)
private
Date
createDate
;
@Column
(
name
=
"address"
)
@TableField
(
"address"
)
private
String
address
;
@
Column
(
name
=
"compere"
)
@
TableField
(
"compere"
)
private
String
compere
;
@
Column
(
name
=
"attend_person"
)
@
TableField
(
"attend_person"
)
private
String
attendPerson
;
@
Column
(
name
=
"drill_topic"
)
@
TableField
(
"drill_topic"
)
private
String
drillTopic
;
@
Column
(
name
=
"handle_process"
)
@
TableField
(
"handle_process"
)
private
String
handleProcess
;
@
Column
(
name
=
"drill_summary"
)
@
TableField
(
"drill_summary"
)
private
String
drillSummary
;
@
Column
(
name
=
"examine_result"
)
@
TableField
(
"examine_result"
)
private
String
examineResult
;
@TableField
(
"biz_org_name"
)
...
...
@@ -52,4 +45,25 @@ public class PlanReport extends BasicEntity {
@TableField
(
"biz_org_code"
)
private
String
bizOrgCode
;
@TableField
(
"drill_type"
)
private
String
drillType
;
@TableField
(
"drill_equip"
)
private
String
drillEquip
;
@TableField
(
exist
=
false
)
private
Integer
pageNumber
;
@TableField
(
exist
=
false
)
private
Integer
pageSize
;
@TableField
(
exist
=
false
)
private
String
startDate
;
@TableField
(
exist
=
false
)
private
String
endDate
;
@TableField
(
exist
=
false
)
private
String
equipName
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanReportController.java
View file @
6cc85104
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanReportMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanReportService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
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.dao.entity.PlanReport
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.List
;
@RestController
@RequestMapping
(
value
=
"/planReport"
)
@Api
(
tags
=
"演练报告API"
)
public
class
PlanReportController
{
public
class
PlanReportController
extends
BaseController
{
@Autowired
PlanReportMapper
planReportMapper
;
@Autowired
IPlanReportService
iPlanReportService
;
/**
* 保存站端信息
*/
@Permission
@ApiOperation
(
value
=
"保存API"
,
notes
=
"保存API"
)
@PostMapping
(
value
=
"/save"
)
public
CommonResponse
saveStation
(
@RequestBody
PlanReport
planReport
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
reginParams
.
getCompany
().
getOrgCode
();
String
bizOrgName
=
reginParams
.
getCompany
().
getCompanyName
();
planReport
.
setBizOrgCode
(
bizOrgCode
);
planReport
.
setBizOrgName
(
bizOrgName
);
planReport
.
setCreateDate
(
new
Date
());
planReportMapper
.
saveInfo
(
planReport
);
return
CommonResponseUtil
.
success
(
planReport
);
}
/**
* 保存站端信息
*/
@Permission
@ApiOperation
(
value
=
"删除API"
,
notes
=
"删除API"
)
@PostMapping
(
value
=
"/deleteById"
)
public
CommonResponse
deleteById
(
@RequestParam
(
value
=
"id"
)
Long
id
)
{
planReportMapper
.
deleteById
(
id
);
return
CommonResponseUtil
.
success
();
}
/**
* 保存站端信息
*/
@Permission
@ApiOperation
(
value
=
"详情API"
,
notes
=
"详情API"
)
@GetMapping
(
value
=
"/getById"
)
public
CommonResponse
getById
(
@RequestParam
(
value
=
"id"
)
Long
id
)
{
PlanReport
planReport
=
planReportMapper
.
getById
(
id
);
return
CommonResponseUtil
.
success
(
planReport
);
}
/**
* 保存站端信息
*/
@Permission
@ApiOperation
(
value
=
"分页查询"
,
notes
=
"分页查询"
)
@PostMapping
(
value
=
"/getByPage"
)
public
CommonResponse
getByPage
(
@RequestBody
PlanReport
planReport
)
{
Page
<
PlanReport
>
resultPage
=
iPlanReportService
.
getByPage
(
planReport
);
return
CommonResponseUtil
.
success
(
resultPage
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanReportMapper.java
View file @
6cc85104
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
public
interface
PlanReportMapper
extends
BaseMapper
{
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.fas.dao.entity.PlanReport
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
PlanReportMapper
extends
BaseMapper
<
PlanReport
>
{
void
saveInfo
(
PlanReport
dto
);
void
deleteById
(
@Param
(
"id"
)
Long
id
);
Integer
getByCount
(
PlanReport
planReport
);
List
<
PlanReport
>
getByPage
(
PlanReport
planReport
);
PlanReport
getById
(
@Param
(
"id"
)
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanReportServiceImpl.java
View file @
6cc85104
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanReportMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanReportService
;
import
com.yeejoin.amos.fas.dao.entity.PlanReport
;
import
org.springframework.stereotype.Service
;
@Service
public
class
PlanReportServiceImpl
implements
IPlanReportService
{
public
class
PlanReportServiceImpl
extends
ServiceImpl
<
PlanReportMapper
,
PlanReport
>
implements
IPlanReportService
{
@Override
public
Page
<
PlanReport
>
getByPage
(
PlanReport
planReport
)
{
Page
<
PlanReport
>
objectPage
=
new
Page
<>(
planReport
.
getPageNumber
(),
planReport
.
getPageSize
());
planReport
.
setPageNumber
((
planReport
.
getPageNumber
()
-
1
)
*
planReport
.
getPageSize
());
Integer
count
=
this
.
baseMapper
.
getByCount
(
planReport
);
if
(
count
>
0
)
{
objectPage
.
setRecords
(
this
.
baseMapper
.
getByPage
(
planReport
));
objectPage
.
setTotal
(
count
);
}
return
objectPage
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanReportService.java
View file @
6cc85104
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
public
interface
IPlanReportService
{
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.fas.dao.entity.PlanReport
;
public
interface
IPlanReportService
extends
IService
<
PlanReport
>
{
Page
<
PlanReport
>
getByPage
(
PlanReport
planReport
);
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanReportMapper.xml
0 → 100644
View file @
6cc85104
<?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.yeejoin.amos.fas.business.dao.mapper.PlanReportMapper"
>
<insert
id=
"saveInfo"
>
INSERT INTO `c_plan_report` (
`id`,
`batch_no`,
`report_url`,
`title`,
`create_date`,
`address`,
`compere`,
`attend_person`,
`drill_topic`,
`handle_process`,
`drill_summary`,
`examine_result`,
`biz_org_name`,
`biz_org_code`,
`drill_type`,
`drill_equip`
)
VALUES
(
#{id},#{batchNo},#{reportUrl},#{title},#{createDate},#{address},#{compere},#{attendPerson},#{drillTopic},#{handleProcess},#{drillSummary},#{examineResult},#{bizOrgName}, #{bizOrgCode}, #{drillType},#{drillEquip}
)
</insert>
<delete
id=
"deleteById"
>
delete from c_plan_report where id = #{id}
</delete>
<select
id=
"getByCount"
resultType=
"java.lang.Integer"
>
SELECT
count( 1 )
FROM
c_plan_report a
LEFT JOIN f_equipment b on b.id = a.drill_equip
<where>
<if
test=
"drillEquip != null and drillEquip != ''"
>
a.drill_equip = #{drillEquip}
</if>
<if
test=
"drillType != null and drillType != ''"
>
AND a.drill_type = #{drillType}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND a.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if
test=
"startDate != null and startDate != ''"
>
AND a.create_date >= #{startDate}
</if>
<if
test=
"endDate != null and endDate != ''"
>
AND #{endDate} >= a.create_date
</if>
</where>
</select>
<select
id=
"getByPage"
resultType=
"com.yeejoin.amos.fas.dao.entity.PlanReport"
>
SELECT
a.*,
b.name as equipName
FROM
c_plan_report a
left join f_equipment b on b.id = a.drill_equip
<where>
<if
test=
"drillEquip != null and drillEquip != ''"
>
a.drill_equip = #{drillEquip}
</if>
<if
test=
"drillType != null and drillType != ''"
>
AND a.drill_type = #{drillType}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND a.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if
test=
"startDate != null and startDate != ''"
>
AND a.create_date >= #{startDate}
</if>
<if
test=
"endDate != null and endDate != ''"
>
AND #{endDate} >= a.create_date
</if>
</where>
order by a.create_date desc
LIMIT #{pageNumber},#{pageSize}
</select>
<select
id=
"getById"
resultType=
"com.yeejoin.amos.fas.dao.entity.PlanReport"
>
select * from c_plan_report where id = #{id}
</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