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 a29fb7cb
authored
Sep 23, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加围栏,无在店统计和警情标准接口
1 parent
c4f8f7e6
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
388 additions
and
349 deletions
src/main/java/cn/com/glsx/stdinterface/common/constants/Constants.java
src/main/java/cn/com/glsx/stdinterface/modules/controller/ChannelRiskController.java
src/main/java/cn/com/glsx/stdinterface/modules/controller/ElectricInStoreController.java
src/main/java/cn/com/glsx/stdinterface/modules/controller/FenceDriverController.java
src/main/java/cn/com/glsx/stdinterface/modules/controller/StatisticsDriveController.java
src/main/java/cn/com/glsx/stdinterface/modules/mapper/ChannelRiskDataMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/mapper/ElectricFenceDriveMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/mapper/ElectricInStoreMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/model/ElectricFenceDrive.java
src/main/java/cn/com/glsx/stdinterface/modules/model/ElectricInStoreDrive.java
src/main/java/cn/com/glsx/stdinterface/modules/service/ChannelRiskService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/ElectricInStoreService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/FenceDriverService.java
src/main/java/cn/com/glsx/stdinterface/modules/util/FileUtil.java
src/main/java/cn/com/glsx/stdinterface/modules/util/HttpUtils.java
src/main/resources/bootstrap.properties
src/main/resources/mapper/ChannelRiskDataMapper.xml
src/main/resources/mapper/ElectricFenceDriveMapper.xml
src/main/resources/mapper/ElectricInStoreMapper.xml
src/main/java/cn/com/glsx/stdinterface/common/constants/Constants.java
View file @
a29fb7c
...
...
@@ -33,48 +33,37 @@ public final class Constants {
* 投保的公司 GL:新人保保单2020 本地处理
*/
public
final
static
String
INSURANCE_COMPANY_GL
=
"GL"
;
public
static
String
PICC_SUCC
=
"0"
;
public
final
static
String
[]
parsePatterns
=
new
String
[]{
"yyyy-MM-dd"
,
"yyyy/MM/dd"
};
// 特约长度
public
final
static
int
SPE_BR_LEN
=
166
;
/**
* 保单的状态 0 等待投保
*/
public
static
final
int
INSURANCE_WAIT_SEND_STATUS
=
0
;
/**
* 保单的状态 1 投保成功
*/
public
static
final
int
INSURANCE_SUCCESS_SEND_STATUS
=
1
;
/**
* 保单的状态 2 投保失败
*/
public
static
final
int
INSURANCE_FAIL_SEND_STATUS
=
2
;
/**
* 保单的状态 3 退保
*/
public
static
final
int
INSURANCE_CANCEL_SEND_STATUS
=
3
;
/**
* 保单的状态 4 草稿
*/
public
static
final
int
INSURANCE_DRAFT_STATUS
=
4
;
/**
* 保单的状态 5 待激活
*/
public
static
final
int
INSURANCE_WAIT_ACTIVE_STATUS
=
5
;
/**
* 保单的状态 6 删除
*/
public
static
final
int
INSURANCE_DELETE_STATUS
=
6
;
public
static
String
PICC_SUCC
=
"0"
;
}
src/main/java/cn/com/glsx/stdinterface/modules/controller/ChannelRiskController.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
controller
;
import
cn.com.glsx.stdinterface.dto.ChannelRiskDto
;
import
cn.com.glsx.stdinterface.modules.model.ChannelRiskData
;
import
cn.com.glsx.stdinterface.modules.service.ChannelRiskService
;
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.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 渠道风险Controller
*/
@Slf4j
@RestController
@RequestMapping
(
value
=
"/channelrisk"
)
@Api
(
value
=
"风控数据"
,
tags
=
{
"风控数据"
})
public
class
ChannelRiskController
{
private
final
static
String
MODULE
=
"渠道风险"
;
@Autowired
private
ChannelRiskService
channelRiskService
;
@GetMapping
(
value
=
"/selectbyworkstandsn"
)
@SysLog
(
module
=
MODULE
,
value
=
"根据车架号和sn查询风控数据"
,
action
=
OperateType
.
QUERY
)
@ApiOperation
(
value
=
"根据车架号和sn查询风控数据"
)
public
R
selectByWorkStandSn
(
@RequestParam
(
value
=
"workorderNo"
)
String
workorderNo
,
@RequestParam
(
value
=
"vin"
)
String
vin
,
@RequestParam
(
value
=
"sn"
)
String
sn
)
{
List
<
ChannelRiskDto
>
existDataList
=
channelRiskService
.
selectByWorkStandSn
(
workorderNo
,
vin
,
sn
);
return
R
.
ok
().
data
(
existDataList
);
}
@PostMapping
(
value
=
"/insertchannelriskdata"
)
@SysLog
(
module
=
MODULE
,
value
=
"插入风控数据"
,
action
=
OperateType
.
ADD
)
@ApiOperation
(
value
=
"插入风控数据"
)
public
R
insertChannelRiskData
(
@RequestBody
ChannelRiskDto
newData
)
{
ChannelRiskData
channelRiskData
=
new
ChannelRiskData
();
BeanUtils
.
copyProperties
(
newData
,
channelRiskData
);
channelRiskService
.
insertChannelRiskData
(
channelRiskData
);
return
R
.
ok
();
}
@PostMapping
(
value
=
"/updatechannelriskdata"
)
@SysLog
(
module
=
MODULE
,
value
=
"修改更新风控数据"
,
action
=
OperateType
.
EDIT
)
@ApiOperation
(
value
=
"修改更新风控数据"
)
public
R
updateChannelRiskData
(
@RequestBody
ChannelRiskDto
newData
)
{
ChannelRiskData
channelRiskData
=
new
ChannelRiskData
();
BeanUtils
.
copyProperties
(
newData
,
channelRiskData
);
channelRiskService
.
updateChannelRiskData
(
channelRiskData
);
return
R
.
ok
();
}
}
src/main/java/cn/com/glsx/stdinterface/modules/controller/ElectricInStoreController.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
controller
;
import
cn.com.glsx.stdinterface.dto.ElectricInStoreDto
;
import
cn.com.glsx.stdinterface.modules.model.ElectricInStoreDrive
;
import
cn.com.glsx.stdinterface.modules.service.ElectricInStoreService
;
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.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 不在店统计Controller
*/
@Slf4j
@RestController
@RequestMapping
(
value
=
"/electricinstore"
)
@Api
(
value
=
"不在店数据"
,
tags
=
{
"不在店数据"
})
public
class
ElectricInStoreController
{
private
final
static
String
MODULE
=
"不在店统计"
;
@Autowired
private
ElectricInStoreService
electricInStoreService
;
@GetMapping
(
value
=
"/getelectricinstore"
)
@SysLog
(
module
=
MODULE
,
value
=
"查询是否有相同的不在店数据"
,
action
=
OperateType
.
QUERY
)
@ApiOperation
(
value
=
"查询是否有相同的不在店数据"
)
public
R
getElectricInStore
(
@RequestParam
Integer
fenceId
,
@RequestParam
String
sn
,
@RequestParam
String
gpsTime
)
{
List
<
ElectricInStoreDto
>
electricInStoreList
=
electricInStoreService
.
getElectricInStore
(
fenceId
,
sn
,
gpsTime
);
return
R
.
ok
().
data
(
electricInStoreList
);
}
@PostMapping
(
value
=
"/insertelectricinstore"
)
@SysLog
(
module
=
MODULE
,
value
=
"插入不在店的数据"
,
action
=
OperateType
.
ADD
)
@ApiOperation
(
value
=
"插入不在店的数据"
)
public
R
insertElectricInStore
(
@RequestBody
ElectricInStoreDto
newElectricInStore
)
{
ElectricInStoreDrive
electricInStoreDrive
=
new
ElectricInStoreDrive
();
BeanUtils
.
copyProperties
(
newElectricInStore
,
electricInStoreDrive
);
electricInStoreService
.
insertElectricInStore
(
electricInStoreDrive
);
return
R
.
ok
();
}
}
src/main/java/cn/com/glsx/stdinterface/modules/controller/FenceDriverController.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
controller
;
import
cn.com.glsx.stdinterface.dto.ElectricFenceDto
;
import
cn.com.glsx.stdinterface.modules.model.ElectricFenceDrive
;
import
cn.com.glsx.stdinterface.modules.service.FenceDriverService
;
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.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
...
...
@@ -11,10 +21,30 @@ import org.springframework.web.bind.annotation.RestController;
*/
@Slf4j
@RestController
@RequestMapping
(
value
=
"/fencedriver"
)
@Api
(
value
=
"围栏试驾信息"
,
tags
=
{
"围栏试驾信息"
})
public
class
FenceDriverController
{
private
final
static
String
MODULE
=
"围栏试驾信息"
;
@Autowired
private
FenceDriverService
fenceDriverService
;
@GetMapping
(
value
=
"/getfencedrive"
)
@SysLog
(
module
=
MODULE
,
value
=
"查询围栏试驾信息"
,
action
=
OperateType
.
QUERY
)
@ApiOperation
(
value
=
"查询围栏试驾信息"
)
public
R
getFenceDrive
(
@RequestParam
Integer
fenceId
,
@RequestParam
String
sn
,
@RequestParam
String
journeyTime
)
{
List
<
ElectricFenceDto
>
electricFenceDriveList
=
fenceDriverService
.
getFenceDrive
(
fenceId
,
sn
,
journeyTime
);
return
R
.
ok
().
data
(
electricFenceDriveList
);
}
@PostMapping
(
value
=
"/insertfencedrive"
)
@SysLog
(
module
=
MODULE
,
value
=
"插入围栏试驾信息"
,
action
=
OperateType
.
ADD
)
@ApiOperation
(
value
=
"插入围栏试驾信息"
)
public
R
insertFenceDrive
(
@RequestBody
ElectricFenceDto
newfenceDrive
)
{
ElectricFenceDrive
electricFenceDrive
=
new
ElectricFenceDrive
();
BeanUtils
.
copyProperties
(
newfenceDrive
,
electricFenceDrive
);
fenceDriverService
.
insertFenceDrive
(
electricFenceDrive
);
return
R
.
ok
();
}
}
src/main/java/cn/com/glsx/stdinterface/modules/controller/StatisticsDriveController.java
View file @
a29fb7c
...
...
@@ -4,6 +4,8 @@ import cn.com.glsx.stdinterface.dto.StatisticsDriveDto;
import
cn.com.glsx.stdinterface.modules.service.StatisticsDriveService
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
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
;
...
...
@@ -21,11 +23,13 @@ import java.util.List;
@RequestMapping
(
value
=
"/statisticsdrive"
)
@Api
(
value
=
"试驾统计数据"
,
tags
=
{
"试驾统计数据"
})
public
class
StatisticsDriveController
{
private
final
static
String
MODULE
=
"试驾数据统计"
;
@Autowired
private
StatisticsDriveService
statisticsDriveService
;
@GetMapping
(
value
=
"/drivedatalist"
)
@SysLog
(
module
=
MODULE
,
value
=
"查询试驾统计数据"
,
action
=
OperateType
.
QUERY
)
@ApiOperation
(
value
=
"查询试驾统计数据"
)
public
R
statisticsDriveDataEveryDay
()
{
log
.
info
(
"开始查询试驾统计数据"
);
...
...
@@ -43,6 +47,7 @@ public class StatisticsDriveController {
}
@PostMapping
(
value
=
"/insertstatisticsdrivelist"
)
@SysLog
(
module
=
MODULE
,
value
=
"保存试驾统计数据"
,
action
=
OperateType
.
ADD
)
@ApiOperation
(
value
=
"保存试驾统计数据"
)
public
R
insertStatisticsDriveList
(
@RequestBody
List
<
StatisticsDriveDto
>
statisticsDriveDtoList
)
{
log
.
info
(
"开始保存试驾统计数据,数据集合的大小为==="
+
statisticsDriveDtoList
.
size
());
...
...
src/main/java/cn/com/glsx/stdinterface/modules/mapper/ChannelRiskDataMapper.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
mapper
;
import
cn.com.glsx.stdinterface.dto.ChannelRiskDto
;
import
cn.com.glsx.stdinterface.modules.model.ChannelRiskData
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
...
...
@@ -14,4 +13,6 @@ import java.util.List;
*/
@Mapper
public
interface
ChannelRiskDataMapper
extends
CommonBaseMapper
<
ChannelRiskData
>
{
//工单+设备号+车架号唯一
List
<
ChannelRiskDto
>
selectByWorkStandSn
(
@Param
(
value
=
"workorderNo"
)
String
workorderNo
,
@Param
(
value
=
"vin"
)
String
vin
,
@Param
(
value
=
"sn"
)
String
sn
);
}
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/mapper/ElectricFenceDriveMapper.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
mapper
;
import
cn.com.glsx.stdinterface.dto.ElectricFenceDto
;
import
cn.com.glsx.stdinterface.modules.model.ElectricFenceDrive
;
import
cn.com.glsx.stdinterface.modules.model.ElectricInStoreDrive
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
/**
* @Desc:试驾围栏Mapper
* @Author huangxc
...
...
@@ -14,4 +18,6 @@ import org.apache.ibatis.annotations.Select;
*/
@Mapper
public
interface
ElectricFenceDriveMapper
extends
CommonBaseMapper
<
ElectricFenceDrive
>
{
List
<
ElectricFenceDto
>
getFenceDrive
(
@Param
(
"fenceId"
)
Integer
fenceId
,
@Param
(
"sn"
)
String
sn
,
@Param
(
"journeyTime"
)
String
journeyTime
);
}
src/main/java/cn/com/glsx/stdinterface/modules/mapper/ElectricInStoreMapper.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
mapper
;
import
cn.com.glsx.stdinterface.dto.ElectricInStoreDto
;
import
cn.com.glsx.stdinterface.modules.model.ElectricInStoreDrive
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Entity generator.domain.TElectricInshopDrive
*/
@Mapper
public
interface
ElectricInStoreMapper
extends
CommonBaseMapper
<
ElectricInStoreDrive
>
{
ElectricInStoreDrive
getElectricInStore
(
@Param
(
"electricInStoreDrive"
)
ElectricInStoreDrive
electricInStoreDriv
e
);
List
<
ElectricInStoreDto
>
getElectricInStore
(
@Param
(
"fenceId"
)
Integer
fenceId
,
@Param
(
"sn"
)
String
sn
,
@Param
(
"gpsTime"
)
String
gpsTim
e
);
}
src/main/java/cn/com/glsx/stdinterface/modules/model/ElectricFenceDrive.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
model
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
@@ -9,9 +11,11 @@ import java.util.Date;
* @Author huangxc
* @Date 2021/4/19
*/
@Data
@Table
(
name
=
"t_electric_fence_drive"
)
public
class
ElectricFenceDrive
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Column
(
name
=
"id"
,
unique
=
true
,
nullable
=
false
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
,
generator
=
"SELECT LAST_INSERT_ID()"
)
...
...
@@ -20,201 +24,33 @@ public class ElectricFenceDrive implements Serializable {
* 设备号
*/
private
String
sn
;
/**
* 外键:电子围栏表主键
*/
@Column
(
name
=
"fence_id"
)
private
Integer
fenceId
;
/**
* 业务渠道标识,旧e盾:11 新E盾:12
*/
@Column
(
name
=
"sve_system_id"
)
private
Integer
sveSystemId
;
/**
* 行程开始时间
*/
@Column
(
name
=
"journey_time"
)
private
Date
journeyTime
;
/**
* 重合度(百分百),如值为20,即为20%
*/
private
Integer
percent
;
/**
* 创建时间
*/
@Column
(
name
=
"created_time"
)
private
Date
createTime
;
/**
* 更新时间
*/
@Column
(
name
=
"updated_time"
)
private
Date
updateTime
;
private
static
final
long
serialVersionUID
=
1L
;
/**
* @return id
*/
public
Integer
getId
()
{
return
id
;
}
/**
* @param id
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取设备号
*
* @return sn - 设备号
*/
public
String
getSn
()
{
return
sn
;
}
/**
* 设置设备号
*
* @param sn 设备号
*/
public
void
setSn
(
String
sn
)
{
this
.
sn
=
sn
==
null
?
null
:
sn
.
trim
();
}
/**
* 获取外键:电子围栏表主键
*
* @return fence_id - 外键:电子围栏表主键
*/
public
Integer
getFenceId
()
{
return
fenceId
;
}
/**
* 设置外键:电子围栏表主键
*
* @param fenceId 外键:电子围栏表主键
*/
public
void
setFenceId
(
Integer
fenceId
)
{
this
.
fenceId
=
fenceId
;
}
/**
* 获取业务渠道标识,旧e盾:11 新E盾:12
*
* @return sve_system_id - 业务渠道标识,旧e盾:11 新E盾:12
*/
public
Integer
getSveSystemId
()
{
return
sveSystemId
;
}
/**
* 设置业务渠道标识,旧e盾:11 新E盾:12
*
* @param sveSystemId 业务渠道标识,旧e盾:11 新E盾:12
*/
public
void
setSveSystemId
(
Integer
sveSystemId
)
{
this
.
sveSystemId
=
sveSystemId
;
}
/**
* 获取行程开始时间
*
* @return journey_time - 行程开始时间
*/
public
Date
getJourneyTime
()
{
return
journeyTime
;
}
/**
* 设置行程开始时间
*
* @param journeyTime 行程开始时间
*/
public
void
setJourneyTime
(
Date
journeyTime
)
{
this
.
journeyTime
=
journeyTime
;
}
/**
* 获取重合度(百分百),如值为20,即为20%
*
* @return percent - 重合度(百分百),如值为20,即为20%
*/
public
Integer
getPercent
()
{
return
percent
;
}
/**
* 设置重合度(百分百),如值为20,即为20%
*
* @param percent 重合度(百分百),如值为20,即为20%
*/
public
void
setPercent
(
Integer
percent
)
{
this
.
percent
=
percent
;
}
/**
* 获取创建时间
*
* @return create_time - 创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置创建时间
*
* @param createTime 创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取更新时间
*
* @return update_time - 更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* 设置更新时间
*
* @param updateTime 更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", sn="
).
append
(
sn
);
sb
.
append
(
", fenceId="
).
append
(
fenceId
);
sb
.
append
(
", sveSystemId="
).
append
(
sveSystemId
);
sb
.
append
(
", journeyTime="
).
append
(
journeyTime
);
sb
.
append
(
", percent="
).
append
(
percent
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
}
src/main/java/cn/com/glsx/stdinterface/modules/model/ElectricInStoreDrive.java
View file @
a29fb7c
...
...
@@ -14,6 +14,7 @@ import java.util.Date;
@Table
(
name
=
"t_electric_instore_drive"
)
@Data
public
class
ElectricInStoreDrive
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
...
...
@@ -21,53 +22,43 @@ public class ElectricInStoreDrive implements Serializable {
@Column
(
name
=
"id"
,
unique
=
true
,
nullable
=
false
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
,
generator
=
"SELECT LAST_INSERT_ID()"
)
private
Integer
id
;
/**
* 设备号
*/
private
String
sn
;
/**
* 外键:电子围栏表主键
*/
@Column
(
name
=
"fence_id"
)
private
Integer
fenceId
;
/**
* 业务渠道标识,默认为 13
*/
@Column
(
name
=
"sve_system_id"
)
private
Integer
sveSystemId
;
/**
* 0 表示不在, 1表示在新疆
*/
@Column
(
name
=
"position_state"
)
private
Integer
positionState
;
/**
* 0:工作时间有进出门店 1:工作时间一直在门店内 2:工作时间内一直在门店外
*/
@Column
(
name
=
"gps_state"
)
private
Integer
gpsState
;
/**
* 行程开始时间
*/
@Column
(
name
=
"gps_time"
)
private
Date
gpsTime
;
/**
* 创建时间
*/
@Column
(
name
=
"created_time"
)
private
Date
createdTime
;
/**
* 更新时间
*/
@Column
(
name
=
"updated_time"
)
private
Date
updatedTime
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/service/ChannelRiskService.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
import
cn.com.glsx.stdinterface.dto.ChannelRiskDto
;
import
cn.com.glsx.stdinterface.modules.mapper.ChannelRiskDataMapper
;
import
cn.com.glsx.stdinterface.modules.model.ChannelRiskData
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 渠道风险serviceImpl
*/
...
...
@@ -16,4 +20,15 @@ public class ChannelRiskService {
private
ChannelRiskDataMapper
channelRiskDataMapper
;
public
List
<
ChannelRiskDto
>
selectByWorkStandSn
(
String
workorderNo
,
String
vin
,
String
sn
)
{
return
channelRiskDataMapper
.
selectByWorkStandSn
(
workorderNo
,
vin
,
sn
);
}
public
void
insertChannelRiskData
(
ChannelRiskData
newData
)
{
channelRiskDataMapper
.
insert
(
newData
);
}
public
void
updateChannelRiskData
(
ChannelRiskData
newData
)
{
channelRiskDataMapper
.
updateByPrimaryKey
(
newData
);
}
}
src/main/java/cn/com/glsx/stdinterface/modules/service/ElectricInStoreService.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
import
cn.com.glsx.stdinterface.dto.ElectricInStoreDto
;
import
cn.com.glsx.stdinterface.modules.mapper.ElectricInStoreMapper
;
import
cn.com.glsx.stdinterface.modules.model.ElectricInStoreDrive
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
* 不在店统计Service
*/
...
...
@@ -14,7 +18,12 @@ public class ElectricInStoreService {
@Autowired
private
ElectricInStoreMapper
electricInStoreMapper
;
ElectricInStoreDrive
getElectricInStore
(
ElectricInStoreDrive
electricInStoreDrive
)
{
return
electricInStoreMapper
.
getElectricInStore
(
electricInStoreDrive
);
public
List
<
ElectricInStoreDto
>
getElectricInStore
(
Integer
fenceId
,
String
sn
,
String
gpsTime
)
{
return
electricInStoreMapper
.
getElectricInStore
(
fenceId
,
sn
,
gpsTime
);
}
public
void
insertElectricInStore
(
ElectricInStoreDrive
electricInStoreDrive
)
{
electricInStoreDrive
.
setCreatedTime
(
new
Date
());
electricInStoreMapper
.
insert
(
electricInStoreDrive
);
}
}
src/main/java/cn/com/glsx/stdinterface/modules/service/FenceDriverService.java
View file @
a29fb7c
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
import
cn.com.glsx.stdinterface.dto.ElectricFenceDto
;
import
cn.com.glsx.stdinterface.modules.mapper.ElectricFenceDriveMapper
;
import
cn.com.glsx.stdinterface.modules.model.ElectricFenceDrive
;
import
cn.com.glsx.stdinterface.modules.model.ElectricInStoreDrive
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
* 围栏试驾信息Service
...
...
@@ -15,5 +21,13 @@ public class FenceDriverService {
private
ElectricFenceDriveMapper
electricFenceDriveMapper
;
public
List
<
ElectricFenceDto
>
getFenceDrive
(
Integer
fenceId
,
String
sn
,
String
journeyTime
)
{
return
electricFenceDriveMapper
.
getFenceDrive
(
fenceId
,
sn
,
journeyTime
);
}
public
void
insertFenceDrive
(
ElectricFenceDrive
fenceDrive
)
{
fenceDrive
.
setCreateTime
(
new
Date
());
electricFenceDriveMapper
.
insert
(
fenceDrive
);
}
}
src/main/java/cn/com/glsx/stdinterface/modules/util/FileUtil.java
View file @
a29fb7c
...
...
@@ -24,6 +24,90 @@ public class FileUtil {
private
static
final
SimpleDateFormat
FMT
=
new
SimpleDateFormat
(
"yyMMdd"
);
/**
* 判断文件是否存在
*/
public
static
boolean
existFile
(
String
sPath
)
{
boolean
flag
=
false
;
File
file
=
new
File
(
sPath
);
// 路径为文件且不为空
if
(
file
.
isFile
()
&&
file
.
exists
())
{
flag
=
true
;
}
return
flag
;
}
/**
* 删除单个文件
*
* @param sPath 被删除文件的文件名
* @return 单个文件删除成功返回true,否则返回false
* @author lidh@didihu.com.cn on 20171024
*/
public
static
boolean
deleteFile
(
String
sPath
)
{
boolean
flag
=
false
;
File
file
=
new
File
(
sPath
);
// 路径为文件且不为空则进行删除
if
(
file
.
isFile
()
&&
file
.
exists
())
{
file
.
delete
();
flag
=
true
;
}
else
{
System
.
out
.
println
(
"文件不存在或路径为空"
);
}
return
flag
;
}
public
static
String
byte2file
(
byte
[]
data
,
String
imagePath
,
String
imageName
)
{
if
(
data
==
null
||
""
.
equals
(
imageName
)
||
""
.
equals
(
imagePath
))
{
return
null
;
}
String
path
=
imagePath
+
"/"
+
imageName
;
System
.
out
.
println
(
"save paht :"
+
path
);
FileOutputStream
imageOutput
=
null
;
File
dir
=
new
File
(
imagePath
);
if
(!
dir
.
exists
()
&&
!
dir
.
isDirectory
())
{
//判断文件目录是否存在
dir
.
mkdirs
();
}
try
{
imageOutput
=
new
FileOutputStream
(
new
File
(
path
));
imageOutput
.
write
(
data
,
0
,
data
.
length
);
imageOutput
.
flush
();
}
catch
(
Exception
ex
)
{
path
=
null
;
ex
.
printStackTrace
();
}
finally
{
if
(
imageOutput
!=
null
)
{
try
{
imageOutput
.
close
();
}
catch
(
IOException
e
)
{
path
=
null
;
e
.
printStackTrace
();
}
}
}
return
path
;
}
public
static
byte
[]
getBytes
(
String
filePath
)
{
byte
[]
buffer
=
null
;
try
{
File
file
=
new
File
(
filePath
);
FileInputStream
fis
=
new
FileInputStream
(
file
);
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
(
1000
);
byte
[]
b
=
new
byte
[
1000
];
int
n
;
while
((
n
=
fis
.
read
(
b
))
!=
-
1
)
{
bos
.
write
(
b
,
0
,
n
);
}
fis
.
close
();
bos
.
close
();
buffer
=
bos
.
toByteArray
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
buffer
;
}
/**
* 下载excel模版
*
* @param response
...
...
@@ -109,91 +193,6 @@ public class FileUtil {
return
file
.
getInputStream
();
}
/**
* 判断文件是否存在
*/
public
static
boolean
existFile
(
String
sPath
)
{
boolean
flag
=
false
;
File
file
=
new
File
(
sPath
);
// 路径为文件且不为空
if
(
file
.
isFile
()
&&
file
.
exists
())
{
flag
=
true
;
}
return
flag
;
}
/**
* 删除单个文件
*
* @param sPath 被删除文件的文件名
* @return 单个文件删除成功返回true,否则返回false
* @author lidh@didihu.com.cn on 20171024
*/
public
static
boolean
deleteFile
(
String
sPath
)
{
boolean
flag
=
false
;
File
file
=
new
File
(
sPath
);
// 路径为文件且不为空则进行删除
if
(
file
.
isFile
()
&&
file
.
exists
())
{
file
.
delete
();
flag
=
true
;
}
else
{
System
.
out
.
println
(
"文件不存在或路径为空"
);
}
return
flag
;
}
public
static
String
byte2file
(
byte
[]
data
,
String
imagePath
,
String
imageName
)
{
if
(
data
==
null
||
""
.
equals
(
imageName
)
||
""
.
equals
(
imagePath
))
{
return
null
;
}
String
path
=
imagePath
+
"/"
+
imageName
;
System
.
out
.
println
(
"save paht :"
+
path
);
FileOutputStream
imageOutput
=
null
;
File
dir
=
new
File
(
imagePath
);
if
(!
dir
.
exists
()
&&
!
dir
.
isDirectory
())
{
//判断文件目录是否存在
dir
.
mkdirs
();
}
try
{
imageOutput
=
new
FileOutputStream
(
new
File
(
path
));
imageOutput
.
write
(
data
,
0
,
data
.
length
);
imageOutput
.
flush
();
}
catch
(
Exception
ex
)
{
path
=
null
;
ex
.
printStackTrace
();
}
finally
{
if
(
imageOutput
!=
null
)
{
try
{
imageOutput
.
close
();
}
catch
(
IOException
e
)
{
path
=
null
;
e
.
printStackTrace
();
}
}
}
return
path
;
}
public
static
byte
[]
getBytes
(
String
filePath
)
{
byte
[]
buffer
=
null
;
try
{
File
file
=
new
File
(
filePath
);
FileInputStream
fis
=
new
FileInputStream
(
file
);
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
(
1000
);
byte
[]
b
=
new
byte
[
1000
];
int
n
;
while
((
n
=
fis
.
read
(
b
))
!=
-
1
)
{
bos
.
write
(
b
,
0
,
n
);
}
fis
.
close
();
bos
.
close
();
buffer
=
bos
.
toByteArray
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
buffer
;
}
public
String
upload
(
InputStream
fis
,
String
savePath
)
throws
IOException
{
StringBuilder
tempFileName
=
new
StringBuilder
(
"pdf"
);
tempFileName
.
append
(
"-"
);
...
...
src/main/java/cn/com/glsx/stdinterface/modules/util/HttpUtils.java
View file @
a29fb7c
...
...
@@ -54,14 +54,12 @@ import java.util.*;
@Slf4j
public
class
HttpUtils
{
final
static
int
CONNECTION_TIMEOUT
=
10000
;
// 设置请求超时 10 秒钟 根据业务调整
final
static
int
SOCKET_TIMEOUT
=
180000
;
// 数据传输时间 3 分钟
final
static
int
SEARCH_CONNECTION_TIMEOUT
=
500
;
// 连接不够用的时候等待超时时间,不设置默认等于 CONNECTION_TIMEOUT
public
final
static
ContentType
XML_UTF8
=
ContentType
.
create
(
"text/xml"
,
"utf-8"
);
public
final
static
ContentType
XML_GBK
=
ContentType
.
create
(
"text/xml"
,
"gbk"
);
public
final
static
ContentType
JSON_UTF8
=
ContentType
.
create
(
"application/json"
,
"utf-8"
);
final
static
int
CONNECTION_TIMEOUT
=
10000
;
// 设置请求超时 10 秒钟 根据业务调整
final
static
int
SOCKET_TIMEOUT
=
180000
;
// 数据传输时间 3 分钟
final
static
int
SEARCH_CONNECTION_TIMEOUT
=
500
;
// 连接不够用的时候等待超时时间,不设置默认等于 CONNECTION_TIMEOUT
static
PoolingHttpClientConnectionManager
httpClientConnectionManager
=
null
;
static
{
...
...
src/main/resources/bootstrap.properties
View file @
a29fb7c
...
...
@@ -6,7 +6,9 @@ server.servlet.context-path=/stdinterface
#\u65E5\u5FD7\u8DEF\u5F84\uFF08logback-spring.xml\u8BFB\u53D6\uFF0C\u4E0D\u8981\u52A0\u5165\u914D\u7F6E\u4E2D\u5FC3\uFF09
logging.path
=
/data/java_log/jetty/${spring.application.name}/${spring.application.name}.log
#nacos\u914D\u7F6E\u4E2D\u5FC3
spring.cloud.nacos.config.server-
addr
=
192.168.0.63:8848
spring.cloud.nacos.config.server-
addr
=
192.168.3.206:8848
#\u8054\u8C03\u6D4B\u8BD5\u7684\u65F6\u5019\u4F7F\u7528
#spring.cloud.nacos.config.server-addr=192.168.0.63:8848
#nacos\u914D\u7F6Eid\uFF0C\u5B8C\u6574dataId=${spring.cloud.nacos.config.prefix}-${spring.profiles.active}.${file-extension\uFF08\u7531\u65B0\u589E\u914D\u7F6E\u65F6\u9009\u7684\u6587\u4EF6\u7C7B\u578B\u51B3\u5B9A\uFF09}
#\u793A\u4F8B\uFF1Ahttp://192.168.0.63:8848/nacos/v1/cs/configs?dataId=glsx-rest-admin.properties&group=DEV_GROUP
spring.cloud.nacos.config.group
=
NESHIELD_DEV_GROUP
...
...
@@ -23,4 +25,6 @@ spring.cloud.nacos.config.shared-configs[0].refresh=true
#\u6570\u636E\u5E93\u3001redis\u7B49\u516C\u5171\u914D\u7F6E
spring.cloud.nacos.config.shared-configs[1]
.group
=
NESHIELD_DEV_GROUP
spring.cloud.nacos.config.shared-configs[1].data-
id
=
glsx-ne-shield-share-dev.properties
spring.cloud.nacos.config.shared-configs[1]
.refresh
=
true
\ No newline at end of file
spring.cloud.nacos.config.shared-configs[1]
.refresh
=
true
spring.main.allow-bean-definition-
overriding
=
true
\ No newline at end of file
src/main/resources/mapper/ChannelRiskDataMapper.xml
View file @
a29fb7c
<?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.ChannelRiskDataMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.stdinterface.modules.model.ChannelRiskData"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"workorder_no"
jdbcType=
"VARCHAR"
property=
"workorderNo"
/>
<result
column=
"owner_name"
jdbcType=
"VARCHAR"
property=
"ownerName"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"active_date"
jdbcType=
"TIMESTAMP"
property=
"activeDate"
/>
<result
column=
"dev_type"
jdbcType=
"INTEGER"
property=
"devType"
/>
<result
column=
"gps_time"
jdbcType=
"TIMESTAMP"
property=
"gpsTime"
/>
<result
column=
"lng"
jdbcType=
"DOUBLE"
property=
"lng"
/>
<result
column=
"lat"
jdbcType=
"DOUBLE"
property=
"lat"
/>
<result
column=
"prov"
jdbcType=
"VARCHAR"
property=
"prov"
/>
<result
column=
"city"
jdbcType=
"VARCHAR"
property=
"city"
/>
<result
column=
"zone"
jdbcType=
"VARCHAR"
property=
"zone"
/>
<result
column=
"address"
jdbcType=
"VARCHAR"
property=
"address"
/>
<result
column=
"shop_name"
jdbcType=
"VARCHAR"
property=
"shopName"
/>
<result
column=
"labels"
jdbcType=
"VARCHAR"
property=
"labels"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"radius"
jdbcType=
"INTEGER"
property=
"radius"
/>
<result
column=
"district"
jdbcType=
"VARCHAR"
property=
"district"
/>
<result
column=
"street"
jdbcType=
"VARCHAR"
property=
"street"
/>
<result
column=
"street_number"
jdbcType=
"VARCHAR"
property=
"streetNumber"
/>
<result
column=
"center_lat"
jdbcType=
"DOUBLE"
property=
"centerLat"
/>
<result
column=
"center_lng"
jdbcType=
"DOUBLE"
property=
"centerLng"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, workorder_no, owner_name, vin, sn, active_date, dev_type, gps_time, lng, lat,
prov, city, `zone`, address, shop_name, labels, `type`, radius, district, street,
street_number, center_lat, center_lng
</sql>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.stdinterface.modules.model.ChannelRiskData"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"workorder_no"
jdbcType=
"VARCHAR"
property=
"workorderNo"
/>
<result
column=
"owner_name"
jdbcType=
"VARCHAR"
property=
"ownerName"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"active_date"
jdbcType=
"TIMESTAMP"
property=
"activeDate"
/>
<result
column=
"dev_type"
jdbcType=
"INTEGER"
property=
"devType"
/>
<result
column=
"gps_time"
jdbcType=
"TIMESTAMP"
property=
"gpsTime"
/>
<result
column=
"lng"
jdbcType=
"DOUBLE"
property=
"lng"
/>
<result
column=
"lat"
jdbcType=
"DOUBLE"
property=
"lat"
/>
<result
column=
"prov"
jdbcType=
"VARCHAR"
property=
"prov"
/>
<result
column=
"city"
jdbcType=
"VARCHAR"
property=
"city"
/>
<result
column=
"zone"
jdbcType=
"VARCHAR"
property=
"zone"
/>
<result
column=
"address"
jdbcType=
"VARCHAR"
property=
"address"
/>
<result
column=
"shop_name"
jdbcType=
"VARCHAR"
property=
"shopName"
/>
<result
column=
"labels"
jdbcType=
"VARCHAR"
property=
"labels"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"radius"
jdbcType=
"INTEGER"
property=
"radius"
/>
<result
column=
"district"
jdbcType=
"VARCHAR"
property=
"district"
/>
<result
column=
"street"
jdbcType=
"VARCHAR"
property=
"street"
/>
<result
column=
"street_number"
jdbcType=
"VARCHAR"
property=
"streetNumber"
/>
<result
column=
"center_lat"
jdbcType=
"DOUBLE"
property=
"centerLat"
/>
<result
column=
"center_lng"
jdbcType=
"DOUBLE"
property=
"centerLng"
/>
</resultMap>
<resultMap
id=
"ChannelRiskMap"
type=
"cn.com.glsx.stdinterface.dto.ChannelRiskDto"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"workorder_no"
jdbcType=
"VARCHAR"
property=
"workorderNo"
/>
<result
column=
"owner_name"
jdbcType=
"VARCHAR"
property=
"ownerName"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"active_date"
jdbcType=
"TIMESTAMP"
property=
"activeDate"
/>
<result
column=
"dev_type"
jdbcType=
"INTEGER"
property=
"devType"
/>
<result
column=
"gps_time"
jdbcType=
"TIMESTAMP"
property=
"gpsTime"
/>
<result
column=
"lng"
jdbcType=
"DOUBLE"
property=
"lng"
/>
<result
column=
"lat"
jdbcType=
"DOUBLE"
property=
"lat"
/>
<result
column=
"prov"
jdbcType=
"VARCHAR"
property=
"prov"
/>
<result
column=
"city"
jdbcType=
"VARCHAR"
property=
"city"
/>
<result
column=
"zone"
jdbcType=
"VARCHAR"
property=
"zone"
/>
<result
column=
"address"
jdbcType=
"VARCHAR"
property=
"address"
/>
<result
column=
"shop_name"
jdbcType=
"VARCHAR"
property=
"shopName"
/>
<result
column=
"labels"
jdbcType=
"VARCHAR"
property=
"labels"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"radius"
jdbcType=
"INTEGER"
property=
"radius"
/>
<result
column=
"district"
jdbcType=
"VARCHAR"
property=
"district"
/>
<result
column=
"street"
jdbcType=
"VARCHAR"
property=
"street"
/>
<result
column=
"street_number"
jdbcType=
"VARCHAR"
property=
"streetNumber"
/>
<result
column=
"center_lat"
jdbcType=
"DOUBLE"
property=
"centerLat"
/>
<result
column=
"center_lng"
jdbcType=
"DOUBLE"
property=
"centerLng"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, workorder_no, owner_name, vin, sn, active_date, dev_type, gps_time, lng, lat,
prov, city, `zone`, address, shop_name, labels, `type`, radius, district, street,
street_number, center_lat, center_lng
</sql>
<select
id=
"selectByWorkStandSn"
resultMap=
"ChannelRiskMap"
>
SELECT * FROM t_channel_risk_data WHERE workorder_no=#{workorderNo} AND vin=#{vin} AND sn=#{sn}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/ElectricFenceDriveMapper.xml
View file @
a29fb7c
<?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.ElectricFenceDriveMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.stdinterface.modules.model.ElectricFenceDrive"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"fence_id"
jdbcType=
"INTEGER"
property=
"fenceId"
/>
<result
column=
"sve_system_id"
jdbcType=
"INTEGER"
property=
"sveSystemId"
/>
<result
column=
"journey_time"
jdbcType=
"TIMESTAMP"
property=
"journeyTime"
/>
<result
column=
"percent"
jdbcType=
"INTEGER"
property=
"percent"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, sn, fence_id, sve_system_id, journey_time, `percent`, create_time, update_time
</sql>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.stdinterface.modules.model.ElectricFenceDrive"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"fence_id"
jdbcType=
"INTEGER"
property=
"fenceId"
/>
<result
column=
"sve_system_id"
jdbcType=
"INTEGER"
property=
"sveSystemId"
/>
<result
column=
"journey_time"
jdbcType=
"TIMESTAMP"
property=
"journeyTime"
/>
<result
column=
"percent"
jdbcType=
"INTEGER"
property=
"percent"
/>
<result
column=
"created_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"updated_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<resultMap
id=
"FenceDriveMap"
type=
"cn.com.glsx.stdinterface.dto.ElectricFenceDto"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"fence_id"
jdbcType=
"INTEGER"
property=
"fenceId"
/>
<result
column=
"sve_system_id"
jdbcType=
"INTEGER"
property=
"sveSystemId"
/>
<result
column=
"journey_time"
jdbcType=
"TIMESTAMP"
property=
"journeyTime"
/>
<result
column=
"percent"
jdbcType=
"INTEGER"
property=
"percent"
/>
<result
column=
"created_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"updated_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generatedd
-->
id, sn, fence_id, sve_system_id, journey_time, `percent`, created_time, updated_time
</sql>
<select
id=
"getFenceDrive"
resultMap=
"FenceDriveMap"
>
SELECT
*
FROM t_electric_fence_drive
where fence_id=#{fenceId} and sn=#{sn} and journey_time=#{journeyTime}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/ElectricInStoreMapper.xml
View file @
a29fb7c
...
...
@@ -16,18 +16,30 @@
<result
property=
"updatedTime"
column=
"updated_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"ElectricInStoreMap"
type=
"cn.com.glsx.stdinterface.dto.ElectricInStoreDto"
>
<id
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"sn"
column=
"sn"
jdbcType=
"VARCHAR"
/>
<result
property=
"fenceId"
column=
"fence_id"
jdbcType=
"INTEGER"
/>
<result
property=
"sveSystemId"
column=
"sve_system_id"
jdbcType=
"INTEGER"
/>
<result
property=
"positionState"
column=
"position_state"
jdbcType=
"TINYINT"
/>
<result
property=
"gpsState"
column=
"gps_state"
jdbcType=
"TINYINT"
/>
<result
property=
"gpsTime"
column=
"gps_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"createdTime"
column=
"created_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updatedTime"
column=
"updated_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,sn,fence_id,
sve_system_id,position_state,gps_state,
gps_time,created_time,updated_time
</sql>
<select
id=
"getElectricInStore"
resultMap=
"
BaseResult
Map"
>
<select
id=
"getElectricInStore"
resultMap=
"
ElectricInStore
Map"
>
select *
from t_electric_instore_drive teid
where teid.fence_id=#{
electricInStoreDrive.
fenceId}
and teid.sn=#{
electricInStoreDrive.
sn}
where teid.fence_id=#{fenceId}
and teid.sn=#{sn}
and teid.gps_state=0
and teid.gps_time=#{
electricInStoreDrive.
gpsTime}
and teid.gps_time=#{gpsTime}
</select>
</mapper>
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