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 fb850804
authored
May 07, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
开发大数据研判报警消费逻辑
1 parent
c5de818f
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
513 additions
and
1 deletions
src/main/java/cn/com/glsx/stdinterface/modules/controller/StujudgeController.java
src/main/java/cn/com/glsx/stdinterface/modules/converter/StujudgeConverter.java
src/main/java/cn/com/glsx/stdinterface/modules/entity/AlarmTrackRec.java
src/main/java/cn/com/glsx/stdinterface/modules/entity/AlarmTrackStujudge.java
src/main/java/cn/com/glsx/stdinterface/modules/mapper/AlarmTrackRecMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/mapper/AlarmTrackStujudgeMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/service/StujudgeService.java
src/main/resources/config/generatorConfig.xml
src/main/resources/mapper/AlarmTrackRecMapper.xml
src/main/resources/mapper/AlarmTrackStujudgeMapper.xml
src/test/java/cn/com/glsx/stdinterface/modules/service/StujudgeServiceTest.java
src/main/java/cn/com/glsx/stdinterface/modules/controller/StujudgeController.java
0 → 100644
View file @
fb85080
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
controller
;
import
cn.com.glsx.stdinterface.api.StujudgeClient
;
import
cn.com.glsx.stdinterface.dto.AlarmTrackStujudgeDto
;
import
cn.com.glsx.stdinterface.modules.service.StujudgeService
;
import
cn.hutool.json.JSONUtil
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.glsx.plat.common.enums.OperateType
;
import
com.glsx.plat.core.web.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 试驾统计 Controller
*/
@Slf4j
@RestController
@RequestMapping
(
value
=
"/stujudge"
)
@Api
(
value
=
"大数据研判"
,
tags
=
{
"大数据研判"
})
public
class
StujudgeController
implements
StujudgeClient
{
private
final
static
String
MODULE
=
"大数据研判"
;
@Autowired
private
StujudgeService
stujudgeService
;
@Override
@PostMapping
(
"findAlarmBySnAndType"
)
@SysLog
(
module
=
MODULE
,
value
=
"根据设备号和警情类型查询警情数据"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@ApiOperation
(
value
=
"根据设备号和警情类型查询警情数据"
)
public
R
<
AlarmTrackStujudgeDto
>
findAlarmBySnAndType
(
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
)
{
AlarmTrackStujudgeDto
alarmBySnAndType
=
stujudgeService
.
findAlarmBySnAndType
(
alarmTrackStujudgeDto
);
return
R
.
ok
().
data
(
alarmBySnAndType
);
}
@Override
@PostMapping
(
"insert"
)
@SysLog
(
module
=
MODULE
,
value
=
"插入警情数据"
,
action
=
OperateType
.
ADD
,
saveLog
=
false
)
@ApiOperation
(
value
=
"插入警情数据"
)
public
R
<
AlarmTrackStujudgeDto
>
insert
(
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
)
{
log
.
info
(
"insert alarmTrackStujudgeDto:"
+
JSONUtil
.
toJsonStr
(
alarmTrackStujudgeDto
));
Integer
num
=
stujudgeService
.
insert
(
alarmTrackStujudgeDto
);
return
R
.
ok
().
data
(
num
);
}
@Override
@PostMapping
(
"updateById"
)
@SysLog
(
module
=
MODULE
,
value
=
"更新警情数据"
,
action
=
OperateType
.
EDIT
,
saveLog
=
false
)
@ApiOperation
(
value
=
"更新警情数据"
)
public
R
<
AlarmTrackStujudgeDto
>
updateById
(
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
)
{
log
.
info
(
"update alarmTrackStujudgeDto:"
+
JSONUtil
.
toJsonStr
(
alarmTrackStujudgeDto
));
Integer
num
=
stujudgeService
.
updateById
(
alarmTrackStujudgeDto
);
return
R
.
ok
().
data
(
num
);
}
}
src/main/java/cn/com/glsx/stdinterface/modules/converter/StujudgeConverter.java
0 → 100644
View file @
fb85080
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
converter
;
import
cn.com.glsx.stdinterface.dto.AlarmTrackStujudgeDto
;
import
cn.com.glsx.stdinterface.modules.entity.AlarmTrackStujudge
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
/**
* 大数据研判实体类
*
* @author yangll
*/
@Mapper
public
interface
StujudgeConverter
{
StujudgeConverter
INSTANCE
=
Mappers
.
getMapper
(
StujudgeConverter
.
class
);
/**
* Dto 类转为 entity
*
* @param item dto
* @return
*/
AlarmTrackStujudge
syncDto2Entity
(
AlarmTrackStujudgeDto
item
);
/**
* entity 类转为 Dto
*
* @param item entity
* @return
*/
AlarmTrackStujudgeDto
syncEntity2Dto
(
AlarmTrackStujudge
item
);
}
src/main/java/cn/com/glsx/stdinterface/modules/entity/AlarmTrackRec.java
0 → 100644
View file @
fb85080
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
entity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
@Table
(
name
=
"t_alarm_track_rec"
)
public
class
AlarmTrackRec
implements
Serializable
{
@Id
private
Integer
id
;
/**
* SN唯一识别码
*/
private
String
sn
;
/**
* 预警时间
*/
@Column
(
name
=
"begin_time"
)
private
Date
beginTime
;
/**
* 经度
*/
private
String
lng
;
/**
* 纬度
*/
private
String
lat
;
/**
* 速度
*/
private
String
speed
;
/**
* 方向
*/
private
String
direction
;
/**
* 预警类型 0:按钮报警 1:断电报警 2:驶入围栏 3:驶出围栏 4:盗警 5:劫警 6:电池电压过低 7:超速报警 8:停车超时报警 9:GPS开路 10:GPS故障报警 11:碰撞报警 12:拔出报警(当前针对OBD设备) 99:光感报警
*/
@Column
(
name
=
"alarm_type"
)
private
Integer
alarmType
;
/**
* 预警城市
*/
@Column
(
name
=
"city_name"
)
private
String
cityName
;
/**
* 最后预警时间
*/
@Column
(
name
=
"last_time"
)
private
Date
lastTime
;
/**
* 最后经度
*/
@Column
(
name
=
"last_lng"
)
private
String
lastLng
;
/**
* 最后纬度
*/
@Column
(
name
=
"last_lat"
)
private
String
lastLat
;
/**
* 报警次数
*/
@Column
(
name
=
"alarm_no"
)
private
Integer
alarmNo
;
/**
* 车辆、设备关系id
*/
@Column
(
name
=
"vd_id"
)
private
Integer
vdId
;
/**
* 是否有效 0:有效 1:处理 2:失效 3:记录中
*/
@Column
(
name
=
"del_flag"
)
private
Byte
delFlag
;
/**
* 创建时间
*/
@Column
(
name
=
"created_date"
)
private
Date
createdDate
;
/**
* 创建人用户id
*/
@Column
(
name
=
"created_by"
)
private
Integer
createdBy
;
/**
* 更新时间
*/
@Column
(
name
=
"updated_date"
)
private
Date
updatedDate
;
/**
* 更新人用户id
*/
@Column
(
name
=
"updated_by"
)
private
Integer
updatedBy
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/entity/AlarmTrackStujudge.java
0 → 100644
View file @
fb85080
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
entity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
@Table
(
name
=
"t_alarm_track_stujudge"
)
public
class
AlarmTrackStujudge
implements
Serializable
{
@Id
private
Integer
id
;
/**
* 黑区或者异常聚集编号
*/
@Column
(
name
=
"geo_code"
)
private
String
geoCode
;
/**
* 设备号
*/
private
String
sn
;
/**
* 开始报警时间
*/
@Column
(
name
=
"begin_time"
)
private
Date
beginTime
;
/**
* 1.老黑区报警 2.异常聚集报警 3.新黑区报警
*/
@Column
(
name
=
"alarm_type"
)
private
Integer
alarmType
;
/**
* 报警位置
*/
@Column
(
name
=
"alarm_address"
)
private
String
alarmAddress
;
/**
* 最后预警时间
*/
@Column
(
name
=
"last_time"
)
private
Date
lastTime
;
/**
* 最后经度
*/
@Column
(
name
=
"last_lng"
)
private
String
lastLng
;
/**
* 最后纬度
*/
@Column
(
name
=
"last_lat"
)
private
String
lastLat
;
/**
* 报警次数
*/
@Column
(
name
=
"alarm_no"
)
private
Integer
alarmNo
;
/**
* 车辆、设备关系id
*/
@Column
(
name
=
"vd_id"
)
private
Integer
vdId
;
/**
* 是否删除 0=正常,未恢复 -1=删除,已恢复
*/
@Column
(
name
=
"del_flag"
)
private
Integer
delFlag
;
/**
* 创建时间
*/
@Column
(
name
=
"created_date"
)
private
Date
createdDate
;
/**
* 创建人用户id
*/
@Column
(
name
=
"created_by"
)
private
Integer
createdBy
;
/**
* 更新时间
*/
@Column
(
name
=
"updated_date"
)
private
Date
updatedDate
;
/**
* 更新人用户id
*/
@Column
(
name
=
"updated_by"
)
private
Integer
updatedBy
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/mapper/AlarmTrackRecMapper.java
0 → 100644
View file @
fb85080
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
mapper
;
import
cn.com.glsx.stdinterface.modules.entity.AlarmTrackRec
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
AlarmTrackRecMapper
extends
CommonBaseMapper
<
AlarmTrackRec
>
{
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/mapper/AlarmTrackStujudgeMapper.java
0 → 100644
View file @
fb85080
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
mapper
;
import
cn.com.glsx.stdinterface.dto.AlarmTrackStujudgeDto
;
import
cn.com.glsx.stdinterface.modules.entity.AlarmTrackStujudge
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
AlarmTrackStujudgeMapper
extends
CommonBaseMapper
<
AlarmTrackStujudge
>
{
/**
* 根据设备号和报警类型获取警情数据
*
* @param alarmTrackStujudgeDto
* @return
*/
AlarmTrackStujudge
findAlarmBySnAndType
(
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
);
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/service/StujudgeService.java
0 → 100644
View file @
fb85080
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
import
cn.com.glsx.stdinterface.dto.AlarmTrackStujudgeDto
;
import
cn.com.glsx.stdinterface.modules.converter.StujudgeConverter
;
import
cn.com.glsx.stdinterface.modules.entity.AlarmTrackStujudge
;
import
cn.com.glsx.stdinterface.modules.mapper.AlarmTrackStujudgeMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* 新e盾|大数据研判警情
*
* @author yangll
*/
@Slf4j
@Service
public
class
StujudgeService
{
@Autowired
private
AlarmTrackStujudgeMapper
alarmTrackStujudgeMapper
;
public
AlarmTrackStujudgeDto
findAlarmBySnAndType
(
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
)
{
AlarmTrackStujudge
alarmBySnAndType
=
alarmTrackStujudgeMapper
.
findAlarmBySnAndType
(
alarmTrackStujudgeDto
);
return
StujudgeConverter
.
INSTANCE
.
syncEntity2Dto
(
alarmBySnAndType
);
}
public
Integer
insert
(
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
)
{
AlarmTrackStujudge
alarmTrackStujudge
=
StujudgeConverter
.
INSTANCE
.
syncDto2Entity
(
alarmTrackStujudgeDto
);
Integer
num
=
alarmTrackStujudgeMapper
.
insert
(
alarmTrackStujudge
);
log
.
info
(
"增加的行数==="
+
num
);
return
num
;
}
public
Integer
updateById
(
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
)
{
AlarmTrackStujudge
alarmTrackStujudge
=
StujudgeConverter
.
INSTANCE
.
syncDto2Entity
(
alarmTrackStujudgeDto
);
Integer
num
=
alarmTrackStujudgeMapper
.
updateByPrimaryKeySelective
(
alarmTrackStujudge
);
log
.
info
(
"修改的行数==="
+
num
);
return
num
;
}
}
src/main/resources/config/generatorConfig.xml
View file @
fb85080
...
@@ -71,6 +71,8 @@
...
@@ -71,6 +71,8 @@
<!-- table可以有多个,每个数据库中的表都可以写一个table,tableName表示要匹配的数据库表,也可以在tableName属性中通过使用%通配符来匹配所有数据库表,只有匹配的表才会自动生成文件 enableSelectByPrimaryKey相应的配置表示是否生成相应的接口 -->
<!-- table可以有多个,每个数据库中的表都可以写一个table,tableName表示要匹配的数据库表,也可以在tableName属性中通过使用%通配符来匹配所有数据库表,只有匹配的表才会自动生成文件 enableSelectByPrimaryKey相应的配置表示是否生成相应的接口 -->
<!-- <table tableName="t_workorder_insurance" domainObjectName="WorkOrderInsurance" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!-- <table tableName="t_workorder_insurance" domainObjectName="WorkOrderInsurance" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!-- <table tableName="t_alarm_electric_fence" domainObjectName="AlarmElectricFence" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!-- <table tableName="t_alarm_electric_fence" domainObjectName="AlarmElectricFence" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<table
tableName=
"t_device"
domainObjectName=
"Device"
enableCountByExample=
"false"
enableUpdateByExample=
"false"
enableDeleteByExample=
"false"
enableSelectByExample=
"false"
selectByExampleQueryId=
"false"
/>
<!-- <table tableName="t_device" domainObjectName="Device" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<table
tableName=
"t_alarm_track_stujudge"
domainObjectName=
"AlarmTrackStujudge"
enableCountByExample=
"false"
enableUpdateByExample=
"false"
enableDeleteByExample=
"false"
enableSelectByExample=
"false"
selectByExampleQueryId=
"false"
/>
<table
tableName=
"t_alarm_track_rec"
domainObjectName=
"AlarmTrackRec"
enableCountByExample=
"false"
enableUpdateByExample=
"false"
enableDeleteByExample=
"false"
enableSelectByExample=
"false"
selectByExampleQueryId=
"false"
/>
</context>
</context>
</generatorConfiguration>
</generatorConfiguration>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/AlarmTrackRecMapper.xml
0 → 100644
View file @
fb85080
<?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=
"cn.com.glsx.stdinterface.modules.mapper.AlarmTrackRecMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.stdinterface.modules.entity.AlarmTrackRec"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"begin_time"
jdbcType=
"TIMESTAMP"
property=
"beginTime"
/>
<result
column=
"lng"
jdbcType=
"VARCHAR"
property=
"lng"
/>
<result
column=
"lat"
jdbcType=
"VARCHAR"
property=
"lat"
/>
<result
column=
"speed"
jdbcType=
"VARCHAR"
property=
"speed"
/>
<result
column=
"direction"
jdbcType=
"VARCHAR"
property=
"direction"
/>
<result
column=
"alarm_type"
jdbcType=
"INTEGER"
property=
"alarmType"
/>
<result
column=
"city_name"
jdbcType=
"VARCHAR"
property=
"cityName"
/>
<result
column=
"last_time"
jdbcType=
"TIMESTAMP"
property=
"lastTime"
/>
<result
column=
"last_lng"
jdbcType=
"VARCHAR"
property=
"lastLng"
/>
<result
column=
"last_lat"
jdbcType=
"VARCHAR"
property=
"lastLat"
/>
<result
column=
"alarm_no"
jdbcType=
"INTEGER"
property=
"alarmNo"
/>
<result
column=
"vd_id"
jdbcType=
"INTEGER"
property=
"vdId"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, sn, begin_time, lng, lat, speed, direction, alarm_type, city_name, last_time,
last_lng, last_lat, alarm_no, vd_id, del_flag, created_date, created_by, updated_date,
updated_by
</sql>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/AlarmTrackStujudgeMapper.xml
0 → 100644
View file @
fb85080
<?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=
"cn.com.glsx.stdinterface.modules.mapper.AlarmTrackStujudgeMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.stdinterface.modules.entity.AlarmTrackStujudge"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"geo_code"
jdbcType=
"VARCHAR"
property=
"geoCode"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"begin_time"
jdbcType=
"TIMESTAMP"
property=
"beginTime"
/>
<result
column=
"alarm_type"
jdbcType=
"INTEGER"
property=
"alarmType"
/>
<result
column=
"alarm_address"
jdbcType=
"VARCHAR"
property=
"alarmAddress"
/>
<result
column=
"last_time"
jdbcType=
"TIMESTAMP"
property=
"lastTime"
/>
<result
column=
"last_lng"
jdbcType=
"VARCHAR"
property=
"lastLng"
/>
<result
column=
"last_lat"
jdbcType=
"VARCHAR"
property=
"lastLat"
/>
<result
column=
"alarm_no"
jdbcType=
"INTEGER"
property=
"alarmNo"
/>
<result
column=
"vd_id"
jdbcType=
"INTEGER"
property=
"vdId"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, geo_code, sn, begin_time, alarm_type, alarm_address, last_time, last_lng, last_lat,
alarm_no, vd_id, del_flag, created_date, created_by, updated_date, updated_by
</sql>
<select
id=
"findAlarmBySnAndType"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_alarm_track_stujudge
where sn = #{sn}
and alarm_type = #{alarmType}
and geo_code = #{geoCode}
and del_flag = 2
order by id desc limit 1
</select>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/test/java/cn/com/glsx/stdinterface/modules/service/StujudgeServiceTest.java
0 → 100644
View file @
fb85080
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.stdinterface.dto.AlarmTrackStujudgeDto
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.jupiter.api.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
class
StujudgeServiceTest
{
@Autowired
private
StujudgeService
stujudgeService
;
@Test
void
findAlarmBySnAndType
()
{
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
=
new
AlarmTrackStujudgeDto
();
alarmTrackStujudgeDto
.
setSn
(
"1511025598"
);
alarmTrackStujudgeDto
.
setGeoCode
(
"GLb59c8882"
);
alarmTrackStujudgeDto
.
setAlarmType
(
2
);
AlarmTrackStujudgeDto
alarmBySnAndType
=
stujudgeService
.
findAlarmBySnAndType
(
alarmTrackStujudgeDto
);
System
.
out
.
println
(
"alarmBySnAndType = "
+
alarmBySnAndType
);
}
@Test
void
insert
()
{
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
=
new
AlarmTrackStujudgeDto
();
Integer
num
=
stujudgeService
.
insert
(
alarmTrackStujudgeDto
);
System
.
out
.
println
(
"insert = "
+
num
);
}
@Test
void
updateById
()
{
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
=
new
AlarmTrackStujudgeDto
();
Integer
num
=
stujudgeService
.
updateById
(
alarmTrackStujudgeDto
);
System
.
out
.
println
(
"insert = "
+
num
);
}
}
\ 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