Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
signal
traffic-signal-platform
Commits
9ca3a927
Commit
9ca3a927
authored
Dec 16, 2022
by
wuxiaokai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
路口管理-修改
parent
dbb53753
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
263 additions
and
51 deletions
+263
-51
MybatisPlusGenerator.java
...ice/src/main/java/net/wanji/web/MybatisPlusGenerator.java
+1
-2
TBaseAreaInfoController.java
...ava/net/wanji/web/controller/TBaseAreaInfoController.java
+2
-2
TBaseAreaInfo.java
...ice/src/main/java/net/wanji/web/entity/TBaseAreaInfo.java
+6
-5
TBaseAreaInfoMapper.java
...c/main/java/net/wanji/web/mapper/TBaseAreaInfoMapper.java
+3
-5
TBaseAreaInfoService.java
...main/java/net/wanji/web/service/TBaseAreaInfoService.java
+2
-2
TBaseCrossInfoService.java
...ain/java/net/wanji/web/service/TBaseCrossInfoService.java
+22
-6
IdWorker.java
...eb-service/src/main/java/net/wanji/web/util/IdWorker.java
+197
-0
BaseCrossInfoVO.java
...rvice/src/main/java/net/wanji/web/vo/BaseCrossInfoVO.java
+14
-13
TBaseAreaInfoMapper.xml
...service/src/main/resources/mapper/TBaseAreaInfoMapper.xml
+16
-16
No files found.
signal-web-service/src/main/java/net/wanji/web/MybatisPlusGenerator.java
View file @
9ca3a927
...
@@ -21,8 +21,7 @@ public class MybatisPlusGenerator {
...
@@ -21,8 +21,7 @@ public class MybatisPlusGenerator {
private
static
final
String
USERNAME
=
"root"
;
private
static
final
String
USERNAME
=
"root"
;
private
static
final
String
PASSWORD
=
"Wanji300552"
;
private
static
final
String
PASSWORD
=
"Wanji300552"
;
private
static
final
String
[]
TABLES
=
{
private
static
final
String
[]
TABLES
=
{
"t_base_area_info"
,
"t_base_area_info"
"t_base_cross_info"
};
};
private
static
final
String
TEMPLATE_PATH
=
"/templates/mapper.xml.ftl"
;
private
static
final
String
TEMPLATE_PATH
=
"/templates/mapper.xml.ftl"
;
private
static
final
String
MAPPER_PATH
=
"signal-web-service/src/main/resources/mapper/"
;
private
static
final
String
MAPPER_PATH
=
"signal-web-service/src/main/resources/mapper/"
;
...
...
signal-web-service/src/main/java/net/wanji/web/controller/TBaseAreaInfoController.java
View file @
9ca3a927
...
@@ -7,11 +7,11 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -7,11 +7,11 @@ import org.springframework.web.bind.annotation.RestController;
/**
/**
* <p>
* <p>
* 区域基础
表
前端控制器
* 区域基础
信息
前端控制器
* </p>
* </p>
*
*
* @author wj
* @author wj
* @since 2022-1
1-28
* @since 2022-1
2-16
*/
*/
@RestController
@RestController
@RequestMapping
(
"/t-base-area-info"
)
@RequestMapping
(
"/t-base-area-info"
)
...
...
signal-web-service/src/main/java/net/wanji/web/entity/TBaseAreaInfo.java
View file @
9ca3a927
package
net
.
wanji
.
web
.
entity
;
package
net
.
wanji
.
web
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
...
@@ -12,11 +13,11 @@ import java.util.Date;
...
@@ -12,11 +13,11 @@ import java.util.Date;
/**
/**
* <p>
* <p>
* 区域基础
表
* 区域基础
信息
* </p>
* </p>
*
*
* @author wj
* @author wj
* @since 2022-1
1-28
* @since 2022-1
2-16
*/
*/
@Getter
@Getter
@Setter
@Setter
...
@@ -29,7 +30,7 @@ public class TBaseAreaInfo implements Serializable {
...
@@ -29,7 +30,7 @@ public class TBaseAreaInfo implements Serializable {
/**
/**
* 主键
* 主键
*/
*/
@TableId
(
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Integer
id
;
/**
/**
...
@@ -53,8 +54,8 @@ public class TBaseAreaInfo implements Serializable {
...
@@ -53,8 +54,8 @@ public class TBaseAreaInfo implements Serializable {
/**
/**
* 父节点
* 父节点
*/
*/
@TableField
(
"parent"
)
@TableField
(
"parent
_code
"
)
private
Integer
parent
;
private
Integer
parent
Code
;
/**
/**
* 区域中心点
* 区域中心点
...
...
signal-web-service/src/main/java/net/wanji/web/mapper/TBaseAreaInfoMapper.java
View file @
9ca3a927
package
net
.
wanji
.
web
.
mapper
;
package
net
.
wanji
.
web
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
net.wanji.web.entity.TBaseAreaInfo
;
import
net.wanji.web.entity.TBaseAreaInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
net.wanji.web.po.AreaTreePO
;
import
net.wanji.web.po.AreaTreePO
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -9,18 +9,17 @@ import java.util.List;
...
@@ -9,18 +9,17 @@ import java.util.List;
/**
/**
* <p>
* <p>
* 区域基础
表
Mapper 接口
* 区域基础
信息
Mapper 接口
* </p>
* </p>
*
*
* @author wj
* @author wj
* @since 2022-1
1-28
* @since 2022-1
2-16
*/
*/
@Repository
@Repository
public
interface
TBaseAreaInfoMapper
extends
BaseMapper
<
TBaseAreaInfo
>
{
public
interface
TBaseAreaInfoMapper
extends
BaseMapper
<
TBaseAreaInfo
>
{
int
deleteByPrimaryKey
(
Integer
id
);
int
deleteByPrimaryKey
(
Integer
id
);
@Override
int
insert
(
TBaseAreaInfo
record
);
int
insert
(
TBaseAreaInfo
record
);
int
insertSelective
(
TBaseAreaInfo
record
);
int
insertSelective
(
TBaseAreaInfo
record
);
...
@@ -34,5 +33,4 @@ public interface TBaseAreaInfoMapper extends BaseMapper<TBaseAreaInfo> {
...
@@ -34,5 +33,4 @@ public interface TBaseAreaInfoMapper extends BaseMapper<TBaseAreaInfo> {
int
updateByPrimaryKey
(
TBaseAreaInfo
record
);
int
updateByPrimaryKey
(
TBaseAreaInfo
record
);
List
<
AreaTreePO
>
selectAreaTree
();
List
<
AreaTreePO
>
selectAreaTree
();
}
}
signal-web-service/src/main/java/net/wanji/web/service/TBaseAreaInfoService.java
View file @
9ca3a927
...
@@ -8,11 +8,11 @@ import org.springframework.stereotype.Service;
...
@@ -8,11 +8,11 @@ import org.springframework.stereotype.Service;
/**
/**
* <p>
* <p>
* 区域基础
表
服务实现类
* 区域基础
信息
服务实现类
* </p>
* </p>
*
*
* @author wj
* @author wj
* @since 2022-1
1-28
* @since 2022-1
2-16
*/
*/
@Service
@Service
public
class
TBaseAreaInfoService
extends
ServiceImpl
<
TBaseAreaInfoMapper
,
TBaseAreaInfo
>
implements
IService
<
TBaseAreaInfo
>
{
public
class
TBaseAreaInfoService
extends
ServiceImpl
<
TBaseAreaInfoMapper
,
TBaseAreaInfo
>
implements
IService
<
TBaseAreaInfo
>
{
...
...
signal-web-service/src/main/java/net/wanji/web/service/TBaseCrossInfoService.java
View file @
9ca3a927
...
@@ -11,6 +11,7 @@ import net.wanji.web.mapper.TBaseCrossInfoMapper;
...
@@ -11,6 +11,7 @@ import net.wanji.web.mapper.TBaseCrossInfoMapper;
import
net.wanji.web.po.AreaTreePO
;
import
net.wanji.web.po.AreaTreePO
;
import
net.wanji.web.po.CrossInfoPO
;
import
net.wanji.web.po.CrossInfoPO
;
import
net.wanji.web.po.PageResultPO
;
import
net.wanji.web.po.PageResultPO
;
import
net.wanji.web.util.IdWorker
;
import
net.wanji.web.vo.BaseCrossInfoVO
;
import
net.wanji.web.vo.BaseCrossInfoVO
;
import
net.wanji.web.vo.CrossInfoVO
;
import
net.wanji.web.vo.CrossInfoVO
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -80,7 +81,9 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
...
@@ -80,7 +81,9 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
* @return {@link Result}<{@link String}>
* @return {@link Result}<{@link String}>
*/
*/
public
Result
<
String
>
updateOne
(
BaseCrossInfoVO
crossInfoPO
)
{
public
Result
<
String
>
updateOne
(
BaseCrossInfoVO
crossInfoPO
)
{
TBaseCrossInfo
record
=
getBaseCrossInfo
(
crossInfoPO
);
TBaseCrossInfo
record
=
new
TBaseCrossInfo
();
BeanUtils
.
copyProperties
(
crossInfoPO
,
record
);
record
.
setGmtModified
(
new
Date
());
int
update
=
crossInfoMapper
.
updateByPrimaryKeySelective
(
record
);
int
update
=
crossInfoMapper
.
updateByPrimaryKeySelective
(
record
);
if
(
update
>
0
)
{
if
(
update
>
0
)
{
return
Result
.
success
(
"修改成功"
);
return
Result
.
success
(
"修改成功"
);
...
@@ -89,9 +92,13 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
...
@@ -89,9 +92,13 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
}
}
private
TBaseCrossInfo
getBaseCrossInfo
(
BaseCrossInfoVO
crossInfoPO
)
{
private
TBaseCrossInfo
getBaseCrossInfo
(
BaseCrossInfoVO
crossInfoPO
)
{
if
(
crossInfoPO
.
getId
()
==
null
||
crossInfoPO
.
getId
().
trim
().
equals
(
""
))
{
IdWorker
idWorker
=
new
IdWorker
(
0
,
0
);
crossInfoPO
.
setId
(
String
.
valueOf
(
idWorker
.
nextId
()));
}
if
(
crossInfoPO
.
getAreaCode
()
==
null
)
{
if
(
crossInfoPO
.
getAreaCode
()
==
null
)
{
QueryWrapper
<
TBaseAreaInfo
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
TBaseAreaInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
l
ike
(
"name"
,
crossInfoPO
.
getAreaName
());
queryWrapper
.
l
ambda
().
eq
(
TBaseAreaInfo:
:
getName
,
crossInfoPO
.
getAreaName
());
// 查询areaCode
// 查询areaCode
List
<
TBaseAreaInfo
>
tBaseAreaInfos
=
areaInfoMapper
.
selectList
(
queryWrapper
);
List
<
TBaseAreaInfo
>
tBaseAreaInfos
=
areaInfoMapper
.
selectList
(
queryWrapper
);
if
(
tBaseAreaInfos
!=
null
&&
tBaseAreaInfos
.
size
()
>
0
)
{
if
(
tBaseAreaInfos
!=
null
&&
tBaseAreaInfos
.
size
()
>
0
)
{
...
@@ -100,18 +107,27 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
...
@@ -100,18 +107,27 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
}
}
if
(
crossInfoPO
.
getAreaName
()
==
null
)
{
if
(
crossInfoPO
.
getAreaName
()
==
null
)
{
QueryWrapper
<
TBaseAreaInfo
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
TBaseAreaInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"code"
,
crossInfoPO
.
getAreaCode
());
queryWrapper
.
lambda
().
eq
(
TBaseAreaInfo:
:
getCode
,
crossInfoPO
.
getAreaCode
());
List
<
TBaseAreaInfo
>
tBaseAreaInfos
=
areaInfoMapper
.
selectList
(
queryWrapper
);
List
<
TBaseAreaInfo
>
tBaseAreaInfos
=
areaInfoMapper
.
selectList
(
queryWrapper
);
if
(
tBaseAreaInfos
!=
null
&&
tBaseAreaInfos
.
size
()
>
0
)
{
if
(
tBaseAreaInfos
!=
null
&&
tBaseAreaInfos
.
size
()
>
0
)
{
crossInfoPO
.
setAreaName
(
tBaseAreaInfos
.
get
(
0
).
getName
());
crossInfoPO
.
setAreaName
(
tBaseAreaInfos
.
get
(
0
).
getName
());
}
}
}
}
if
(
crossInfoPO
.
getIsSend
()
==
null
)
{
crossInfoPO
.
setIsSend
(
1
);
}
if
(
crossInfoPO
.
getIsSignal
()
==
null
)
{
crossInfoPO
.
setIsSignal
(
1
);
}
if
(
crossInfoPO
.
getIsStart
()
==
null
)
{
crossInfoPO
.
setIsStart
(
1
);
}
if
(
crossInfoPO
.
getLocation
()
==
null
)
{
crossInfoPO
.
setLocation
(
"null"
);
}
TBaseCrossInfo
record
=
new
TBaseCrossInfo
();
TBaseCrossInfo
record
=
new
TBaseCrossInfo
();
BeanUtils
.
copyProperties
(
crossInfoPO
,
record
);
BeanUtils
.
copyProperties
(
crossInfoPO
,
record
);
record
.
setGmtModified
(
new
Date
());
record
.
setGmtModified
(
new
Date
());
if
(
record
.
getLocation
()
==
null
)
{
record
.
setLocation
(
"null"
);
}
return
record
;
return
record
;
}
}
...
...
signal-web-service/src/main/java/net/wanji/web/util/IdWorker.java
0 → 100644
View file @
9ca3a927
package
net
.
wanji
.
web
.
util
;
import
org.springframework.stereotype.Component
;
import
java.lang.management.ManagementFactory
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
/**
* <p>名称:IdWorker.java</p>
* <p>描述:分布式自增长ID</p>
* <pre>
* Twitter的 Snowflake JAVA实现方案
* </pre>
* 核心代码为其IdWorker这个类实现,其原理结构如下,我分别用一个0表示一位,用—分割开部分的作用:
* 1||0---0000000000 0000000000 0000000000 0000000000 0 --- 00000 ---00000 ---000000000000
* 在上面的字符串中,第一位为未使用(实际上也可作为long的符号位),接下来的41位为毫秒级时间,
* 然后5位datacenter标识位,5位机器ID(并不算标识符,实际是为线程标识),
* 然后12位该毫秒内的当前毫秒内的计数,加起来刚好64位,为一个Long型。
* 这样的好处是,整体上按照时间自增排序,并且整个分布式系统内不会产生ID碰撞(由datacenter和机器ID作区分),
* 并且效率较高,经测试,snowflake每秒能够产生26万ID左右,完全满足需要。
* <p>
* 64位ID (42(毫秒)+5(机器ID)+5(业务编码)+12(重复累加))
*
* @author Polim
*/
@Component
public
class
IdWorker
{
/**
* 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动)
*/
private
final
static
long
TWEPOCH
=
1288834974657L
;
/**
* 机器标识位数
*/
private
final
static
long
WORKER_ID_BITS
=
5L
;
/**
* 数据中心标识位数
*/
private
final
static
long
DATACENTER_ID_BITS
=
5L
;
/**
* 机器ID最大值
*/
private
final
static
long
MAX_WORKER_ID
=
~(-
1L
<<
WORKER_ID_BITS
);
/**
* 数据中心ID最大值
*/
private
final
static
long
MAX_DATACENTER_ID
=
~(-
1L
<<
DATACENTER_ID_BITS
);
/**
* 毫秒内自增位
*/
private
final
static
long
SEQUENCE_BITS
=
12L
;
/**
* 机器ID偏左移12位
*/
private
final
static
long
WORKER_ID_SHIFT
=
SEQUENCE_BITS
;
/**
* 数据中心ID左移17位
*/
private
final
static
long
DATACENTER_ID_SHIFT
=
SEQUENCE_BITS
+
WORKER_ID_BITS
;
/**
* 时间毫秒左移22位
*/
private
final
static
long
TIMESTAMP_LEFT_SHIFT
=
SEQUENCE_BITS
+
WORKER_ID_BITS
+
DATACENTER_ID_BITS
;
private
final
static
long
SEQUENCE_MASK
=
~(-
1L
<<
SEQUENCE_BITS
);
/**
* 上次生产id时间戳
*/
private
static
long
lastTimestamp
=
-
1L
;
/**
* 0,并发控制
*/
private
long
sequence
=
0L
;
private
final
long
workerId
;
/**
* 数据标识id部分
*/
private
final
long
datacenterId
;
public
IdWorker
()
{
this
.
datacenterId
=
getDatacenterId
();
this
.
workerId
=
getMaxWorkerId
(
datacenterId
);
}
/**
* @param workerId 工作机器ID
* @param datacenterId 序列号
*/
public
IdWorker
(
long
workerId
,
long
datacenterId
)
{
if
(
workerId
>
MAX_WORKER_ID
||
workerId
<
0
)
{
throw
new
IllegalArgumentException
(
String
.
format
(
"worker Id can't be greater than %d or less than 0"
,
MAX_WORKER_ID
));
}
if
(
datacenterId
>
MAX_DATACENTER_ID
||
datacenterId
<
0
)
{
throw
new
IllegalArgumentException
(
String
.
format
(
"datacenter Id can't be greater than %d or less than 0"
,
MAX_DATACENTER_ID
));
}
this
.
workerId
=
workerId
;
this
.
datacenterId
=
datacenterId
;
}
/**
* 获取下一个ID
*/
public
synchronized
long
nextId
()
{
long
timestamp
=
timeGen
();
if
(
timestamp
<
lastTimestamp
)
{
throw
new
RuntimeException
(
String
.
format
(
"Clock moved backwards. Refusing to generate id for %d milliseconds"
,
lastTimestamp
-
timestamp
));
}
if
(
lastTimestamp
==
timestamp
)
{
// 当前毫秒内,则+1
sequence
=
(
sequence
+
1
)
&
SEQUENCE_MASK
;
if
(
sequence
==
0
)
{
// 当前毫秒内计数满了,则等待下一秒
timestamp
=
tilNextMillis
(
lastTimestamp
);
}
}
else
{
sequence
=
0L
;
}
lastTimestamp
=
timestamp
;
// ID偏移组合生成最终的ID,并返回ID
return
((
timestamp
-
TWEPOCH
)
<<
TIMESTAMP_LEFT_SHIFT
)
|
(
datacenterId
<<
DATACENTER_ID_SHIFT
)
|
(
workerId
<<
WORKER_ID_SHIFT
)
|
sequence
;
}
private
long
tilNextMillis
(
final
long
lastTimestamp
)
{
long
timestamp
=
this
.
timeGen
();
while
(
timestamp
<=
lastTimestamp
)
{
timestamp
=
this
.
timeGen
();
}
return
timestamp
;
}
private
long
timeGen
()
{
return
System
.
currentTimeMillis
();
}
/**
* <p>
* 获取 maxWorkerId
* </p>
*/
protected
static
long
getMaxWorkerId
(
long
datacenterId
)
{
StringBuilder
mpid
=
new
StringBuilder
();
mpid
.
append
(
datacenterId
);
String
name
=
ManagementFactory
.
getRuntimeMXBean
().
getName
();
if
(!
name
.
isEmpty
())
{
/*
* GET jvmPid
*/
mpid
.
append
(
name
.
split
(
"@"
)[
0
]);
}
/*
* MAC + PID 的 hashcode 获取16个低位
*/
return
(
mpid
.
toString
().
hashCode
()
&
0xffff
)
%
(
IdWorker
.
MAX_WORKER_ID
+
1
);
}
/**
* <p>
* 数据标识id部分
* </p>
*/
protected
static
long
getDatacenterId
()
{
long
id
=
0L
;
try
{
InetAddress
ip
=
InetAddress
.
getLocalHost
();
NetworkInterface
network
=
NetworkInterface
.
getByInetAddress
(
ip
);
if
(
network
==
null
)
{
id
=
1L
;
}
else
{
byte
[]
mac
=
network
.
getHardwareAddress
();
id
=
((
0x000000FF
&
(
long
)
mac
[
mac
.
length
-
1
])
|
(
0x0000FF00
&
(((
long
)
mac
[
mac
.
length
-
2
])
<<
8
)))
>>
6
;
id
=
id
%
(
IdWorker
.
MAX_DATACENTER_ID
+
1
);
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
" getDatacenterId: "
+
e
.
getMessage
());
}
return
id
;
}
public
static
void
main
(
String
[]
args
)
{
IdWorker
idWorker
=
new
IdWorker
(
0
,
0
);
for
(
int
i
=
0
;
i
<
10000
;
i
++)
{
long
nextId
=
idWorker
.
nextId
();
System
.
out
.
println
(
nextId
);
}
}
}
\ No newline at end of file
signal-web-service/src/main/java/net/wanji/web/vo/BaseCrossInfoVO.java
View file @
9ca3a927
...
@@ -31,34 +31,35 @@ public class BaseCrossInfoVO {
...
@@ -31,34 +31,35 @@ public class BaseCrossInfoVO {
* 路口名称
* 路口名称
*/
*/
@ApiModelProperty
(
value
=
"路口名称"
,
required
=
true
)
@ApiModelProperty
(
value
=
"路口名称"
,
required
=
true
)
@NotNull
(
message
=
"路口名称不可为空"
,
groups
=
{
Save
.
class
,
Update
.
class
})
@NotNull
(
message
=
"路口名称不可为空"
,
groups
=
{
Save
.
class
})
private
String
name
;
private
String
name
;
/**
/**
* 路口类型
* 路口类型
*/
*/
@ApiModelProperty
(
value
=
"路口类型"
,
required
=
true
)
@ApiModelProperty
(
value
=
"路口类型"
,
required
=
true
)
@NotNull
(
message
=
"路口类型不可为空"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@NotNull(message = "路口类型不可为空", groups = {Save.class, Update.class})
private
Integer
type
;
private
Integer
type
;
/**
/**
* 路口级别
* 路口级别
*/
*/
@ApiModelProperty
(
value
=
"路口级别"
,
required
=
true
)
@ApiModelProperty
(
value
=
"路口级别"
,
required
=
true
)
@NotNull
(
message
=
"路口级别不可为空"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@NotNull(message = "路口级别不可为空", groups = {Save.class, Update.class})
private
Integer
level
;
private
Integer
level
;
/**
/**
* 行政区划代码
* 行政区划代码
*/
*/
@ApiModelProperty
(
value
=
"行政区划代码"
)
@ApiModelProperty
(
value
=
"行政区划代码"
)
@NotNull
(
message
=
"行政区划代码不可为空"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@NotNull(message = "行政区划代码不可为空", groups = {Save.class, Update.class})
private
Integer
areaCode
;
private
Integer
areaCode
;
/**
/**
* 行政区划名称
* 行政区划名称
*/
*/
@ApiModelProperty
(
value
=
"行政区划名称"
,
required
=
true
)
@ApiModelProperty
(
value
=
"行政区划名称"
,
required
=
true
)
@NotNull
(
message
=
"行政区划名称不可为空"
,
groups
=
{
Save
.
class
})
private
String
areaName
;
private
String
areaName
;
/**
/**
...
@@ -72,27 +73,27 @@ public class BaseCrossInfoVO {
...
@@ -72,27 +73,27 @@ public class BaseCrossInfoVO {
* 是否信控路口:1是;0否
* 是否信控路口:1是;0否
*/
*/
@ApiModelProperty
(
value
=
"是否信控路口:1是;0否"
,
required
=
true
)
@ApiModelProperty
(
value
=
"是否信控路口:1是;0否"
,
required
=
true
)
@NotNull
(
message
=
"是否信控路口不可为空"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@NotNull(message = "是否信控路口不可为空", groups = {Save.class, Update.class})
@Max
(
value
=
1
,
message
=
"是否信控路口:1是;0否"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@Max(value = 1, message = "是否信控路口:1是;0否", groups = {Save.class, Update.class})
@Min
(
value
=
0
,
message
=
"是否信控路口:1是;0否"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@Min(value = 0, message = "是否信控路口:1是;0否", groups = {Save.class, Update.class})
private
Integer
isSignal
;
private
Integer
isSignal
;
/**
/**
* 是否启动优化:1是;0否
* 是否启动优化:1是;0否
*/
*/
@ApiModelProperty
(
value
=
"是否启动优化:1是;0否"
,
required
=
true
)
@ApiModelProperty
(
value
=
"是否启动优化:1是;0否"
,
required
=
true
)
@NotNull
(
message
=
"是否启动优化不可为空"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@NotNull(message = "是否启动优化不可为空", groups = {Save.class, Update.class})
@Max
(
value
=
1
,
message
=
"是否启动优化:1是;0否"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@Max(value = 1, message = "是否启动优化:1是;0否", groups = {Save.class, Update.class})
@Min
(
value
=
0
,
message
=
"是否启动优化:1是;0否"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@Min(value = 0, message = "是否启动优化:1是;0否", groups = {Save.class, Update.class})
private
Integer
isStart
;
private
Integer
isStart
;
/**
/**
* 是否下发方案:1是;0否
* 是否下发方案:1是;0否
*/
*/
@ApiModelProperty
(
value
=
"是否下发方案:1是;0否"
,
required
=
true
)
@ApiModelProperty
(
value
=
"是否下发方案:1是;0否"
,
required
=
true
)
@NotNull
(
message
=
"是否下发方案不可为空"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@NotNull(message = "是否下发方案不可为空", groups = {Save.class, Update.class})
@Max
(
value
=
1
,
message
=
"是否下发方案:1是;0否"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@Max(value = 1, message = "是否下发方案:1是;0否", groups = {Save.class, Update.class})
@Min
(
value
=
0
,
message
=
"是否下发方案:1是;0否"
,
groups
=
{
Save
.
class
,
Update
.
class
})
//
@Min(value = 0, message = "是否下发方案:1是;0否", groups = {Save.class, Update.class})
private
Integer
isSend
;
private
Integer
isSend
;
/**
/**
...
...
signal-web-service/src/main/resources/mapper/TBaseAreaInfoMapper.xml
View file @
9ca3a927
<?xml version="1.0" encoding="UTF-8"
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"
>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"net.wanji.web.mapper.TBaseAreaInfoMapper"
>
<mapper
namespace=
"net.wanji.web.mapper.TBaseAreaInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"net.wanji.web.entity.TBaseAreaInfo"
>
<resultMap
id=
"BaseResultMap"
type=
"net.wanji.web.entity.TBaseAreaInfo"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"code"
property=
"code"
jdbcType=
"INTEGER"
/>
<result
column=
"code"
property=
"code"
jdbcType=
"INTEGER"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"TINYINT"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"TINYINT"
/>
<result
column=
"parent
"
property=
"parent
"
jdbcType=
"INTEGER"
/>
<result
column=
"parent
_code"
property=
"parentCode
"
jdbcType=
"INTEGER"
/>
<result
column=
"location"
property=
"location"
jdbcType=
"VARCHAR"
/>
<result
column=
"location"
property=
"location"
jdbcType=
"VARCHAR"
/>
<result
column=
"gmt_create"
property=
"gmtCreate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"gmt_create"
property=
"gmtCreate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"gmt_modified"
property=
"gmtModified"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"gmt_modified"
property=
"gmtModified"
jdbcType=
"TIMESTAMP"
/>
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<result
column=
"polylines"
property=
"polylines"
jdbcType=
"LONGVARCHAR"
/>
<result
column=
"polylines"
property=
"polylines"
jdbcType=
"LONGVARCHAR"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, code, name, type, parent, location, gmt_create, gmt_modified
id, code, name, type, parent
_code
, location, gmt_create, gmt_modified
</sql>
</sql>
<sql
id=
"Blob_Column_List"
>
<sql
id=
"Blob_Column_List"
>
polylines
polylines
...
@@ -35,10 +35,10 @@
...
@@ -35,10 +35,10 @@
</delete>
</delete>
<insert
id=
"insert"
parameterType=
"net.wanji.web.entity.TBaseAreaInfo"
>
<insert
id=
"insert"
parameterType=
"net.wanji.web.entity.TBaseAreaInfo"
>
insert into t_base_area_info (id, code, name,
insert into t_base_area_info (id, code, name,
type, parent, location,
type, parent
_code
, location,
gmt_create, gmt_modified, polylines)
gmt_create, gmt_modified, polylines)
values (#{id,jdbcType=INTEGER}, #{code,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
values (#{id,jdbcType=INTEGER}, #{code,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{type,jdbcType=TINYINT}, #{parent,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR},
#{type,jdbcType=TINYINT}, #{parent
Code
,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR},
#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{polylines,jdbcType=LONGVARCHAR})
#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{polylines,jdbcType=LONGVARCHAR})
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"net.wanji.web.entity.TBaseAreaInfo"
>
<insert
id=
"insertSelective"
parameterType=
"net.wanji.web.entity.TBaseAreaInfo"
>
...
@@ -56,8 +56,8 @@
...
@@ -56,8 +56,8 @@
<if
test=
"type != null"
>
<if
test=
"type != null"
>
type,
type,
</if>
</if>
<if
test=
"parent != null"
>
<if
test=
"parent
Code
!= null"
>
parent,
parent
_code
,
</if>
</if>
<if
test=
"location != null"
>
<if
test=
"location != null"
>
location,
location,
...
@@ -85,8 +85,8 @@
...
@@ -85,8 +85,8 @@
<if
test=
"type != null"
>
<if
test=
"type != null"
>
#{type,jdbcType=TINYINT},
#{type,jdbcType=TINYINT},
</if>
</if>
<if
test=
"parent != null"
>
<if
test=
"parent
Code
!= null"
>
#{parent,jdbcType=INTEGER},
#{parent
Code
,jdbcType=INTEGER},
</if>
</if>
<if
test=
"location != null"
>
<if
test=
"location != null"
>
#{location,jdbcType=VARCHAR},
#{location,jdbcType=VARCHAR},
...
@@ -114,8 +114,8 @@
...
@@ -114,8 +114,8 @@
<if
test=
"type != null"
>
<if
test=
"type != null"
>
type = #{type,jdbcType=TINYINT},
type = #{type,jdbcType=TINYINT},
</if>
</if>
<if
test=
"parent != null"
>
<if
test=
"parent
Code
!= null"
>
parent
= #{parent
,jdbcType=INTEGER},
parent
_code = #{parentCode
,jdbcType=INTEGER},
</if>
</if>
<if
test=
"location != null"
>
<if
test=
"location != null"
>
location = #{location,jdbcType=VARCHAR},
location = #{location,jdbcType=VARCHAR},
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
set code = #{code,jdbcType=INTEGER},
set code = #{code,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
type = #{type,jdbcType=TINYINT},
parent
= #{parent
,jdbcType=INTEGER},
parent
_code = #{parentCode
,jdbcType=INTEGER},
location = #{location,jdbcType=VARCHAR},
location = #{location,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
...
@@ -149,13 +149,13 @@
...
@@ -149,13 +149,13 @@
set code = #{code,jdbcType=INTEGER},
set code = #{code,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
type = #{type,jdbcType=TINYINT},
parent
= #{parent
,jdbcType=INTEGER},
parent
_code = #{parentCode
,jdbcType=INTEGER},
location = #{location,jdbcType=VARCHAR},
location = #{location,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</update>
<select
id=
"selectAreaTree"
resultType=
"net.wanji.web.po.AreaTreePO"
>
<select
id=
"selectAreaTree"
resultType=
"net.wanji.web.po.AreaTreePO"
>
select
code areaCode, name areaName, parent
parentCode from t_base_area_info
select
id, code, name areaName, parent_code
parentCode from t_base_area_info
</select>
</select>
</mapper>
</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