Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intel_promotion_api
Project
Project
Details
Activity
Releases
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
liyilin
intel_promotion_api
Commits
a0d1708b
Commit
a0d1708b
authored
Jan 08, 2025
by
Yang hao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客流计数器相关代码
parent
e83aaf6f
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
2171 additions
and
0 deletions
+2171
-0
pom.xml
pom.xml
+6
-0
DevAlarmController.java
...soft/business/devalarm/controller/DevAlarmController.java
+125
-0
DevAlarmRepository.java
...org/rcisoft/business/devalarm/dao/DevAlarmRepository.java
+18
-0
DevAlarmEntity.java
.../org/rcisoft/business/devalarm/entity/DevAlarmEntity.java
+69
-0
DevAlarmService.java
...rg/rcisoft/business/devalarm/service/DevAlarmService.java
+62
-0
DevAlarmServiceImpl.java
...t/business/devalarm/service/impl/DevAlarmServiceImpl.java
+104
-0
DevFlowController.java
...cisoft/business/devflow/controller/DevFlowController.java
+162
-0
DevFlowRepository.java
...a/org/rcisoft/business/devflow/dao/DevFlowRepository.java
+25
-0
FlowSummaryDTO.java
...java/org/rcisoft/business/devflow/dto/FlowSummaryDTO.java
+24
-0
DevFlow.java
...ain/java/org/rcisoft/business/devflow/entity/DevFlow.java
+91
-0
DevFlowService.java
.../org/rcisoft/business/devflow/service/DevFlowService.java
+83
-0
DevFlowServiceImpl.java
...oft/business/devflow/service/impl/DevFlowServiceImpl.java
+148
-0
DevInfoController.java
...cisoft/business/devinfo/controller/DevInfoController.java
+136
-0
DevInfoRepository.java
...a/org/rcisoft/business/devinfo/dao/DevInfoRepository.java
+15
-0
DevSetting.java
.../java/org/rcisoft/business/devinfo/entity/DevSetting.java
+125
-0
DevInfoService.java
.../org/rcisoft/business/devinfo/service/DevInfoService.java
+67
-0
DevInfoServiceImpl.java
...oft/business/devinfo/service/impl/DevInfoServiceImpl.java
+109
-0
IdtkController.java
...cisoft/business/idtkconfig/controller/IdtkController.java
+360
-0
TIdtkConfigRepository.java
...cisoft/business/idtkconfig/dao/TIdtkConfigRepository.java
+11
-0
TIdtkConfigEntity.java
...rcisoft/business/idtkconfig/entity/TIdtkConfigEntity.java
+39
-0
TIdtkConfigService.java
...isoft/business/idtkconfig/service/TIdtkConfigService.java
+9
-0
IdtkConfigServiceImpl.java
...siness/idtkconfig/service/impl/IdtkConfigServiceImpl.java
+26
-0
Crc16.java
src/main/java/org/rcisoft/core/util/Crc16.java
+82
-0
DevAlarmMapper.xml
...ources/mapper/business/devalarm/mapper/DevAlarmMapper.xml
+63
-0
DevFlowMapper.xml
...esources/mapper/business/devflow/mapper/DevFlowMapper.xml
+80
-0
DevInfoMapper.xml
...esources/mapper/business/devinfo.mapper/DevInfoMapper.xml
+123
-0
IdtkConfigMapper.xml
...es/mapper/business/idtkconfig/mapper/IdtkConfigMapper.xml
+9
-0
No files found.
pom.xml
View file @
a0d1708b
...
@@ -39,6 +39,12 @@
...
@@ -39,6 +39,12 @@
<dependencies>
<dependencies>
<!-- Spring Data JPA 依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
...
...
src/main/java/org/rcisoft/business/devalarm/controller/DevAlarmController.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devalarm
.
controller
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.devalarm.entity.DevAlarmEntity
;
import
org.rcisoft.business.devalarm.service.DevAlarmService
;
import
org.rcisoft.core.anno.CyOpeLogAnno
;
import
org.rcisoft.core.constant.CyMessCons
;
import
org.rcisoft.core.controller.CyPaginationController
;
import
org.rcisoft.core.model.CyGridModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.operlog.enums.CyLogTypeEnum
;
import
org.rcisoft.core.result.CyResult
;
import
org.rcisoft.core.util.CyEpExcelUtil
;
import
org.rcisoft.core.util.CyResultGenUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/devalarm"
)
public
class
DevAlarmController
extends
CyPaginationController
<
DevAlarmEntity
>
{
@Autowired
private
DevAlarmService
devAlarmServiceImpl
;
//@PreAuthorize("@cyPerm.hasPerm('sys:devAlarmEntity:add')")
@CyOpeLogAnno
(
title
=
"system-设备状态信息-新增设备状态表"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@ApiOperation
(
value
=
"添加设备状态表"
,
notes
=
"添加设备状态表"
)
@PostMapping
(
value
=
"/add"
)
public
CyResult
add
(
@Valid
DevAlarmEntity
devAlarmEntity
,
BindingResult
bindingResult
)
{
CyPersistModel
data
=
devAlarmServiceImpl
.
persist
(
devAlarmEntity
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devAlarmEntity
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devAlarmEntity:delete')")
@CyOpeLogAnno
(
title
=
"system-设备管理-删除设备状态"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@ApiOperation
(
value
=
"逻辑删除设备状态"
,
notes
=
"逻辑删除设备状态"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/deleteLogical/{businessId:\\w+}"
)
public
CyResult
deleteLogical
(
@PathVariable
Integer
businessId
,
DevAlarmEntity
devAlarmEntity
)
{
devAlarmEntity
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
devAlarmServiceImpl
.
removeLogical
(
devAlarmEntity
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devAlarmEntity:update')")
@CyOpeLogAnno
(
title
=
"system-设备管理-修改设备状态"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"修改设备状态"
,
notes
=
"修改设备状态"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/update/{businessId:\\w+}"
)
public
CyResult
update
(
@PathVariable
Integer
businessId
,
@Valid
DevAlarmEntity
devAlarmEntity
,
BindingResult
bindingResult
)
{
devAlarmEntity
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
devAlarmServiceImpl
.
merge
(
devAlarmEntity
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devAlarmEntity
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devAlarmEntity:list')")
@CyOpeLogAnno
(
title
=
"system-设备管理-分页查询设备状态"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"分页查询设备状态"
,
notes
=
"分页查询设备状态"
)
@GetMapping
(
value
=
"/list"
)
public
CyGridModel
listByPagination
(
DevAlarmEntity
devAlarmEntity
)
{
devAlarmServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
devAlarmEntity
);
return
getGridModelResponse
();
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devAlarmEntity:list')")
@CyOpeLogAnno
(
title
=
"system-设备管理-查询设备状态"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询设备状态"
,
notes
=
"查询设备状态集合"
)
@GetMapping
(
value
=
"/listAll"
)
public
CyResult
listAll
(
DevAlarmEntity
devAlarmEntity
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devAlarmServiceImpl
.
findAll
(
devAlarmEntity
));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devFlow:query')")
@CyOpeLogAnno
(
title
=
"system-设备管理-查询设备状态"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询单一设备状态"
,
notes
=
"查询单一设备状态"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@GetMapping
(
"/detail/{businessId:\\w+}"
)
public
CyResult
detail
(
@PathVariable
String
businessId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devAlarmServiceImpl
.
findById
(
businessId
));
}
@CyOpeLogAnno
(
title
=
"system-设备管理-查询设备状态"
,
businessType
=
CyLogTypeEnum
.
EXPORT
)
@ApiOperation
(
value
=
"导出设备状态信息"
,
notes
=
"导出设备状态信息"
)
@GetMapping
(
value
=
"/export"
)
public
void
outDevCache
(
HttpServletResponse
response
,
DevAlarmEntity
devAlarmEntity
,
@PathVariable
@RequestParam
(
defaultValue
=
"0"
)
String
excelId
)
{
String
excelName
=
""
;
switch
(
excelId
)
{
case
"0"
:
excelName
=
"设备状态信息.xls"
;
break
;
case
"1"
:
excelName
=
"设备状态信息.xlsx"
;
break
;
case
"2"
:
excelName
=
"设备状态信息.csv"
;
break
;
}
List
<
DevAlarmEntity
>
devAlarmEntityList
=
devAlarmServiceImpl
.
export
(
devAlarmEntity
);
CyEpExcelUtil
.
exportExcel
(
devAlarmEntityList
,
"设备状态信息"
,
"设备状态信息"
,
DevAlarmEntity
.
class
,
excelName
,
response
);
}
}
src/main/java/org/rcisoft/business/devalarm/dao/DevAlarmRepository.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devalarm
.
dao
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.devalarm.entity.DevAlarmEntity
;
import
org.rcisoft.core.mapper.CyBaseMapper
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.List
;
public
interface
DevAlarmRepository
extends
CyBaseMapper
<
DevAlarmEntity
>
{
List
<
DevAlarmEntity
>
queryDevAlarm
(
@Param
(
"entity"
)
DevAlarmEntity
devAlarmEntity
);
IPage
<
DevAlarmEntity
>
queryDevAlarmPaged
(
CyPageInfo
<
DevAlarmEntity
>
paginationUtility
,
@Param
(
"entity"
)
DevAlarmEntity
devAlarmEntity
);
}
src/main/java/org/rcisoft/business/devalarm/entity/DevAlarmEntity.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devalarm
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
org.rcisoft.core.entity.CyIdIncreEntity
;
@Data
@TableName
(
"dev_alarm"
)
public
class
DevAlarmEntity
extends
CyIdIncreEntity
<
DevAlarmEntity
>
{
/**
* 与 cmd=cache 一起上传的 flag,用于区分不同指令时间
* 数据库字段:flag
*/
@Excel
(
name
=
"Flag"
,
orderNum
=
"1"
,
width
=
20
)
private
String
flag
;
/**
* 本次上传包含的 data 记录数量
* 数据库字段:count
*/
@Excel
(
name
=
"记录数量"
,
orderNum
=
"2"
,
width
=
15
)
private
Integer
count
;
/**
* 原始的 status=xxx 字段值,便于调试或溯源
* 数据库字段:status_raw
*/
@Excel
(
name
=
"原始状态值"
,
orderNum
=
"3"
,
width
=
30
)
private
String
statusRaw
;
/**
* 设备固件版本号(如 1.1)
* 数据库字段:version
*/
@Excel
(
name
=
"设备版本号"
,
orderNum
=
"4"
,
width
=
10
)
private
String
version
;
/**
* 解析得到的设备 SN(如 5251AE42)
* 数据库字段:device_sn
*/
@Excel
(
name
=
"设备SN"
,
orderNum
=
"5"
,
width
=
20
)
private
String
deviceSn
;
/**
* 红外发射器剩余电量百分比 (0~100)
* 数据库字段:ir_battery
*/
@Excel
(
name
=
"红外电量(%)"
,
orderNum
=
"6"
,
width
=
15
)
private
Integer
irBattery
;
/**
* 计数器剩余电量百分比 (0~100)
* 数据库字段:main_battery
*/
@Excel
(
name
=
"计数器电量(%)"
,
orderNum
=
"7"
,
width
=
15
)
private
Integer
mainBattery
;
/**
* 是否失焦
* 0:正常
* 1:失焦
* 数据库字段:is_focus_lost
*/
@Excel
(
name
=
"失焦状态"
,
orderNum
=
"8"
,
replace
=
{
"正常_0"
,
"失焦_1"
},
width
=
10
)
private
String
isFocusLost
;
}
src/main/java/org/rcisoft/business/devalarm/service/DevAlarmService.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devalarm
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.rcisoft.business.devalarm.entity.DevAlarmEntity
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
java.util.List
;
public
interface
DevAlarmService
{
/**
* 查询 状态表
* @param devAlarmEntity
* @return
*/
List
<
DevAlarmEntity
>
findAll
(
DevAlarmEntity
devAlarmEntity
);
/**
* 保存 状态表
* @param devAlarmEntity
* @return
*/
CyPersistModel
persist
(
DevAlarmEntity
devAlarmEntity
);
/**
* 逻辑删除 状态表
* @param devAlarmEntity
* @return
*/
CyPersistModel
removeLogical
(
DevAlarmEntity
devAlarmEntity
);
/**
* 修改 状态表
* @param devAlarmEntity
* @return
*/
CyPersistModel
merge
(
DevAlarmEntity
devAlarmEntity
);
/**
* 根据id查询 状态表
* @param businessId
* @return
*/
Object
findById
(
String
businessId
);
/**
* 分页查询 状态表
* @param paginationUtility
* @param devAlarmEntity
* @return
*/
IPage
<
DevAlarmEntity
>
findAllByPagination
(
CyPageInfo
<
DevAlarmEntity
>
paginationUtility
,
DevAlarmEntity
devAlarmEntity
);
/**
* 导出状态表
* @param devAlarmEntity
* @return
*/
List
<
DevAlarmEntity
>
export
(
DevAlarmEntity
devAlarmEntity
);
}
src/main/java/org/rcisoft/business/devalarm/service/impl/DevAlarmServiceImpl.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devalarm
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.devalarm.dao.DevAlarmRepository
;
import
org.rcisoft.business.devalarm.entity.DevAlarmEntity
;
import
org.rcisoft.business.devalarm.service.DevAlarmService
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
public
class
DevAlarmServiceImpl
extends
ServiceImpl
<
DevAlarmRepository
,
DevAlarmEntity
>
implements
DevAlarmService
{
/**
* 查询 状态表
* @param devAlarmEntity
* @return
*/
@Override
public
List
<
DevAlarmEntity
>
findAll
(
DevAlarmEntity
devAlarmEntity
)
{
return
baseMapper
.
queryDevAlarm
(
devAlarmEntity
);
}
/**
* 保存 状态表
* @param devAlarmEntity
* @return
*/
@Override
public
CyPersistModel
persist
(
DevAlarmEntity
devAlarmEntity
)
{
//增加操作
int
line
=
baseMapper
.
insert
(
devAlarmEntity
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
devAlarmEntity
.
getBusinessId
()
+
"的状态表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 逻辑删除 状态表
* @param devAlarmEntity
* @return
*/
@Override
public
CyPersistModel
removeLogical
(
DevAlarmEntity
devAlarmEntity
)
{
devAlarmEntity
.
setDeleted
();
int
line
=
baseMapper
.
deleteById
(
devAlarmEntity
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"逻辑删除了ID为"
+
devAlarmEntity
.
getBusinessId
()
+
"的状态表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 修改 状态表
* @param devAlarmEntity
* @return
*/
@Override
public
CyPersistModel
merge
(
DevAlarmEntity
devAlarmEntity
)
{
int
line
=
baseMapper
.
updateById
(
devAlarmEntity
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
devAlarmEntity
.
getBusinessId
()
+
"的状态表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 根据id查询 状态表
* @param businessId
* @return
*/
@Override
public
Object
findById
(
String
businessId
)
{
return
baseMapper
.
selectById
(
businessId
);
}
/**
* 分页查询 状态表
* @param paginationUtility
* @param devAlarmEntity
* @return
*/
@Override
public
IPage
<
DevAlarmEntity
>
findAllByPagination
(
CyPageInfo
<
DevAlarmEntity
>
paginationUtility
,
DevAlarmEntity
devAlarmEntity
)
{
return
baseMapper
.
queryDevAlarmPaged
(
paginationUtility
,
devAlarmEntity
);
}
/**
* 导出状态表
* @param devAlarmEntity
* @return
*/
@Override
public
List
<
DevAlarmEntity
>
export
(
DevAlarmEntity
devAlarmEntity
)
{
List
<
DevAlarmEntity
>
devAlarmEntityList
=
baseMapper
.
queryDevAlarm
(
devAlarmEntity
);
return
devAlarmEntityList
;
}
}
src/main/java/org/rcisoft/business/devflow/controller/DevFlowController.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devflow
.
controller
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.devflow.dto.FlowSummaryDTO
;
import
org.rcisoft.business.devflow.entity.DevFlow
;
import
org.rcisoft.business.devflow.service.DevFlowService
;
import
org.rcisoft.business.devinfo.entity.DevSetting
;
import
org.rcisoft.business.sysunit.entity.SysUnit
;
import
org.rcisoft.core.anno.CyOpeLogAnno
;
import
org.rcisoft.core.constant.CyMessCons
;
import
org.rcisoft.core.controller.CyPaginationController
;
import
org.rcisoft.core.model.CyGridModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.operlog.enums.CyLogTypeEnum
;
import
org.rcisoft.core.result.CyResult
;
import
org.rcisoft.core.util.CyEpExcelUtil
;
import
org.rcisoft.core.util.CyResultGenUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
java.time.LocalDate
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/devflow"
)
public
class
DevFlowController
extends
CyPaginationController
<
DevFlow
>
{
@Autowired
private
DevFlowService
devFlowServiceImpl
;
//@PreAuthorize("@cyPerm.hasPerm('sys:devFlow:add')")
@CyOpeLogAnno
(
title
=
"system-客流信息-新增客流表"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@ApiOperation
(
value
=
"添加客流表"
,
notes
=
"添加客流表"
)
@PostMapping
(
value
=
"/add"
)
public
CyResult
add
(
@Valid
DevFlow
devFlow
,
BindingResult
bindingResult
)
{
CyPersistModel
data
=
devFlowServiceImpl
.
persist
(
devFlow
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devFlow
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devFlow:delete')")
@CyOpeLogAnno
(
title
=
"system-设备管理-删除客流表"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@ApiOperation
(
value
=
"逻辑删除客流表"
,
notes
=
"逻辑删除客流表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/deleteLogical/{businessId:\\w+}"
)
public
CyResult
deleteLogical
(
@PathVariable
Integer
businessId
,
DevFlow
devFlow
)
{
devFlow
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
devFlowServiceImpl
.
removeLogical
(
devFlow
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devFlow:update')")
@CyOpeLogAnno
(
title
=
"system-设备管理-修改客流表"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"修改客流表"
,
notes
=
"修改客流表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/update/{businessId:\\w+}"
)
public
CyResult
update
(
@PathVariable
Integer
businessId
,
@Valid
DevFlow
devFlow
,
BindingResult
bindingResult
)
{
devFlow
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
devFlowServiceImpl
.
merge
(
devFlow
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devFlow
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devFlow:list')")
@CyOpeLogAnno
(
title
=
"system-设备管理-分页查询客流表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"分页查询客流表集合"
,
notes
=
"分页查询客流表集合"
)
@GetMapping
(
value
=
"/list"
)
public
CyGridModel
listByPagination
(
DevFlow
devFlow
)
{
devFlowServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
devFlow
);
return
getGridModelResponse
();
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devFlow:list')")
@CyOpeLogAnno
(
title
=
"system-设备管理-查询客流表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询客流表"
,
notes
=
"查询客流表集合"
)
@GetMapping
(
value
=
"/listAll"
)
public
CyResult
listAll
(
DevFlow
devFlow
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devFlowServiceImpl
.
findAll
(
devFlow
));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devFlow:query')")
@CyOpeLogAnno
(
title
=
"system-设备管理-查询客流表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询单一客流表"
,
notes
=
"查询单一客流表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@GetMapping
(
"/detail/{businessId:\\w+}"
)
public
CyResult
detail
(
@PathVariable
String
businessId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devFlowServiceImpl
.
findById
(
businessId
));
}
@CyOpeLogAnno
(
title
=
"system-设备管理-查询客流表"
,
businessType
=
CyLogTypeEnum
.
EXPORT
)
@ApiOperation
(
value
=
"导出客流表信息"
,
notes
=
"导出客流表信息"
)
@GetMapping
(
value
=
"/export"
)
public
void
outDevCache
(
HttpServletResponse
response
,
DevFlow
devFlow
,
@PathVariable
@RequestParam
(
defaultValue
=
"0"
)
String
excelId
)
{
String
excelName
=
""
;
switch
(
excelId
)
{
case
"0"
:
excelName
=
"客流表信息.xls"
;
break
;
case
"1"
:
excelName
=
"客流表信息.xlsx"
;
break
;
case
"2"
:
excelName
=
"客流表信息.csv"
;
break
;
}
List
<
DevFlow
>
devFlowList
=
devFlowServiceImpl
.
export
(
devFlow
);
CyEpExcelUtil
.
exportExcel
(
devFlowList
,
"客流表信息"
,
"客流表信息"
,
DevFlow
.
class
,
excelName
,
response
);
}
/**
* 统计客流数据
*
* @param devFlow
* @return
*
*/
@ApiOperation
(
value
=
"累计客流数据统计"
,
notes
=
"累计客流数据统计"
)
@GetMapping
(
value
=
"/statistics"
)
public
CyResult
statistics
(
DevFlow
devFlow
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devFlowServiceImpl
.
statistics
(
devFlow
));
}
/**
* 统计当日客流数据
*
* @param devFlow
* @return
*
*/
@ApiOperation
(
value
=
"当日客流数据统计"
,
notes
=
"当日客流数据统计"
)
@GetMapping
(
value
=
"/statisticsCur"
)
public
CyResult
statisticsCur
(
DevFlow
devFlow
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devFlowServiceImpl
.
statisticsCur
(
devFlow
));
}
}
src/main/java/org/rcisoft/business/devflow/dao/DevFlowRepository.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devflow
.
dao
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.devflow.dto.FlowSummaryDTO
;
import
org.rcisoft.business.devflow.entity.DevFlow
;
import
org.rcisoft.business.devinfo.entity.DevSetting
;
import
org.rcisoft.business.sysunit.entity.SysUnit
;
import
org.rcisoft.core.mapper.CyBaseMapper
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.List
;
public
interface
DevFlowRepository
extends
CyBaseMapper
<
DevFlow
>
{
List
<
DevFlow
>
queryDevFlow
(
@Param
(
"entity"
)
DevFlow
devFlow
);
IPage
<
DevFlow
>
queryDevFlowPaged
(
CyPageInfo
<
DevFlow
>
paginationUtility
,
@Param
(
"entity"
)
DevFlow
devFlow
);
DevFlow
statistics
(
@Param
(
"entity"
)
DevFlow
devFlow
);
DevFlow
statisticsCur
(
@Param
(
"entity"
)
DevFlow
devFlow
);
}
src/main/java/org/rcisoft/business/devflow/dto/FlowSummaryDTO.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devflow
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @desc 某天进出人数总和 DTO
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
FlowSummaryDTO
{
/**
* 当天进人数总和
*/
private
Integer
totalInCount
;
/**
* 当天出人数总和
*/
private
Integer
totalOutCount
;
}
src/main/java/org/rcisoft/business/devflow/entity/DevFlow.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devflow
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
org.rcisoft.core.entity.CyIdIncreEntity
;
import
java.beans.Transient
;
import
java.util.Date
;
@Data
@TableName
(
"dev_flow"
)
public
class
DevFlow
extends
CyIdIncreEntity
<
DevFlow
>
{
/**
* 数据时间
* @desc 数据时间
* @column data_time
*/
@Excel
(
name
=
"数据时间"
,
orderNum
=
"1"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
dataTime
;
/**
* 序列号
* @column device_sn
*
* */
private
String
deviceSn
;
/**
* 进增量 (dxIN)
* @desc 进增量
* @column in_count
*/
@Excel
(
name
=
"进增量 (dxIN)"
,
orderNum
=
"2"
,
width
=
20
)
private
String
inCount
;
/**
* 出增量 (dxOUT)
* @desc 出增量
* @column out_count
*/
@Excel
(
name
=
"出增量 (dxOUT)"
,
orderNum
=
"3"
,
width
=
20
)
private
String
outCount
;
/**
* 外键,关联 dev_alarm 表的主键 id
*/
@Excel
(
name
=
"上传 ID"
,
orderNum
=
"5"
,
width
=
20
)
private
Integer
uploadId
;
/**
* 当天进人数总和
*/
@TableField
(
exist
=
false
)
private
Integer
inCountSum
;
/**
* 当天出人数总和
*/
@TableField
(
exist
=
false
)
private
Integer
outCountSum
;
/**
* 当天进人数总和
*/
@TableField
(
exist
=
false
)
private
Integer
inCountSumCur
;
/**
* 当天出人数总和
*/
@TableField
(
exist
=
false
)
private
Integer
outCountSumCur
;
/**
* 开始时间
* */
@TableField
(
exist
=
false
)
private
String
beginTime
;
/**
* 结束时间
* */
@TableField
(
exist
=
false
)
private
String
endTime
;
}
src/main/java/org/rcisoft/business/devflow/service/DevFlowService.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devflow
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.rcisoft.business.devflow.dto.FlowSummaryDTO
;
import
org.rcisoft.business.devflow.entity.DevFlow
;
import
org.rcisoft.business.devinfo.entity.DevSetting
;
import
org.rcisoft.business.sysunit.entity.SysUnit
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
javax.validation.Valid
;
import
java.util.List
;
public
interface
DevFlowService
{
/**
* 查询 客流表
* @param devFlow
* @return
*/
List
<
DevFlow
>
findAll
(
DevFlow
devFlow
);
/**
* 保存 客流表
* @param devFlow
* @return
*/
CyPersistModel
persist
(
DevFlow
devFlow
);
/**
* 逻辑删除 客流表
* @param devFlow
* @return
*/
CyPersistModel
removeLogical
(
DevFlow
devFlow
);
/**
* 修改 客流表
* @param devFlow
* @return
*/
CyPersistModel
merge
(
DevFlow
devFlow
);
/**
* 根据id查询 客流表
* @param businessId
* @return
*/
Object
findById
(
String
businessId
);
/**
* 分页查询 客流表
* @param paginationUtility
* @param devFlow
* @return
*/
IPage
<
DevFlow
>
findAllByPagination
(
CyPageInfo
<
DevFlow
>
paginationUtility
,
DevFlow
devFlow
);
/**
* 导出客流表
* @param devFlow
* @return
*/
List
<
DevFlow
>
export
(
DevFlow
devFlow
);
/**
* 统累计客流数据
*
* @param devFlow
*/
DevFlow
statistics
(
DevFlow
devFlow
);
/**
* 当日流数据
*
* @param devFlow
*/
DevFlow
statisticsCur
(
DevFlow
devFlow
);
int
persistBatch
(
List
<
DevFlow
>
devFlow
);
}
src/main/java/org/rcisoft/business/devflow/service/impl/DevFlowServiceImpl.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devflow
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.devflow.dao.DevFlowRepository
;
import
org.rcisoft.business.devflow.dto.FlowSummaryDTO
;
import
org.rcisoft.business.devflow.entity.DevFlow
;
import
org.rcisoft.business.devflow.service.DevFlowService
;
import
org.rcisoft.business.devinfo.dao.DevInfoRepository
;
import
org.rcisoft.business.devinfo.entity.DevSetting
;
import
org.rcisoft.business.devinfo.service.DevInfoService
;
import
org.rcisoft.business.sysunit.entity.SysUnit
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
public
class
DevFlowServiceImpl
extends
ServiceImpl
<
DevFlowRepository
,
DevFlow
>
implements
DevFlowService
{
/**
* 查询 客流表
* @param devFlow
* @return
*/
@Override
public
List
<
DevFlow
>
findAll
(
DevFlow
devFlow
)
{
return
baseMapper
.
queryDevFlow
(
devFlow
);
}
/**
* 保存 客流表
* @param devFlow
* @return
*/
@Override
public
CyPersistModel
persist
(
DevFlow
devFlow
)
{
//增加操作
int
line
=
baseMapper
.
insert
(
devFlow
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
devFlow
.
getBusinessId
()
+
"的客流表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 逻辑删除 客流表
* @param devFlow
* @return
*/
@Override
public
CyPersistModel
removeLogical
(
DevFlow
devFlow
)
{
devFlow
.
setDeleted
();
int
line
=
baseMapper
.
deleteById
(
devFlow
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"逻辑删除了ID为"
+
devFlow
.
getBusinessId
()
+
"的客流表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 修改 客流表
* @param devFlow
* @return
*/
@Override
public
CyPersistModel
merge
(
DevFlow
devFlow
)
{
int
line
=
baseMapper
.
updateById
(
devFlow
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
devFlow
.
getBusinessId
()
+
"的客流表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 根据id查询 客流表
* @param businessId
* @return
*/
@Override
public
Object
findById
(
String
businessId
)
{
return
baseMapper
.
selectById
(
businessId
);
}
/**
* 分页查询 客流表
* @param paginationUtility
* @param devFlow
* @return
*/
@Override
public
IPage
<
DevFlow
>
findAllByPagination
(
CyPageInfo
<
DevFlow
>
paginationUtility
,
DevFlow
devFlow
)
{
return
baseMapper
.
queryDevFlowPaged
(
paginationUtility
,
devFlow
);
}
/**
* 导出客流表
* @param devFlow
* @return
*/
@Override
public
List
<
DevFlow
>
export
(
DevFlow
devFlow
)
{
List
<
DevFlow
>
devFlowList
=
baseMapper
.
queryDevFlow
(
devFlow
);
return
devFlowList
;
}
/**
* 统计客流数据
*
* @param devFlow
* @return
*
*/
@Override
public
DevFlow
statistics
(
DevFlow
devFlow
)
{
//通过商家id查询出当前商家的数据统计
return
baseMapper
.
statistics
(
devFlow
);
}
/**
* 统计当日客流数据
*
* @param devFlow
* @return
*
*/
@Override
public
DevFlow
statisticsCur
(
DevFlow
devFlow
)
{
//通过商家id查询出当前商家的数据统计
return
baseMapper
.
statisticsCur
(
devFlow
);
}
@Override
public
int
persistBatch
(
List
<
DevFlow
>
devFlows
)
{
int
count
=
0
;
for
(
DevFlow
devFlow
:
devFlows
)
{
// 逐条插入数据
baseMapper
.
insert
(
devFlow
);
count
++;
}
return
count
;
}
}
src/main/java/org/rcisoft/business/devinfo/controller/DevInfoController.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devinfo
.
controller
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.cmsbanner.entity.CmsBanner
;
import
org.rcisoft.business.cmstask.entity.CmsTask
;
import
org.rcisoft.business.devinfo.entity.DevSetting
;
import
org.rcisoft.business.devinfo.service.DevInfoService
;
import
org.rcisoft.core.anno.CyOpeLogAnno
;
import
org.rcisoft.core.constant.CyMessCons
;
import
org.rcisoft.core.controller.CyPaginationController
;
import
org.rcisoft.core.model.CyGridModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.operlog.enums.CyLogTypeEnum
;
import
org.rcisoft.core.result.CyResult
;
import
org.rcisoft.core.util.CyEpExcelUtil
;
import
org.rcisoft.core.util.CyResultGenUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/devinfo"
)
public
class
DevInfoController
extends
CyPaginationController
<
DevSetting
>
{
@Autowired
private
DevInfoService
devInfoServiceImpl
;
//@PreAuthorize("@cyPerm.hasPerm('sys:devInfo:add')")
@CyOpeLogAnno
(
title
=
"system-设备管理-新增设备信息表"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@ApiOperation
(
value
=
"添加设备信息表"
,
notes
=
"添加设备信息表"
)
@PostMapping
(
value
=
"/add"
)
public
CyResult
add
(
@Valid
DevSetting
devSetting
,
BindingResult
bindingResult
)
{
CyPersistModel
data
=
devInfoServiceImpl
.
persist
(
devSetting
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devSetting
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devInfo:delete')")
@CyOpeLogAnno
(
title
=
"system-设备管理-删除设备信息表"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@ApiOperation
(
value
=
"逻辑删除设备信息表"
,
notes
=
"逻辑删除设备信息表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/deleteLogical/{businessId:\\w+}"
)
public
CyResult
deleteLogical
(
@PathVariable
Integer
businessId
,
DevSetting
devSetting
)
{
devSetting
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
devInfoServiceImpl
.
removeLogical
(
devSetting
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devInfo:update')")
@CyOpeLogAnno
(
title
=
"system-设备管理-修改设备信息表"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"修改设备信息表"
,
notes
=
"修改设备信息表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/update/{businessId:\\w+}"
)
public
CyResult
update
(
@PathVariable
Integer
businessId
,
@Valid
DevSetting
devSetting
,
BindingResult
bindingResult
)
{
devSetting
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
devInfoServiceImpl
.
merge
(
devSetting
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devSetting
);
}
// /**
// * 根据id修改当前的设备信息
// */
// @ApiOperation(value = "根据id修改当前的设备信息", notes = "根据id修改当前的ba设备信息")
// @PutMapping(value = "/updateDev")
// public CyResult updateDevById(@Valid DevSetting devSetting) {
// return CyResultGenUtil.builder(devInfoServiceImpl.merge(devSetting),
// CyMessCons.MESSAGE_ALERT_SUCCESS,
// CyMessCons.MESSAGE_ALERT_ERROR,
// devSetting);
// }
//@PreAuthorize("@cyPerm.hasPerm('sys:devInfo:list')")
@CyOpeLogAnno
(
title
=
"system-设备管理-分页查询设备信息表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"分页查询设备信息表集合"
,
notes
=
"分页查询设备信息表集合"
)
@GetMapping
(
value
=
"/list"
)
public
CyGridModel
listByPagination
(
DevSetting
devSetting
)
{
devInfoServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
devSetting
);
return
getGridModelResponse
();
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devInfo:list')")
@CyOpeLogAnno
(
title
=
"system-设备管理-查询设备信息表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询设备信息表"
,
notes
=
"查询设备信息表集合"
)
@GetMapping
(
value
=
"/listAll"
)
public
CyResult
listAll
(
DevSetting
devSetting
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devInfoServiceImpl
.
findAll
(
devSetting
));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:devInfo:query')")
@CyOpeLogAnno
(
title
=
"system-设备管理-查询设备信息表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询单一设备信息表"
,
notes
=
"查询单一设备信息表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@GetMapping
(
"/detail/{businessId:\\w+}"
)
public
CyResult
detail
(
@PathVariable
String
businessId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
devInfoServiceImpl
.
findById
(
businessId
));
}
@CyOpeLogAnno
(
title
=
"system-设备管理-查询设备信息表"
,
businessType
=
CyLogTypeEnum
.
EXPORT
)
@ApiOperation
(
value
=
"导出设备信息表信息"
,
notes
=
"导出设备信息表信息"
)
@GetMapping
(
value
=
"/export"
)
public
void
outDevInfo
(
HttpServletResponse
response
,
DevSetting
devSetting
,
@PathVariable
@RequestParam
(
defaultValue
=
"0"
)
String
excelId
)
{
String
excelName
=
""
;
switch
(
excelId
)
{
case
"0"
:
excelName
=
"设备信息表信息.xls"
;
break
;
case
"1"
:
excelName
=
"设备信息表信息.xlsx"
;
break
;
case
"2"
:
excelName
=
"设备信息表信息.csv"
;
break
;
}
List
<
DevSetting
>
devInfoList
=
devInfoServiceImpl
.
export
(
devSetting
);
CyEpExcelUtil
.
exportExcel
(
devInfoList
,
"任务表信息"
,
"任务表信息"
,
CmsTask
.
class
,
excelName
,
response
);
}
}
src/main/java/org/rcisoft/business/devinfo/dao/DevInfoRepository.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devinfo
.
dao
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.devinfo.entity.DevSetting
;
import
org.rcisoft.core.mapper.CyBaseMapper
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.List
;
public
interface
DevInfoRepository
extends
CyBaseMapper
<
DevSetting
>
{
List
<
DevSetting
>
queryDevInfo
(
@Param
(
"entity"
)
DevSetting
devSetting
);
IPage
<
DevSetting
>
queryDevInfoPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
DevSetting
devSetting
);
}
src/main/java/org/rcisoft/business/devinfo/entity/DevSetting.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devinfo
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
org.rcisoft.core.entity.CyIdIncreEntity
;
import
org.rcisoft.core.entity.CyIdIncreNotDataEntity
;
import
java.util.Date
;
@Data
@TableName
(
"dev_setting"
)
public
class
DevSetting
extends
CyIdIncreEntity
<
DevSetting
>
{
/**
* @desc
* @column device_sn
* @default
*/
@Excel
(
name
=
"设备序列号"
,
orderNum
=
"1"
,
width
=
20
)
private
String
deviceSn
;
/**
* @desc
* @column sn
* @default
*/
@Excel
(
name
=
"反转序列号"
,
orderNum
=
"1"
,
width
=
20
)
private
String
sn
;
/**
* @desc 请求命令类型
* @column cmd_type
* @default '3'
*/
@Excel
(
name
=
"请求命令类型"
,
orderNum
=
"2"
,
width
=
20
)
private
String
cmdType
;
/**
* @desc 探测速度
* @column detect_speed
* @default '0'
*/
@Excel
(
name
=
"探测速度"
,
orderNum
=
"3"
,
width
=
20
,
replace
=
{
"低速_0"
,
"高速_1"
})
private
String
detectSpeed
;
/**
* @desc 记录周期(分钟)
* @column record_period_min
* @default 4
*/
@Excel
(
name
=
"记录周期(分钟)"
,
orderNum
=
"4"
,
width
=
20
)
private
Integer
recordPeriodMin
;
/**
* @desc 上传周期(分钟)
* @column upload_period_min
* @default 5
*/
@Excel
(
name
=
"上传周期(分钟)"
,
orderNum
=
"5"
,
width
=
20
)
private
Integer
uploadPeriodMin
;
/**
* @desc 指定上传时间
* @column specify_upload_time
* @default '0'
*/
@Excel
(
name
=
"指定上传时间"
,
orderNum
=
"6"
,
width
=
20
)
private
String
specifyUploadTime
;
/**
* @desc 运行模式
* @column run_mode
* @default '0'
*/
@Excel
(
name
=
"运行模式"
,
orderNum
=
"7"
,
width
=
20
,
replace
=
{
"在线传输_0"
,
"离线记录_1"
})
private
String
runMode
;
/**
* @desc 显示模式
* @column display_mode
* @default '2'
*/
@Excel
(
name
=
"显示模式"
,
orderNum
=
"8"
,
width
=
20
,
replace
=
{
"不显示_0"
,
"单向客流_1"
,
"双向客流_2"
})
private
String
displayMode
;
/**
* @desc 设备当前时间
* @column device_time
* @default
*/
@Excel
(
name
=
"设备当前时间"
,
orderNum
=
"9"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
deviceTime
;
/**
* @desc 星期几
* @column day_of_week
* @default '1'
*/
@Excel
(
name
=
"星期几"
,
orderNum
=
"10"
,
width
=
20
,
replace
=
{
"星期日_0"
,
"星期一_1"
,
"星期二_2"
,
"星期三_3"
,
"星期四_4"
,
"星期五_5"
,
"星期六_6"
})
private
String
dayOfWeek
;
/**
* @desc 计数开始小时
* @column count_start_hour
* @default
*/
@Excel
(
name
=
"计数开始时间"
,
orderNum
=
"11"
,
width
=
20
)
private
String
countStartTime
;
/**
* @desc 计数结束小时
* @column count_stop_hour
* @default
*/
@Excel
(
name
=
"计数结束时间"
,
orderNum
=
"13"
,
width
=
20
)
private
String
countStopTime
;
/**
* @desc CRC16 校验值
* @column crc16
* @default
*/
@Excel
(
name
=
"CRC16 校验值"
,
orderNum
=
"15"
,
width
=
20
)
private
String
crc16
;
}
src/main/java/org/rcisoft/business/devinfo/service/DevInfoService.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devinfo
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.rcisoft.business.cmsbanner.entity.CmsBanner
;
import
org.rcisoft.business.cmstask.entity.CmsTask
;
import
org.rcisoft.business.cmsvideo.entity.CmsVideo
;
import
org.rcisoft.business.devinfo.entity.DevSetting
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
javax.validation.Valid
;
import
java.util.List
;
public
interface
DevInfoService
{
/**
* 查询 设备信息表list
* @param devSetting
* @return
*/
List
<
DevSetting
>
findAll
(
DevSetting
devSetting
);
/**
* 保存 设备信息表
* @param devSetting
* @return
*/
CyPersistModel
persist
(
DevSetting
devSetting
);
/**
* 逻辑删除 设备信息表
* @param devSetting
* @return
*/
CyPersistModel
removeLogical
(
DevSetting
devSetting
);
/**
* 修改 设备信息表
* @param devSetting
* @return
*/
CyPersistModel
merge
(
DevSetting
devSetting
);
/**
* 根据id查询 设备信息表
* @param businessId
* @return
*/
Object
findById
(
String
businessId
);
/**
* 分页查询 设备信息表
* @param paginationUtility
* @param devSetting
* @return
*/
IPage
<
DevSetting
>
findAllByPagination
(
CyPageInfo
<
DevSetting
>
paginationUtility
,
DevSetting
devSetting
);
/**
* 导出设备信息表
* @param devSetting
* @return
*/
List
<
DevSetting
>
export
(
DevSetting
devSetting
);
// CyPersistModel updateById(DevSetting devSetting);
}
src/main/java/org/rcisoft/business/devinfo/service/impl/DevInfoServiceImpl.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
devinfo
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.cmsbanner.entity.CmsBanner
;
import
org.rcisoft.business.cmstask.entity.CmsTask
;
import
org.rcisoft.business.devinfo.dao.DevInfoRepository
;
import
org.rcisoft.business.devinfo.entity.DevSetting
;
import
org.rcisoft.business.devinfo.service.DevInfoService
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
public
class
DevInfoServiceImpl
extends
ServiceImpl
<
DevInfoRepository
,
DevSetting
>
implements
DevInfoService
{
/**
* 查询list 设备信息表
* @param devSetting
* @return
*/
@Override
public
List
<
DevSetting
>
findAll
(
DevSetting
devSetting
)
{
return
baseMapper
.
queryDevInfo
(
devSetting
);
}
/**
* 保存 设备信息表
* @param devSetting
* @return
*/
@Override
public
CyPersistModel
persist
(
DevSetting
devSetting
)
{
//增加操作
int
line
=
baseMapper
.
insert
(
devSetting
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
devSetting
.
getBusinessId
()
+
"的设备信息表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 逻辑删除 设备信息表
* @param devSetting
* @return
*/
@Override
public
CyPersistModel
removeLogical
(
DevSetting
devSetting
)
{
devSetting
.
setDeleted
();
int
line
=
baseMapper
.
deleteById
(
devSetting
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"逻辑删除了ID为"
+
devSetting
.
getBusinessId
()
+
"的设备信息表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 修改 设备信息表
* @param devSetting
* @return
*/
@Override
public
CyPersistModel
merge
(
DevSetting
devSetting
)
{
int
line
=
baseMapper
.
updateById
(
devSetting
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
devSetting
.
getBusinessId
()
+
"的设备信息表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 根据id查询 设备信息表
* @param businessId
* @return
*/
@Override
public
Object
findById
(
String
businessId
)
{
return
baseMapper
.
selectById
(
businessId
);
}
/**
* 分页查询 设备信息表
* @param paginationUtility
* @param devSetting
* @return
*/
@Override
public
IPage
<
DevSetting
>
findAllByPagination
(
CyPageInfo
<
DevSetting
>
paginationUtility
,
DevSetting
devSetting
)
{
return
baseMapper
.
queryDevInfoPaged
(
paginationUtility
,
devSetting
);
}
/**
* 导出设备信息表
* @param devSetting
* @return
*/
@Override
public
List
<
DevSetting
>
export
(
DevSetting
devSetting
)
{
List
<
DevSetting
>
devInfoList
=
baseMapper
.
queryDevInfo
(
devSetting
);
return
devInfoList
;
}
}
src/main/java/org/rcisoft/business/idtkconfig/controller/IdtkController.java
0 → 100644
View file @
a0d1708b
This diff is collapsed.
Click to expand it.
src/main/java/org/rcisoft/business/idtkconfig/dao/TIdtkConfigRepository.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
idtkconfig
.
dao
;
import
org.rcisoft.business.idtkconfig.entity.TIdtkConfigEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
TIdtkConfigRepository
extends
JpaRepository
<
TIdtkConfigEntity
,
Integer
>
{
TIdtkConfigEntity
findBySn
(
String
sn
);
}
src/main/java/org/rcisoft/business/idtkconfig/entity/TIdtkConfigEntity.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
idtkconfig
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.io.Serializable
;
@Data
@Entity
@Table
(
name
=
"dev_setting"
)
public
class
TIdtkConfigEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
String
sn
;
private
String
deviceSn
;
private
String
cmdType
;
private
String
detectSpeed
;
private
Integer
recordPeriodMin
;
private
Integer
uploadPeriodMin
;
private
String
runMode
;
private
String
displayMode
;
private
String
countStartTime
;
private
String
countStopTime
;
}
src/main/java/org/rcisoft/business/idtkconfig/service/TIdtkConfigService.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
idtkconfig
.
service
;
import
org.rcisoft.business.idtkconfig.entity.TIdtkConfigEntity
;
public
interface
TIdtkConfigService
{
TIdtkConfigEntity
queryObjectBySn
(
String
sn
);
}
src/main/java/org/rcisoft/business/idtkconfig/service/impl/IdtkConfigServiceImpl.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
business
.
idtkconfig
.
service
.
impl
;
import
org.rcisoft.business.idtkconfig.dao.TIdtkConfigRepository
;
import
org.rcisoft.business.idtkconfig.entity.TIdtkConfigEntity
;
import
org.rcisoft.business.idtkconfig.service.TIdtkConfigService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
IdtkConfigServiceImpl
implements
TIdtkConfigService
{
private
final
TIdtkConfigRepository
idtkConfigRepository
;
@Autowired
public
IdtkConfigServiceImpl
(
TIdtkConfigRepository
idtkConfigRepository
)
{
this
.
idtkConfigRepository
=
idtkConfigRepository
;
}
@Override
public
TIdtkConfigEntity
queryObjectBySn
(
String
sn
)
{
return
idtkConfigRepository
.
findBySn
(
sn
);
}
}
src/main/java/org/rcisoft/core/util/Crc16.java
0 → 100644
View file @
a0d1708b
package
org
.
rcisoft
.
core
.
util
;
import
java.math.BigInteger
;
public
class
Crc16
{
/**
* 将16进制字符串转换为字节数组
*
* @param hexString 16进制字符串
* @return 字节数组
*/
public
static
byte
[]
hexStringToBytes
(
String
hexString
)
{
if
(
hexString
==
null
||
hexString
.
equals
(
""
))
{
return
null
;
}
hexString
=
hexString
.
toUpperCase
();
int
length
=
hexString
.
length
()
/
2
;
char
[]
hexChars
=
hexString
.
toCharArray
();
byte
[]
d
=
new
byte
[
length
];
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
int
pos
=
i
*
2
;
d
[
i
]
=
(
byte
)
((
charToByte
(
hexChars
[
pos
])
<<
4
)
|
charToByte
(
hexChars
[
pos
+
1
]));
}
return
d
;
}
/**
* 将字符转换为字节
*
* @param c 字符
* @return 字节
*/
private
static
byte
charToByte
(
char
c
)
{
return
(
byte
)
"0123456789ABCDEF"
.
indexOf
(
c
);
}
/**
* 计算CRC16校验值
*
* @param arrBuff 字节数组
* @return CRC16校验值的16进制字符串
*/
public
static
String
getCRC
(
byte
[]
arrBuff
)
{
int
len
=
arrBuff
.
length
;
int
crc
=
0xFFFF
;
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
int
c
=
arrBuff
[
i
]
&
0x00FF
;
crc
^=
c
;
for
(
int
j
=
0
;
j
<
8
;
j
++)
{
if
((
crc
&
0x0001
)
>
0
)
{
crc
=
crc
>>
1
;
crc
^=
0xA001
;
}
else
{
crc
=
crc
>>
1
;
}
}
}
return
String
.
format
(
"%04X"
,
crc
);
}
/**
* 将16进制单精度浮点型转换为10进制浮点型
*
* @param hexStr 16进制字符串
* @return 浮点数
*/
public
static
float
parseHex2Float
(
String
hexStr
)
{
BigInteger
bigInteger
=
new
BigInteger
(
hexStr
,
16
);
return
Float
.
intBitsToFloat
(
bigInteger
.
intValue
());
}
/**
* 将10进制浮点型转换为16进制浮点型
*
* @param data 浮点数
* @return 16进制字符串
*/
public
static
String
parseFloat2Hex
(
float
data
)
{
return
Integer
.
toHexString
(
Float
.
floatToIntBits
(
data
));
}
}
src/main/resources/mapper/business/devalarm/mapper/DevAlarmMapper.xml
0 → 100644
View file @
a0d1708b
<?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=
"org.rcisoft.business.devalarm.dao.DevAlarmRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.devalarm.entity.DevAlarmEntity"
>
<id
column=
"business_id"
jdbcType=
"INTEGER"
property=
"businessId"
/>
<result
column=
"version"
jdbcType=
"VARCHAR"
property=
"version"
/>
<result
column=
"device_sn"
jdbcType=
"VARCHAR"
property=
"deviceSn"
/>
<result
column=
"ir_battery"
jdbcType=
"INTEGER"
property=
"irBattery"
/>
<result
column=
"main_battery"
jdbcType=
"INTEGER"
property=
"mainBattery"
/>
<result
column=
"is_focus_lost"
jdbcType=
"VARCHAR"
property=
"isFocusLost"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
</resultMap>
<select
id=
"queryDevAlarm"
resultType=
"org.rcisoft.business.devalarm.entity.DevAlarmEntity"
>
select * from dev_alarm
where 1 = 1
and del_flag = '0'
<if
test=
"entity.deviceSn != null and entity.deviceSn != ''"
>
and device_sn like concat('%', #{entity.device_sn}, '%')
</if>
<if
test=
"entity.version != null and entity.version != ''"
>
and version like concat('%', #{entity.version}, '%')
</if>
<if
test=
"entity.isFocusLost != null and entity.isFocusLost != ''"
>
and is_focus_lost = #{entity.isFocusLost}
</if>
<if
test=
"entity.irBattery != null"
>
and ir_battery = #{entity.irBattery}
</if>
<if
test=
"entity.mainBattery != null"
>
and main_battery = #{entity.mainBattery}
</if>
</select>
<select
id=
"queryDevAlarmPaged"
resultType=
"org.rcisoft.business.devalarm.entity.DevAlarmEntity"
>
select * from (
select *, row_number() over (partition by device_sn order by created_time desc) as rn
from dev_alarm
where 1 = 1
and del_flag = '0'
<if
test=
"entity.deviceSn != null and entity.deviceSn != ''"
>
and device_sn like concat('%', #{entity.deviceSn}, '%')
</if>
<if
test=
"entity.version != null and entity.version != ''"
>
and version like concat('%', #{entity.version}, '%')
</if>
<if
test=
"entity.isFocusLost != null and entity.isFocusLost != ''"
>
and is_focus_lost = #{entity.isFocusLost}
</if>
<if
test=
"entity.irBattery != null"
>
and ir_battery = #{entity.irBattery}
</if>
<if
test=
"entity.mainBattery != null"
>
and main_battery = #{entity.mainBattery}
</if>
) as temp
where rn = 1
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/business/devflow/mapper/DevFlowMapper.xml
0 → 100644
View file @
a0d1708b
<?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=
"org.rcisoft.business.devflow.dao.DevFlowRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.devflow.entity.DevFlow"
>
<id
column=
"business_id"
jdbcType=
"INTEGER"
property=
"businessId"
/>
<result
column=
"device_sn"
jdbcType=
"VARCHAR"
property=
"deviceSn"
/>
<result
column=
"data_time"
jdbcType=
"TIMESTAMP"
property=
"dataTime"
/>
<result
column=
"in_count"
jdbcType=
"VARCHAR"
property=
"inCount"
/>
<result
column=
"out_count"
jdbcType=
"VARCHAR"
property=
"outCount"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
</resultMap>
<select
id=
"queryDevFlow"
resultType=
"org.rcisoft.business.devflow.entity.DevFlow"
>
select *
from dev_flow
where 1 = 1
and del_flag = '0'
<if
test=
"entity.inCount != null and entity.inCount != ''"
>
and in_count = #{entity.inCount}
</if>
<if
test=
"entity.outCount != null and entity.outCount != ''"
>
and out_count = #{entity.outCount}
</if>
<if
test=
"entity.deviceSn != null and entity.deviceSn != ''"
>
and device_sn like concat('%', #{entity.deviceSn}, '%')
</if>
ORDER BY business_id DESC
</select>
<select
id=
"queryDevFlowPaged"
resultType=
"org.rcisoft.business.devflow.entity.DevFlow"
>
select *
from dev_flow
where 1 = 1
and del_flag = '0'
<if
test=
"entity.inCount != null and entity.inCount != ''"
>
and in_count = #{entity.inCount}
</if>
<if
test=
"entity.outCount != null and entity.outCount != ''"
>
and out_count = #{entity.outCount}
</if>
<if
test=
"entity.deviceSn != null and entity.deviceSn != ''"
>
and device_sn like concat('%', #{entity.deviceSn}, '%')
</if>
ORDER BY business_id DESC
</select>
<select
id=
"statistics"
resultType=
"org.rcisoft.business.devflow.entity.DevFlow"
>
SELECT
SUM(CAST(in_count AS UNSIGNED)) AS inCountSum,
SUM(CAST(out_count AS UNSIGNED)) AS outCountSum
FROM
dev_flow
WHERE
del_flag = '0'
<if
test=
"entity.deviceSn !=null and entity.deviceSn != '' "
>
and device_sn = #{entity.deviceSn}
</if>
<if
test=
"entity.beginTime !=null and entity.beginTime != '' "
>
and data_time
>
= #{entity.beginTime}
</if>
<if
test=
"entity.endTime !=null and entity.endTime != '' "
>
and data_time
<
= #{entity.endTime}
</if>
</select>
<select
id=
"statisticsCur"
resultType=
"org.rcisoft.business.devflow.entity.DevFlow"
>
SELECT
SUM(CAST(in_count AS UNSIGNED)) AS inCountSumCur,
SUM(CAST(out_count AS UNSIGNED)) AS outCountSumCur
FROM
dev_flow
WHERE data_time
>
= CURDATE() AND data_time
<
(CURDATE() + INTERVAL 1 DAY)
and del_flag = '0'
<if
test=
"entity.deviceSn !=null and entity.deviceSn != '' "
>
and device_sn = #{entity.deviceSn}
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/business/devinfo.mapper/DevInfoMapper.xml
0 → 100644
View file @
a0d1708b
<?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=
"org.rcisoft.business.devinfo.dao.DevInfoRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.devinfo.entity.DevSetting"
>
<id
column=
"business_id"
jdbcType=
"INTEGER"
property=
"businessId"
/>
<result
column=
"device_sn"
jdbcType=
"VARCHAR"
property=
"deviceSn"
/>
<result
column=
"cmd_type"
jdbcType=
"VARCHAR"
property=
"cmdType"
/>
<result
column=
"detect_speed"
jdbcType=
"VARCHAR"
property=
"detectSpeed"
/>
<result
column=
"record_period_min"
jdbcType=
"INTEGER"
property=
"recordPeriodMin"
/>
<result
column=
"upload_period_min"
jdbcType=
"INTEGER"
property=
"uploadPeriodMin"
/>
<result
column=
"specify_upload_time"
jdbcType=
"VARCHAR"
property=
"specifyUploadTime"
/>
<result
column=
"run_mode"
jdbcType=
"VARCHAR"
property=
"runMode"
/>
<result
column=
"display_mode"
jdbcType=
"VARCHAR"
property=
"displayMode"
/>
<result
column=
"device_time"
jdbcType=
"TIMESTAMP"
property=
"deviceTime"
/>
<result
column=
"day_of_week"
jdbcType=
"VARCHAR"
property=
"dayOfWeek"
/>
<result
column=
"count_start_time"
jdbcType=
"VARCHAR"
property=
"countStartTime"
/>
<result
column=
"count_stop_time"
jdbcType=
"VARCHAR"
property=
"countStopTime"
/>
<result
column=
"crc16"
jdbcType=
"VARCHAR"
property=
"crc16"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
</resultMap>
<select
id=
"queryDevInfo"
resultType=
"org.rcisoft.business.devinfo.entity.DevSetting"
>
select * from dev_setting
where 1=1
and del_flag = '0'
<if
test=
"entity.flag !=null and entity.flag != '' "
>
and flag = #{entity.flag}
</if>
<if
test=
"entity.deviceSn != null and entity.deviceSn != ''"
>
AND device_sn like concat('%',#{entity.deviceSn},'%')
</if>
<if
test=
"entity.cmdType != null and entity.cmdType != ''"
>
AND cmd_type = #{entity.cmdType}
</if>
<if
test=
"entity.detectSpeed != null and entity.detectSpeed != ''"
>
AND detect_speed = #{entity.detectSpeed}
</if>
<if
test=
"entity.recordPeriodMin != null"
>
AND record_period_min = #{entity.recordPeriodMin}
</if>
<if
test=
"entity.uploadPeriodMin != null"
>
AND upload_period_min = #{entity.uploadPeriodMin}
</if>
<if
test=
"entity.specifyUploadTime != null and entity.specifyUploadTime != ''"
>
AND specify_upload_time = #{entity.specifyUploadTime}
</if>
<if
test=
"entity.runMode != null and entity.runMode != ''"
>
AND run_mode = #{entity.runMode}
</if>
<if
test=
"entity.displayMode != null and entity.displayMode != ''"
>
AND display_mode = #{entity.displayMode}
</if>
<if
test=
"entity.deviceTime != null"
>
AND device_time = #{entity.deviceTime}
</if>
<if
test=
"entity.dayOfWeek != null and entity.dayOfWeek != ''"
>
AND day_of_week = #{entity.dayOfWeek}
</if>
<if
test=
"entity.countStartTime != null and entity.countStartTime != ''"
>
AND count_start_time = #{entity.countStartTime}
</if>
<if
test=
"entity.countStopTime != null and entity.countStopTime != ''"
>
AND count_stop_time = #{entity.countStopTime}
</if>
<if
test=
"entity.crc16 != null and entity.crc16 != ''"
>
AND crc16 = #{entity.crc16}
</if>
</select>
<select
id=
"queryDevInfoPaged"
resultType=
"org.rcisoft.business.devinfo.entity.DevSetting"
>
select * from dev_setting
where 1=1
and del_flag = '0'
<if
test=
"entity.flag !=null and entity.flag != '' "
>
and flag = #{entity.flag}
</if>
<if
test=
"entity.deviceSn != null and entity.deviceSn != ''"
>
AND device_sn like concat('%',#{entity.deviceSn},'%')
</if>
<if
test=
"entity.cmdType != null and entity.cmdType != ''"
>
AND cmd_type = #{entity.cmdType}
</if>
<if
test=
"entity.detectSpeed != null and entity.detectSpeed != ''"
>
AND detect_speed = #{entity.detectSpeed}
</if>
<if
test=
"entity.recordPeriodMin != null"
>
AND record_period_min = #{entity.recordPeriodMin}
</if>
<if
test=
"entity.uploadPeriodMin != null"
>
AND upload_period_min = #{entity.uploadPeriodMin}
</if>
<if
test=
"entity.specifyUploadTime != null and entity.specifyUploadTime != ''"
>
AND specify_upload_time = #{entity.specifyUploadTime}
</if>
<if
test=
"entity.runMode != null and entity.runMode != ''"
>
AND run_mode = #{entity.runMode}
</if>
<if
test=
"entity.displayMode != null and entity.displayMode != ''"
>
AND display_mode = #{entity.displayMode}
</if>
<if
test=
"entity.deviceTime != null"
>
AND device_time = #{entity.deviceTime}
</if>
<if
test=
"entity.dayOfWeek != null and entity.dayOfWeek != ''"
>
AND day_of_week = #{entity.dayOfWeek}
</if>
<if
test=
"entity.countStartTime != null and entity.countStartTime != ''"
>
AND count_start_time = #{entity.countStartTime}
</if>
<if
test=
"entity.countStopTime != null and entity.countStopTime != ''"
>
AND count_stop_time = #{entity.countStopTime}
</if>
<if
test=
"entity.crc16 != null and entity.crc16 != ''"
>
AND crc16 = #{entity.crc16}
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/business/idtkconfig/mapper/IdtkConfigMapper.xml
0 → 100644
View file @
a0d1708b
<?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=
"org.rcisoft.business.idtkconfig.dao.TIdtkConfigRepository"
>
<select
id=
"findBySn"
resultType=
"org.rcisoft.business.idtkconfig.entity.TIdtkConfigEntity"
>
select * from dev_setting
where sn = sn
</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