Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 68cc5b80
authored
Jul 19, 2023
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.22.0 完成设备分离报警
1 parent
2a9e2eee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
24 deletions
src/main/java/cn/com/glsx/stdinterface/modules/controller/DevSplitController.java
src/main/java/cn/com/glsx/stdinterface/modules/mapper/DevSplitMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/service/DevSplitService.java
src/main/resources/mapper/DevSplitMapper.xml
src/main/java/cn/com/glsx/stdinterface/modules/controller/DevSplitController.java
View file @
68cc5b8
...
@@ -10,10 +10,7 @@ import io.swagger.annotations.Api;
...
@@ -10,10 +10,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* 设备分离报警 controller
* 设备分离报警 controller
...
@@ -32,6 +29,15 @@ public class DevSplitController {
...
@@ -32,6 +29,15 @@ public class DevSplitController {
@Autowired
@Autowired
private
DevSplitService
devSplitService
;
private
DevSplitService
devSplitService
;
@GetMapping
(
value
=
"/search"
)
@SysLog
(
module
=
MODULE
,
value
=
"根据vid和开始时间查询设备分离报警"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@ApiOperation
(
value
=
"保存设备分离报警"
)
public
R
<
DevSplitDTO
>
search
(
@RequestParam
Integer
vid
,
@RequestParam
String
beginTime
)
{
log
.
info
(
"查询设备分离报警===vid:"
+
vid
+
";beginTime:"
+
beginTime
);
DevSplitDTO
devSplitDTO
=
devSplitService
.
searchByVidAndBeginTime
(
vid
,
beginTime
);
return
R
.
ok
().
data
(
devSplitDTO
);
}
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@SysLog
(
module
=
MODULE
,
value
=
"保存设备分离报警"
,
action
=
OperateType
.
ADD
)
@SysLog
(
module
=
MODULE
,
value
=
"保存设备分离报警"
,
action
=
OperateType
.
ADD
)
@ApiOperation
(
value
=
"保存设备分离报警"
)
@ApiOperation
(
value
=
"保存设备分离报警"
)
...
...
src/main/java/cn/com/glsx/stdinterface/modules/mapper/DevSplitMapper.java
View file @
68cc5b8
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
mapper
;
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
mapper
;
import
cn.com.glsx.stdinterface.dto.DevSplitDTO
;
import
cn.com.glsx.stdinterface.modules.entity.DevSplit
;
import
cn.com.glsx.stdinterface.modules.entity.DevSplit
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
@Mapper
public
interface
DevSplitMapper
extends
CommonBaseMapper
<
DevSplit
>
{
public
interface
DevSplitMapper
extends
CommonBaseMapper
<
DevSplit
>
{
DevSplit
findByVidAndBeginTime
(
@Param
(
"vid"
)
Integer
vid
,
@Param
(
"beginTime"
)
String
beginTime
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/service/DevSplitService.java
View file @
68cc5b8
...
@@ -24,6 +24,18 @@ public class DevSplitService {
...
@@ -24,6 +24,18 @@ public class DevSplitService {
private
DevSplitMapper
devSplitMapper
;
private
DevSplitMapper
devSplitMapper
;
/**
/**
* 根据vid和时间查询设备分离报警
*
* @param vid 车辆ID
* @param beginTime 警情发送时间
* @return
*/
public
DevSplitDTO
searchByVidAndBeginTime
(
Integer
vid
,
String
beginTime
)
{
DevSplit
devSplit
=
devSplitMapper
.
findByVidAndBeginTime
(
vid
,
beginTime
);
return
DevSplitConverter
.
INSTANCE
.
syncEntity2Dto
(
devSplit
);
}
/**
* 保存设备分离报警
* 保存设备分离报警
*
*
* @param devSplitDTO 设备分离报警
* @param devSplitDTO 设备分离报警
...
...
src/main/resources/mapper/DevSplitMapper.xml
View file @
68cc5b8
<?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=
"cn.com.glsx.stdinterface.modules.mapper.DevSplitMapper"
>
<mapper
namespace=
"cn.com.glsx.stdinterface.modules.mapper.DevSplitMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.stdinterface.modules.entity.DevSplit"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.stdinterface.modules.entity.DevSplit"
>
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"vid"
jdbcType=
"INTEGER"
property=
"vid"
/>
<result
column=
"vid"
jdbcType=
"INTEGER"
property=
"vid"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"split_flag"
jdbcType=
"TINYINT"
property=
"splitFlag"
/>
<result
column=
"split_flag"
jdbcType=
"TINYINT"
property=
"splitFlag"
/>
<result
column=
"begin_time"
jdbcType=
"TIMESTAMP"
property=
"beginTime"
/>
<result
column=
"begin_time"
jdbcType=
"TIMESTAMP"
property=
"beginTime"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
id, vid, vin, split_flag, begin_time, created_date, created_by, updated_date, updated_by
id, vid, vin, split_flag, begin_time, created_date, created_by, updated_date, updated_by
</sql>
</sql>
<select
id=
"findByVidAndBeginTime"
resultType=
"cn.com.glsx.stdinterface.modules.entity.DevSplit"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_dev_split WHERE vid = #{vid}
AND DATE_FORMAT(begin_time, '%Y-%m-%d')= #{beginTime}
ORDER BY id DESC;
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment