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
1f991c9a
Commit
1f991c9a
authored
Jun 25, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 恢复行政区划编号
parent
83a93397
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
136 additions
and
74 deletions
+136
-74
AddOrUpdateAreaBO.java
...ice/src/main/java/net/wanji/web/bo/AddOrUpdateAreaBO.java
+2
-2
AddOrUpdateJurisdictionBO.java
...main/java/net/wanji/web/bo/AddOrUpdateJurisdictionBO.java
+32
-0
CrossManageController.java
.../java/net/wanji/web/controller/CrossManageController.java
+14
-1
AreaTreePO.java
...ol-service/src/main/java/net/wanji/web/po/AreaTreePO.java
+2
-2
CrossInfoService.java
...src/main/java/net/wanji/web/service/CrossInfoService.java
+9
-5
CrossManageService.java
...c/main/java/net/wanji/web/service/CrossManageService.java
+3
-0
CrossManageServiceImpl.java
...va/net/wanji/web/service/impl/CrossManageServiceImpl.java
+36
-0
BaseCrossInfoVO.java
...rvice/src/main/java/net/wanji/web/vo/BaseCrossInfoVO.java
+2
-2
CrossInfoDTO.java
...service/src/main/java/net/wanji/opt/dto/CrossInfoDTO.java
+2
-2
BaseCrossInfoPO.java
...s/src/main/java/net/wanji/databus/po/BaseCrossInfoPO.java
+1
-1
TBaseCrossInfo.java
...us/src/main/java/net/wanji/databus/po/TBaseCrossInfo.java
+2
-2
CrossInfoVO.java
...tabus/src/main/java/net/wanji/databus/vo/CrossInfoVO.java
+2
-2
BaseCrossInfoMapper.xml
wj-databus/src/main/resources/mapper/BaseCrossInfoMapper.xml
+23
-49
RidInfoMapper.xml
wj-databus/src/main/resources/mapper/RidInfoMapper.xml
+6
-6
No files found.
signal-control-service/src/main/java/net/wanji/web/bo/AddOrUpdateAreaBO.java
View file @
1f991c9a
...
...
@@ -12,7 +12,7 @@ import java.util.List;
* @date 2023/6/9 13:52
*/
@Data
@ApiModel
(
value
=
"AddOrUpdateAreaBO"
,
description
=
"
新增/修改子区
"
)
@ApiModel
(
value
=
"AddOrUpdateAreaBO"
,
description
=
"
子区新增/修改
"
)
public
class
AddOrUpdateAreaBO
{
@ApiModelProperty
(
value
=
"子区ID"
)
private
Integer
areaId
;
...
...
@@ -24,7 +24,7 @@ public class AddOrUpdateAreaBO {
private
String
remark
;
@ApiModelProperty
(
value
=
"路口ID数组"
,
required
=
true
)
private
List
<
String
>
crossIdList
;
@ApiModelProperty
(
value
=
"
区域
坐标"
)
@ApiModelProperty
(
value
=
"坐标"
)
private
String
wkt
;
}
signal-control-service/src/main/java/net/wanji/web/bo/AddOrUpdateJurisdictionBO.java
0 → 100644
View file @
1f991c9a
package
net
.
wanji
.
web
.
bo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.Pattern
;
import
java.util.List
;
/**
* @author Kent HAN
* @date 2023/6/9 13:52
*/
@Data
@ApiModel
(
value
=
"AddOrUpdateAreaBO"
,
description
=
"辖区新增/修改"
)
public
class
AddOrUpdateJurisdictionBO
{
@ApiModelProperty
(
value
=
"父辖区ID"
)
private
Integer
parentId
;
@ApiModelProperty
(
value
=
"辖区ID"
)
private
Integer
areaId
;
@ApiModelProperty
(
value
=
"辖区名称"
,
required
=
true
)
@Pattern
(
regexp
=
"^[\\u4E00-\\u9FA5\\w\\-]{0,20}$"
,
message
=
"辖区名称只能包含中文、英文、数字、下划线和中横线,0~20个字符"
)
private
String
areaName
;
@Pattern
(
regexp
=
"^[\\u4E00-\\u9FA5\\w\\-]{0,200}$"
,
message
=
"辖区名称只能包含中文、英文、数字、下划线和中横线,0~200个字符"
)
@ApiModelProperty
(
value
=
"备注"
,
required
=
true
)
private
String
remark
;
@ApiModelProperty
(
value
=
"路口ID数组"
,
required
=
true
)
private
List
<
String
>
crossIdList
;
@ApiModelProperty
(
value
=
"坐标"
)
private
String
wkt
;
}
signal-control-service/src/main/java/net/wanji/web/controller/CrossManageController.java
View file @
1f991c9a
...
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiResponse;
import
io.swagger.annotations.ApiResponses
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.web.bo.AddOrUpdateAreaBO
;
import
net.wanji.web.bo.AddOrUpdateJurisdictionBO
;
import
net.wanji.web.bo.PolygonBO
;
import
net.wanji.web.service.impl.CrossManageServiceImpl
;
import
net.wanji.web.vo.CrossIdAndNameVO
;
...
...
@@ -45,7 +46,7 @@ public class CrossManageController {
return
JsonViewObject
.
newInstance
().
success
(
res
);
}
@ApiOperation
(
value
=
"
新增/修改子区"
,
notes
=
"新增/修改子区
,传ID为修改,不传ID为新增"
,
response
=
JsonViewObject
.
class
,
@ApiOperation
(
value
=
"
子区新增/修改"
,
notes
=
"子区新增/修改
,传ID为修改,不传ID为新增"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/addOrUpdateArea"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
...
...
@@ -57,4 +58,16 @@ public class CrossManageController {
return
JsonViewObject
.
newInstance
().
success
();
}
@ApiOperation
(
value
=
"辖区新增/修改"
,
notes
=
"辖区新增/修改,传ID为修改,不传ID为新增"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/addOrUpdateJurisdiction"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
JsonViewObject
.
class
),
})
public
JsonViewObject
addOrUpdateJurisdiction
(
@RequestBody
AddOrUpdateJurisdictionBO
addOrUpdateJurisdictionBO
)
{
crossManageService
.
addOrUpdateJurisdiction
(
addOrUpdateJurisdictionBO
);
return
JsonViewObject
.
newInstance
().
success
();
}
}
\ No newline at end of file
signal-control-service/src/main/java/net/wanji/web/po/AreaTreePO.java
View file @
1f991c9a
...
...
@@ -18,8 +18,8 @@ import java.util.List;
@ApiModel
(
value
=
"树形区域目录实体"
,
description
=
"树形区域目录实体"
)
public
class
AreaTreePO
{
@ApiModelProperty
(
value
=
"
区域ID
"
)
private
Integer
area
Id
;
@ApiModelProperty
(
value
=
"
行政区划代码
"
)
private
Integer
area
Code
;
@ApiModelProperty
(
value
=
"行政区划名称"
)
private
String
areaName
;
...
...
signal-control-service/src/main/java/net/wanji/web/service/CrossInfoService.java
View file @
1f991c9a
...
...
@@ -3,6 +3,7 @@ package net.wanji.web.service;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.databus.dao.mapper.BaseCrossInfoMapper
;
import
net.wanji.databus.po.CrossInfoPO
;
import
net.wanji.databus.po.BaseCrossInfoPO
;
import
net.wanji.databus.po.TBaseCrossInfo
;
import
net.wanji.databus.vo.CrossInfoVO
;
...
...
@@ -48,8 +49,10 @@ public class CrossInfoService {
* @param crossInfoVO 查询路口管理输入参数
*/
public
JsonViewObject
selectAll
(
CrossInfoVO
crossInfoVO
)
{
PageResultPO
<
CrossInfoPO
>
page
=
new
PageResultPO
<>();
PageResultPO
<
BaseCrossInfoPO
>
page
=
new
PageResultPO
<>();
Integer
count
=
baseCrossInfoMapper
.
countSelectAll
(
crossInfoVO
);
List
<
CrossInfoPO
>
list
=
baseCrossInfoMapper
.
selectAll
(
crossInfoVO
);
List
<
BaseCrossInfoPO
>
list
=
baseCrossInfoMapper
.
selectAll
(
crossInfoVO
);
page
.
setPageNum
(
crossInfoVO
.
getPageNum
());
page
.
setPageSize
(
crossInfoVO
.
getPageSize
());
...
...
@@ -106,18 +109,18 @@ public class CrossInfoService {
IdWorker
idWorker
=
new
IdWorker
(
0
,
0
);
crossInfoPO
.
setId
(
String
.
valueOf
(
idWorker
.
nextId
()));
}
if
(
crossInfoPO
.
getArea
Id
()
==
null
)
{
if
(
crossInfoPO
.
getArea
Code
()
==
null
)
{
QueryWrapper
<
TBaseAreaInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
lambda
().
like
(
TBaseAreaInfo:
:
getName
,
crossInfoPO
.
getAreaName
());
// 查询area
Id
// 查询area
Code
List
<
TBaseAreaInfo
>
tBaseAreaInfos
=
areaInfoMapper
.
selectList
(
queryWrapper
);
if
(
tBaseAreaInfos
!=
null
&&
tBaseAreaInfos
.
size
()
>
0
)
{
crossInfoPO
.
setArea
Id
(
tBaseAreaInfos
.
get
(
0
).
getId
());
crossInfoPO
.
setArea
Code
(
tBaseAreaInfos
.
get
(
0
).
getCode
());
}
}
if
(
crossInfoPO
.
getAreaName
()
==
null
)
{
QueryWrapper
<
TBaseAreaInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
lambda
().
eq
(
TBaseAreaInfo:
:
getCode
,
crossInfoPO
.
getArea
Id
());
queryWrapper
.
lambda
().
eq
(
TBaseAreaInfo:
:
getCode
,
crossInfoPO
.
getArea
Code
());
List
<
TBaseAreaInfo
>
tBaseAreaInfos
=
areaInfoMapper
.
selectList
(
queryWrapper
);
if
(
tBaseAreaInfos
!=
null
&&
tBaseAreaInfos
.
size
()
>
0
)
{
crossInfoPO
.
setAreaName
(
tBaseAreaInfos
.
get
(
0
).
getName
());
...
...
@@ -168,7 +171,7 @@ public class CrossInfoService {
Map
<
Integer
,
List
<
AreaTreePO
>>
parentCodeMap
=
infos
.
stream
().
collect
(
Collectors
.
groupingBy
(
AreaTreePO:
:
getParentCode
));
for
(
AreaTreePO
info
:
infos
)
{
for
(
Integer
parentCode
:
parentCodeMap
.
keySet
())
{
if
(
info
.
getArea
Id
().
equals
(
parentCode
))
{
if
(
info
.
getArea
Code
().
equals
(
parentCode
))
{
info
.
setChildren
(
parentCodeMap
.
get
(
parentCode
));
break
;
}
...
...
@@ -178,3 +181,4 @@ public class CrossInfoService {
return
infos
;
}
}
signal-control-service/src/main/java/net/wanji/web/service/CrossManageService.java
View file @
1f991c9a
package
net
.
wanji
.
web
.
service
;
import
net.wanji.web.bo.AddOrUpdateAreaBO
;
import
net.wanji.web.bo.AddOrUpdateJurisdictionBO
;
import
net.wanji.web.bo.PolygonBO
;
import
net.wanji.web.vo.CrossIdAndNameVO
;
...
...
@@ -15,4 +16,6 @@ public interface CrossManageService {
List
<
CrossIdAndNameVO
>
selectCrossesByPolygon
(
PolygonBO
polygonBO
);
void
addOrUpdateArea
(
AddOrUpdateAreaBO
addOrUpdateAreaBO
);
void
addOrUpdateJurisdiction
(
AddOrUpdateJurisdictionBO
addOrUpdateJurisdictionBO
);
}
signal-control-service/src/main/java/net/wanji/web/service/impl/CrossManageServiceImpl.java
View file @
1f991c9a
...
...
@@ -9,6 +9,7 @@ import net.wanji.databus.dao.mapper.BaseCrossInfoMapper;
import
net.wanji.databus.po.BaseAreaInfoPO
;
import
net.wanji.databus.po.BaseCrossInfoPO
;
import
net.wanji.web.bo.AddOrUpdateAreaBO
;
import
net.wanji.web.bo.AddOrUpdateJurisdictionBO
;
import
net.wanji.web.bo.PolygonBO
;
import
net.wanji.web.service.CrossManageService
;
import
net.wanji.web.vo.CrossIdAndNameVO
;
...
...
@@ -93,4 +94,39 @@ public class CrossManageServiceImpl implements CrossManageService {
crossInfoMapper
.
updateAreaId
(
crossIdList
,
newAreaId
);
}
}
@Override
public
void
addOrUpdateJurisdiction
(
AddOrUpdateJurisdictionBO
addOrUpdateJurisdictionBO
)
{
Integer
parentId
=
addOrUpdateJurisdictionBO
.
getParentId
();
Integer
areaId
=
addOrUpdateJurisdictionBO
.
getAreaId
();
String
areaName
=
addOrUpdateJurisdictionBO
.
getAreaName
();
String
remark
=
addOrUpdateJurisdictionBO
.
getRemark
();
List
<
String
>
crossIdList
=
addOrUpdateJurisdictionBO
.
getCrossIdList
();
String
wkt
=
addOrUpdateJurisdictionBO
.
getWkt
();
if
(
ObjectUtil
.
isNotEmpty
(
areaId
))
{
// 修改
// 修改辖区名称和备注
baseAreaInfoMapper
.
updateAreaNameAndRemark
(
areaName
,
remark
,
areaId
);
// 修改辖区关联路口
List
<
String
>
oldIds
=
crossInfoMapper
.
selectIdsByAreaId
(
areaId
);
crossInfoMapper
.
deleteAreaId
(
oldIds
);
crossInfoMapper
.
updateAreaId
(
crossIdList
,
areaId
);
}
else
{
// 新增
// 新增子区
BaseAreaInfoPO
baseAreaInfoPO
=
new
BaseAreaInfoPO
();
baseAreaInfoPO
.
setCode
(
0
);
baseAreaInfoPO
.
setName
(
areaName
);
baseAreaInfoPO
.
setType
(
5
);
baseAreaInfoPO
.
setParentCode
(
0
);
baseAreaInfoPO
.
setLocation
(
""
);
baseAreaInfoPO
.
setPolylines
(
wkt
);
baseAreaInfoPO
.
setRemark
(
remark
);
baseAreaInfoMapper
.
insertOne
(
baseAreaInfoPO
);
Integer
newAreaId
=
baseAreaInfoPO
.
getId
();
// 关联子区路口
crossInfoMapper
.
updateAreaId
(
crossIdList
,
newAreaId
);
}
}
}
signal-control-service/src/main/java/net/wanji/web/vo/BaseCrossInfoVO.java
View file @
1f991c9a
...
...
@@ -49,9 +49,9 @@ public class BaseCrossInfoVO {
/**
* 行政区划代码
*/
@ApiModelProperty
(
value
=
"
区域ID
"
)
@ApiModelProperty
(
value
=
"
行政区划代码
"
)
//@NotNull(message = "行政区划代码不可为空", groups = {Save.class, Update.class})
private
Integer
area
Id
;
private
Integer
area
Code
;
/**
* 行政区划名称
...
...
signal-optimize-service/src/main/java/net/wanji/opt/dto/CrossInfoDTO.java
View file @
1f991c9a
...
...
@@ -25,8 +25,8 @@ public class CrossInfoDTO {
@ApiModelProperty
(
name
=
"路口级别"
,
notes
=
""
)
private
Integer
level
;
@ApiModelProperty
(
name
=
"
区域Id
"
,
notes
=
""
)
private
Integer
area
Id
;
@ApiModelProperty
(
name
=
"
行政区划代码
"
,
notes
=
""
)
private
Integer
area
Code
;
@ApiModelProperty
(
name
=
"路口位置"
,
notes
=
""
)
private
String
location
;
...
...
wj-databus/src/main/java/net/wanji/databus/po/BaseCrossInfoPO.java
View file @
1f991c9a
...
...
@@ -38,7 +38,7 @@ public class BaseCrossInfoPO {
/**
* 行政区划代码
*/
private
Integer
area
Id
;
private
Integer
area
Code
;
/**
* 行政区划名称
...
...
wj-databus/src/main/java/net/wanji/databus/po/TBaseCrossInfo.java
View file @
1f991c9a
...
...
@@ -53,8 +53,8 @@ public class TBaseCrossInfo implements Serializable {
/**
* 行政区划代码
*/
@TableField
(
"area_
id
"
)
private
Integer
area
Id
;
@TableField
(
"area_
code
"
)
private
Integer
area
Code
;
/**
* 路口位置
...
...
wj-databus/src/main/java/net/wanji/databus/vo/CrossInfoVO.java
View file @
1f991c9a
...
...
@@ -21,8 +21,8 @@ public class CrossInfoVO {
/**
* 行政区划代码
*/
@ApiModelProperty
(
value
=
"
区域ID
"
,
required
=
true
)
private
Integer
area
Id
;
@ApiModelProperty
(
value
=
"
行政区划代码
"
,
required
=
true
)
private
Integer
area
Code
;
/**
* 行政区划名称
...
...
wj-databus/src/main/resources/mapper/BaseCrossInfoMapper.xml
View file @
1f991c9a
...
...
@@ -6,7 +6,7 @@
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"TINYINT"
/>
<result
column=
"level"
property=
"level"
jdbcType=
"TINYINT"
/>
<result
column=
"area_
id"
property=
"areaId
"
jdbcType=
"INTEGER"
/>
<result
column=
"area_
code"
property=
"areaCode
"
jdbcType=
"INTEGER"
/>
<result
column=
"location"
property=
"location"
jdbcType=
"VARCHAR"
/>
<result
column=
"is_signal"
property=
"isSignal"
jdbcType=
"TINYINT"
/>
<result
column=
"is_start"
property=
"isStart"
jdbcType=
"TINYINT"
/>
...
...
@@ -19,7 +19,7 @@
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"TINYINT"
/>
<result
column=
"level"
property=
"level"
jdbcType=
"TINYINT"
/>
<result
column=
"area_
id"
property=
"areaId
"
jdbcType=
"INTEGER"
/>
<result
column=
"area_
code"
property=
"areaCode
"
jdbcType=
"INTEGER"
/>
<result
column=
"area_name"
property=
"areaName"
jdbcType=
"VARCHAR"
/>
<result
column=
"location"
property=
"location"
jdbcType=
"VARCHAR"
/>
<result
column=
"is_signal"
property=
"isSignal"
jdbcType=
"TINYINT"
/>
...
...
@@ -30,12 +30,12 @@
</resultMap>
<sql
id=
"baseColumn"
>
id, name, type, level, area_
id
, location, is_signal, is_start, is_send, gmt_create, gmt_modified
id, name, type, level, area_
code
, location, is_signal, is_start, is_send, gmt_create, gmt_modified
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"baseColumn"
/>
<include
refid=
"baseColumn"
/>
from t_base_cross_info
where id = #{id,jdbcType=CHAR}
</select>
...
...
@@ -44,23 +44,13 @@
from t_base_cross_info
where id = #{id,jdbcType=CHAR}
</delete>
<update
id=
"deleteAreaId"
>
update t_base_cross_info
set area_id = 0
where id in
<foreach
collection=
"ids"
item=
"id"
separator=
","
open=
"("
close=
")"
>
#{id}
</foreach>
</update>
<insert
id=
"insert"
parameterType=
"net.wanji.databus.po.TBaseCrossInfo"
>
insert into t_base_cross_info (id, name, type,
level, area_
id
, location,
level, area_
code
, location,
is_signal, is_start, is_send,
gmt_create, gmt_modified)
values (#{id,jdbcType=CHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
#{level,jdbcType=TINYINT}, #{area
Id
,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR},
#{level,jdbcType=TINYINT}, #{area
Code
,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR},
#{isSignal,jdbcType=TINYINT}, #{isStart,jdbcType=TINYINT}, #{isSend,jdbcType=TINYINT},
#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP})
</insert>
...
...
@@ -79,8 +69,8 @@
<if
test=
"level != null"
>
level,
</if>
<if
test=
"area
Id
!= null"
>
area_
id
,
<if
test=
"area
Code
!= null"
>
area_
code
,
</if>
<if
test=
"location != null"
>
location,
...
...
@@ -114,8 +104,8 @@
<if
test=
"level != null"
>
#{level,jdbcType=TINYINT},
</if>
<if
test=
"area
Id
!= null"
>
#{area
Id
,jdbcType=INTEGER},
<if
test=
"area
Code
!= null"
>
#{area
Code
,jdbcType=INTEGER},
</if>
<if
test=
"location != null"
>
#{location,jdbcType=VARCHAR},
...
...
@@ -149,8 +139,8 @@
<if
test=
"level != null"
>
level = #{level,jdbcType=TINYINT},
</if>
<if
test=
"area
Id
!= null"
>
area_
id = #{areaId
,jdbcType=INTEGER},
<if
test=
"area
Code
!= null"
>
area_
code = #{areaCode
,jdbcType=INTEGER},
</if>
<if
test=
"location != null"
>
location = #{location,jdbcType=VARCHAR},
...
...
@@ -178,7 +168,7 @@
set name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
level = #{level,jdbcType=TINYINT},
area_
id = #{areaId
,jdbcType=INTEGER},
area_
code = #{areaCode
,jdbcType=INTEGER},
location = #{location,jdbcType=VARCHAR},
is_signal = #{isSignal,jdbcType=TINYINT},
is_start = #{isStart,jdbcType=TINYINT},
...
...
@@ -187,28 +177,18 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=CHAR}
</update>
<update
id=
"updateAreaId"
>
update t_base_cross_info
set area_id = #{areaId}
where id in
<foreach
collection=
"ids"
item=
"id"
separator=
","
open=
"("
close=
")"
>
#{id}
</foreach>
</update>
<select
id=
"selectAll"
parameterType=
"net.wanji.databus.vo.CrossInfoPageVO"
resultMap=
"SelectAllMap"
>
<bind
name=
"startNum"
value=
"(pageNum - 1) * pageSize"
/>
select c.id,c.name,c.type,c.level,c.area_
id
,a.name
select c.id,c.name,c.type,c.level,c.area_
code
,a.name
area_name,c.location,c.is_signal,c.is_start,c.is_send,c.gmt_create,c.gmt_modified
from t_base_cross_info c
left join t_base_area_info a on c.area_
id
=a.code
left join t_base_area_info a on c.area_
code
=a.code
<where>
<if
test=
"name != null and name != ''"
>
and c.name like concat('%',#{name},'%')
</if>
<if
test=
"area
Id != null and areaId
!= ''"
>
and a.
id = #{areaId
}
<if
test=
"area
Code != null and areaCode
!= ''"
>
and a.
code = #{areaCode
}
</if>
<if
test=
"areaName != null and areaName != ''"
>
and a.name = #{areaName}
...
...
@@ -230,13 +210,13 @@
<select
id=
"countSelectAll"
parameterType=
"net.wanji.databus.vo.CrossInfoPageVO"
resultType=
"integer"
>
select count(1)
from t_base_cross_info c
left join t_base_area_info a on c.area_
id=a.id
left join t_base_area_info a on c.area_
code=a.code
<where>
<if
test=
"name != null and name != ''"
>
and c.name like concat('%',#{name},'%')
</if>
<if
test=
"area
Id != null and areaId
!= ''"
>
and a.
id = #{areaId
}
<if
test=
"area
Code != null and areaCode
!= ''"
>
and a.
code = #{areaCode
}
</if>
<if
test=
"areaName != null and areaName != ''"
>
and a.name = #{areaName}
...
...
@@ -272,9 +252,9 @@
select
<include
refid=
"baseColumn"
/>
from t_base_cross_info
where id in
<foreach
collection=
"ids"
item=
"id"
separator=
","
open=
"("
close=
")"
>
#{id}
</foreach>
<foreach
collection=
"ids"
item=
"id"
separator=
","
open=
"("
close=
")"
>
#{id}
</foreach>
</select>
<select
id=
"selectById"
resultType=
"net.wanji.databus.po.BaseCrossInfoPO"
>
...
...
@@ -292,10 +272,4 @@
from t_base_cross_info
where name = #{name}
</select>
<select
id=
"selectIdsByAreaId"
resultType=
"java.lang.String"
>
select id from t_base_cross_info
where area_id = #{areaId}
</select>
</mapper>
\ No newline at end of file
wj-databus/src/main/resources/mapper/RidInfoMapper.xml
View file @
1f991c9a
...
...
@@ -60,12 +60,12 @@
<include
refid=
"Base_Column_List"
/>
from t_base_rid_info
<where>
<if
test=
"startCrossId != null and startCrossId != ''"
>
and start_cross_id = #{startCrossId}
</if>
<if
test=
"endCrossId != null and endCrossId != ''"
>
and end_cross_id = #{endCrossId}
</if>
<if
test=
"startCrossId != null and startCrossId != ''"
>
and start_cross_id = #{startCrossId}
</if>
<if
test=
"endCrossId != null and endCrossId != ''"
>
and end_cross_id = #{endCrossId}
</if>
</where>
</select>
...
...
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