Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
aroad_aqsc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
许言琪
aroad_aqsc
Commits
b6fce65b
提交
b6fce65b
authored
5月 23, 2019
作者:
Phyday
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
路况事件对接紧急事件
上级
365bb4a9
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
263 行增加
和
148 行删除
+263
-148
road_condition_event.sql
db/road_condition_event/road_condition_event.sql
+2
-4
路况-紧急事件对接表
db/road_condition_event/路况-紧急事件对接表
+24
-0
路况-紧急事件权限表
db/road_condition_event/路况-紧急事件权限表
+0
-12
初始化菜单.sql
db/traffic/初始化菜单.sql
+4
-4
EmergencyEventController.java
...e/emergencyevent/controller/EmergencyEventController.java
+14
-4
EmergencyEvent.java
...xy/aroad/module/emergencyevent/entity/EmergencyEvent.java
+2
-3
RoadConditionEventController.java
...oadcondition/controller/RoadConditionEventController.java
+34
-13
CoordinateDto.java
.../galaxy/aroad/module/roadcondition/dto/CoordinateDto.java
+1
-1
EmergencyUnitDto.java
...laxy/aroad/module/roadcondition/dto/EmergencyUnitDto.java
+25
-0
RoadConditionEvent.java
...aroad/module/roadcondition/entity/RoadConditionEvent.java
+3
-6
RoadConditionEventMapper.java
...module/roadcondition/mapper/RoadConditionEventMapper.java
+26
-5
RoadConditionEventService.java
...dule/roadcondition/service/RoadConditionEventService.java
+10
-2
GetRoadPlatformImpl.java
...odule/roadcondition/service/impl/GetRoadPlatformImpl.java
+24
-31
RoadConditionEventServiceImpl.java
...condition/service/impl/RoadConditionEventServiceImpl.java
+34
-9
RoadConditionEventMapper.xml
...sources/mapper/roadcondition/RoadConditionEventMapper.xml
+60
-54
没有找到文件。
db/road_condition_event/road_condition_event.sql
浏览文件 @
b6fce65b
...
@@ -23,8 +23,7 @@ SET FOREIGN_KEY_CHECKS = 0;
...
@@ -23,8 +23,7 @@ SET FOREIGN_KEY_CHECKS = 0;
DROP
TABLE
IF
EXISTS
`road_condition_event`
;
DROP
TABLE
IF
EXISTS
`road_condition_event`
;
CREATE
TABLE
`road_condition_event`
CREATE
TABLE
`road_condition_event`
(
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`event_id`
varchar
(
30
)
NOT
NULL
COMMENT
'事件id'
,
`event_id`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'事件id'
,
`road_code`
varchar
(
20
)
DEFAULT
NULL
COMMENT
'路线编码'
,
`road_code`
varchar
(
20
)
DEFAULT
NULL
COMMENT
'路线编码'
,
`road_name`
varchar
(
20
)
DEFAULT
NULL
COMMENT
'路线名称'
,
`road_name`
varchar
(
20
)
DEFAULT
NULL
COMMENT
'路线名称'
,
`maintain_unit`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'管养单位'
,
`maintain_unit`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'管养单位'
,
...
@@ -55,9 +54,8 @@ CREATE TABLE `road_condition_event`
...
@@ -55,9 +54,8 @@ CREATE TABLE `road_condition_event`
`latitude`
varchar
(
50
)
DEFAULT
NULL
COMMENT
'纬度'
,
`latitude`
varchar
(
50
)
DEFAULT
NULL
COMMENT
'纬度'
,
`current`
varchar
(
10
)
DEFAULT
NULL
COMMENT
'当前页'
,
`current`
varchar
(
10
)
DEFAULT
NULL
COMMENT
'当前页'
,
`size`
varchar
(
10
)
DEFAULT
NULL
,
`size`
varchar
(
10
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
PRIMARY
KEY
(
`
event_
id`
)
USING
BTREE
)
ENGINE
=
InnoDB
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
5987
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'路况事件管理'
;
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'路况事件管理'
;
SET
FOREIGN_KEY_CHECKS
=
1
;
SET
FOREIGN_KEY_CHECKS
=
1
;
...
...
db/road_condition_event/路况-紧急事件对接表
0 → 100644
浏览文件 @
b6fce65b
DROP TABLE IF EXISTS `roadcondition_unit`;
CREATE TABLE `roadcondition_unit`
(
`unit_id` varchar(20) NOT NULL COMMENT '单位ID',
`unit_name` varchar(20) DEFAULT NULL COMMENT '单位名称',
PRIMARY KEY (`unit_id`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='路况管养单位表';
DROP TABLE IF EXISTS `roadcondition_emergencyevent`;
CREATE TABLE `roadcondition_emergencyevent`
(
`dept_id` int(20) NOT NULL COMMENT '部门ID',
`unit_id` varchar(20) DEFAULT NULL COMMENT '单位ID'
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='路况事件_紧急事件对应权限表';
DROP TABLE IF EXISTS `roadcondition_emergency`;
CREATE TABLE `roadcondition_emergency` (
`event_id` varchar(30) NOT NULL,
`emergency_event_id` varchar(30) NOT NULL,
PRIMARY KEY (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='路况事件_应急事件对应事件表';
\ No newline at end of file
db/road_condition_event/路况-紧急事件权限表
deleted
100644 → 0
浏览文件 @
365bb4a9
DROP TABLE IF EXISTS `roadcondition_unit`;
CREATE TABLE `roadcondition_unit` (
`unit_id` varchar(20) NOT NULL COMMENT '单位ID',
`unit_name` varchar(20) DEFAULT NULL COMMENT '单位名称',
PRIMARY KEY (`unit_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='路况管养单位表';
DROP TABLE IF EXISTS `roadcondition_emergencyevent`;
CREATE TABLE `roadcondition_emergencyevent` (
`dept_id` int(20) NOT NULL COMMENT '部门ID',
`unit_id` varchar(20) DEFAULT NULL COMMENT '单位ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='路况事件_紧急事件对应权限表';
db/traffic/初始化菜单.sql
浏览文件 @
b6fce65b
INSERT
INTO
`sys_menu`
VALUES
(
90000
,
'交通量分析'
,
NULL
,
'/traffic'
,
-
1
,
NULL
,
''
,
8
,
'0'
,
'0'
,
'2019-04-28 20:38:32'
,
'2019-04-28 20:38:46'
,
'0'
);
INSERT
INTO
`sys_menu`
VALUES
(
100000
,
'交通量分析'
,
NULL
,
'/traffic'
,
-
1
,
NULL
,
''
,
10
,
'0'
,
'0'
,
'2019-04-28 20:38:32'
,
'2019-04-28 20:38:46'
,
'0'
);
INSERT
INTO
`sys_menu`
VALUES
(
91000
,
'观测站点'
,
NULL
,
'/spot'
,
9
0000
,
NULL
,
'views/traffic/trafficspot/index'
,
1
,
'0'
,
'0'
,
'2019-04-28 20:44:03'
,
'2019-04-28 20:44:22'
,
'0'
);
INSERT
INTO
`sys_menu`
VALUES
(
101000
,
'观测站点'
,
NULL
,
'/spot'
,
10
0000
,
NULL
,
'views/traffic/trafficspot/index'
,
1
,
'0'
,
'0'
,
'2019-04-28 20:44:03'
,
'2019-04-28 20:44:22'
,
'0'
);
INSERT
INTO
`sys_menu`
VALUES
(
92000
,
'路线交通量分析'
,
NULL
,
'/trafficroute'
,
9
0000
,
NULL
,
'views/traffic/trafficroute/index'
,
2
,
'0'
,
'0'
,
'2019-04-28 20:46:10'
,
'2019-04-29 13:52:04'
,
'0'
);
INSERT
INTO
`sys_menu`
VALUES
(
102000
,
'路线交通量分析'
,
NULL
,
'/trafficroute'
,
10
0000
,
NULL
,
'views/traffic/trafficroute/index'
,
2
,
'0'
,
'0'
,
'2019-04-28 20:46:10'
,
'2019-04-29 13:52:04'
,
'0'
);
INSERT
INTO
`sys_menu`
VALUES
(
93000
,
'路段交通量分析'
,
NULL
,
'/trafficroadsection'
,
9
0000
,
NULL
,
'views/traffic/trafficroadsection/index'
,
3
,
'0'
,
'0'
,
'2019-04-28 20:47:18'
,
'2019-04-29 13:52:07'
,
'0'
);
INSERT
INTO
`sys_menu`
VALUES
(
103000
,
'路段交通量分析'
,
NULL
,
'/trafficroadsection'
,
10
0000
,
NULL
,
'views/traffic/trafficroadsection/index'
,
3
,
'0'
,
'0'
,
'2019-04-28 20:47:18'
,
'2019-04-29 13:52:07'
,
'0'
);
src/main/java/com/elephant/framework/galaxy/aroad/module/emergencyevent/controller/EmergencyEventController.java
浏览文件 @
b6fce65b
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
emergencyevent
.
controller
;
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
emergencyevent
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.elephant.framework.galaxy.aroad.module.emergencyevent.dto.EventStatusDto
;
import
com.elephant.framework.galaxy.aroad.response.R
;
import
com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog
;
import
com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog
;
import
com.elephant.framework.galaxy.aroad.module.common.controller.BaseController
;
import
com.elephant.framework.galaxy.aroad.module.emergencyevent.dto.EventStatusDto
;
import
com.elephant.framework.galaxy.aroad.module.emergencyevent.entity.EmergencyEvent
;
import
com.elephant.framework.galaxy.aroad.module.emergencyevent.entity.EmergencyEvent
;
import
com.elephant.framework.galaxy.aroad.module.emergencyevent.service.EmergencyEventService
;
import
com.elephant.framework.galaxy.aroad.module.emergencyevent.service.EmergencyEventService
;
import
com.elephant.framework.galaxy.aroad.response.R
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
com.elephant.framework.galaxy.aroad.module.common.controller.BaseController
;
/**
/**
...
@@ -58,6 +57,17 @@ public class EmergencyEventController extends BaseController {
...
@@ -58,6 +57,17 @@ public class EmergencyEventController extends BaseController {
return
new
R
<>(
emergencyEventService
.
saveEvent
(
emergencyEvent
));
return
new
R
<>(
emergencyEventService
.
saveEvent
(
emergencyEvent
));
}
}
/**
* 新增应急事件表(路况事件导入,返回ID)
* @param emergencyEvent 应急事件表
* @return R
*/
@SysLog
(
"新增应急事件表"
)
@PostMapping
(
"/setemergency"
)
public
R
setEmergency
(
@RequestBody
EmergencyEvent
emergencyEvent
){
return
new
R
<>(
emergencyEventService
.
joinEvent
(
emergencyEvent
));
}
/**
/**
* 修改应急事件表
* 修改应急事件表
* @param emergencyEvent 应急事件表
* @param emergencyEvent 应急事件表
...
...
src/main/java/com/elephant/framework/galaxy/aroad/module/emergencyevent/entity/EmergencyEvent.java
浏览文件 @
b6fce65b
...
@@ -8,8 +8,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
...
@@ -8,8 +8,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -73,7 +72,7 @@ private static final long serialVersionUID = 1L;
...
@@ -73,7 +72,7 @@ private static final long serialVersionUID = 1L;
/**
/**
* 上报时间
* 上报时间
*/
*/
@JsonFormat
(
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
reportingTime
;
private
Date
reportingTime
;
/**
/**
* 状态
* 状态
...
...
src/main/java/com/elephant/framework/galaxy/aroad/module/roadcondition/controller/RoadConditionEventController.java
浏览文件 @
b6fce65b
...
@@ -44,12 +44,11 @@ public class RoadConditionEventController extends BaseController {
...
@@ -44,12 +44,11 @@ public class RoadConditionEventController extends BaseController {
*/
*/
@PostMapping
(
"/page"
)
@PostMapping
(
"/page"
)
public
R
getRoadConditionEventPage
(
public
R
getRoadConditionEventPage
(
Page
page
,
@RequestBody
RoadConditionEvent
roadConditionEvent
,
String
units
)
{
Page
page
,
@RequestBody
RoadConditionEvent
roadConditionEvent
)
{
// log.error("接收实体:{}", roadConditionEvent);
// log.error("接收实体:{}", roadConditionEvent);
page
.
setCurrent
(
roadConditionEvent
.
getCurrent
());
page
.
setCurrent
(
roadConditionEvent
.
getCurrent
());
page
.
setSize
(
roadConditionEvent
.
getSize
());
page
.
setSize
(
roadConditionEvent
.
getSize
());
units
=
""
;
return
new
R
<>(
roadConditionEventService
.
getRoadConditionEventPage
(
page
,
roadConditionEvent
));
return
new
R
<>(
roadConditionEventService
.
getRoadConditionEventPage
(
page
,
roadConditionEvent
,
units
));
}
}
@GetMapping
(
"/unitTree"
)
@GetMapping
(
"/unitTree"
)
...
@@ -167,12 +166,12 @@ public class RoadConditionEventController extends BaseController {
...
@@ -167,12 +166,12 @@ public class RoadConditionEventController extends BaseController {
* @return R
* @return R
*/
*/
@GetMapping
(
"/coordinates/{deptId}"
)
@GetMapping
(
"/coordinates/{deptId}"
)
public
R
getCoordinates
(
@PathVariable
(
"deptId"
)
String
deptId
)
{
public
R
getCoordinates
(
@PathVariable
(
"deptId"
)
String
deptId
)
{
return
new
R
<>(
roadConditionEventService
.
getCoordinates
(
deptId
));
return
new
R
<>(
roadConditionEventService
.
getCoordinates
(
deptId
));
}
}
@GetMapping
(
"/getunitbydept/{deptId}"
)
@GetMapping
(
"/getunitbydept/{deptId}"
)
public
R
getUnitByDept
(
@PathVariable
(
"deptId"
)
String
deptId
)
{
public
R
getUnitByDept
(
@PathVariable
(
"deptId"
)
String
deptId
)
{
return
new
R
<>(
roadConditionEventService
.
getUnitByDept
(
deptId
));
return
new
R
<>(
roadConditionEventService
.
getUnitByDept
(
deptId
));
}
}
...
@@ -205,19 +204,41 @@ public class RoadConditionEventController extends BaseController {
...
@@ -205,19 +204,41 @@ public class RoadConditionEventController extends BaseController {
*/
*/
@GetMapping
(
"/saveunitwithdept/{params}"
)
@GetMapping
(
"/saveunitwithdept/{params}"
)
public
R
saveUnitWithDept
(
@PathVariable
(
"params"
)
String
params
)
{
public
R
saveUnitWithDept
(
@PathVariable
(
"params"
)
String
params
)
{
return
new
R
<>
(
roadConditionEventService
.
saveUnitWithDept
(
params
));
return
new
R
<>(
roadConditionEventService
.
saveUnitWithDept
(
params
));
}
/**
* @description : 部门和管理单位权限管理
* @author : Xingyuyang
* @date : 2019/5/21 0021 11:28
* @param params :
* @return : com.elephant.framework.galaxy.aroad.response.R
*/
@GetMapping
(
"/saveemergencyunit/{params}"
)
public
R
saveEmergencyUnit
(
@PathVariable
(
"params"
)
String
params
)
{
return
new
R
<>(
roadConditionEventService
.
saveEmergencyUnit
(
params
));
}
@DeleteMapping
(
"/deleteemergencyunit/{eventId}"
)
public
R
deleteEmergencyUnit
(
@PathVariable
(
"eventId"
)
String
eventId
)
{
return
new
R
<>(
roadConditionEventService
.
deleteEmergencyUnit
(
eventId
));
}
@DeleteMapping
(
"/deleteemergencyevent/{eventId}"
)
public
R
deleteEmergencyEvent
(
@PathVariable
(
"eventId"
)
String
eventId
)
{
return
new
R
<>(
roadConditionEventService
.
deleteEmergencyEvent
(
eventId
));
}
}
/**
/**
* 通过id查询路况事件统计
* 通过id查询路况事件统计
*
*
* @param
id i
d
* @param
eventId eventI
d
* @return R
* @return R
*/
*/
@GetMapping
(
"/{
i
d}"
)
@GetMapping
(
"/{
eventI
d}"
)
public
R
getById
(
@PathVariable
(
"
id"
)
Integer
i
d
)
{
public
R
getById
(
@PathVariable
(
"
eventId"
)
String
eventI
d
)
{
// Integer idi = Integer.parseInt(id);
// Integer idi = Integer.parseInt(id);
return
new
R
<>(
roadConditionEventService
.
getById
(
i
d
));
return
new
R
<>(
roadConditionEventService
.
getById
(
eventI
d
));
}
}
/**
/**
...
@@ -247,13 +268,13 @@ public class RoadConditionEventController extends BaseController {
...
@@ -247,13 +268,13 @@ public class RoadConditionEventController extends BaseController {
/**
/**
* 通过id删除路况事件统计
* 通过id删除路况事件统计
*
*
* @param
id i
d
* @param
eventId eventI
d
* @return R
* @return R
*/
*/
@SysLog
(
"删除路况事件统计"
)
@SysLog
(
"删除路况事件统计"
)
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
public
R
removeById
(
@PathVariable
Integer
i
d
)
{
public
R
removeById
(
@PathVariable
String
eventI
d
)
{
return
new
R
<>(
roadConditionEventService
.
removeById
(
i
d
));
return
new
R
<>(
roadConditionEventService
.
removeById
(
eventI
d
));
}
}
/**
/**
...
...
src/main/java/com/elephant/framework/galaxy/aroad/module/roadcondition/dto/CoordinateDto.java
浏览文件 @
b6fce65b
...
@@ -19,7 +19,7 @@ import java.io.Serializable;
...
@@ -19,7 +19,7 @@ import java.io.Serializable;
@AllArgsConstructor
@AllArgsConstructor
public
class
CoordinateDto
implements
Serializable
{
public
class
CoordinateDto
implements
Serializable
{
/** 主键 */
/** 主键 */
private
int
i
d
;
private
String
eventI
d
;
/** 事件标题 */
/** 事件标题 */
private
String
eventTitle
;
private
String
eventTitle
;
/** 事件类型 */
/** 事件类型 */
...
...
src/main/java/com/elephant/framework/galaxy/aroad/module/roadcondition/dto/EmergencyUnitDto.java
0 → 100644
浏览文件 @
b6fce65b
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
roadcondition
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @program:
* @description: 坐标类
* @author: songwenjie
* @create: 2019-04-02 10:55
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
EmergencyUnitDto
implements
Serializable
{
/** 单位ID */
private
String
eventId
;
/** 部门ID */
private
String
emergencyEventId
;
}
src/main/java/com/elephant/framework/galaxy/aroad/module/roadcondition/entity/RoadConditionEvent.java
浏览文件 @
b6fce65b
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
roadcondition
.
entity
;
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
roadcondition
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
...
@@ -25,10 +23,6 @@ import java.util.Date;
...
@@ -25,10 +23,6 @@ import java.util.Date;
public
class
RoadConditionEvent
extends
Model
<
RoadConditionEvent
>
{
public
class
RoadConditionEvent
extends
Model
<
RoadConditionEvent
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** */
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"事件ID"
,
name
=
"eventId"
)
@ApiModelProperty
(
value
=
"事件ID"
,
name
=
"eventId"
)
private
String
eventId
;
private
String
eventId
;
/** 路线编码 */
/** 路线编码 */
...
@@ -128,4 +122,7 @@ public class RoadConditionEvent extends Model<RoadConditionEvent> {
...
@@ -128,4 +122,7 @@ public class RoadConditionEvent extends Model<RoadConditionEvent> {
/** 部门ID */
/** 部门ID */
@ApiModelProperty
(
value
=
"部门ID"
,
name
=
"deptId"
)
@ApiModelProperty
(
value
=
"部门ID"
,
name
=
"deptId"
)
private
String
deptId
;
private
String
deptId
;
/** 应急事件数量(0-否 1-是) **/
private
String
count
;
}
}
src/main/java/com/elephant/framework/galaxy/aroad/module/roadcondition/mapper/RoadConditionEventMapper.java
浏览文件 @
b6fce65b
...
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.elephant.framework.galaxy.aroad.module.roadcondition.dto.*
;
import
com.elephant.framework.galaxy.aroad.module.roadcondition.dto.*
;
import
com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent
;
import
com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent
;
import
org.apache.ibatis.annotations.Delete
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -16,7 +18,7 @@ import java.util.List;
...
@@ -16,7 +18,7 @@ import java.util.List;
*/
*/
public
interface
RoadConditionEventMapper
extends
BaseMapper
<
RoadConditionEvent
>
{
public
interface
RoadConditionEventMapper
extends
BaseMapper
<
RoadConditionEvent
>
{
IPage
<
RoadConditionEvent
>
getRoadConditionEventPage
(
IPage
<
RoadConditionEvent
>
getRoadConditionEventPage
(
IPage
<
RoadConditionEvent
>
page
,
RoadConditionEvent
roadConditionEvent
,
@Param
(
"units"
)
String
units
);
IPage
<
RoadConditionEvent
>
page
,
RoadConditionEvent
roadConditionEvent
,
@Param
(
"units"
)
List
units
);
List
<
SaveUnitDto
>
getUnitTree
();
List
<
SaveUnitDto
>
getUnitTree
();
...
@@ -34,7 +36,7 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
...
@@ -34,7 +36,7 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
List
<
DeptUnitDto
>
getUnitByDept
(
@Param
(
"deptId"
)
String
deptId
);
List
<
DeptUnitDto
>
getUnitByDept
(
@Param
(
"deptId"
)
String
deptId
);
List
<
CoordinateDto
>
getCoordinates
(
@Param
(
"units"
)
String
units
);
List
<
CoordinateDto
>
getCoordinates
(
@Param
(
"units"
)
List
units
);
List
<
CoordinateDto
>
getTQCoordinates
();
List
<
CoordinateDto
>
getTQCoordinates
();
...
@@ -54,13 +56,19 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
...
@@ -54,13 +56,19 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
*/
*/
List
<
CityNameDto
>
getTree
();
List
<
CityNameDto
>
getTree
();
RoadConditionEvent
getById
(
@Param
(
"
id"
)
Integer
i
d
);
RoadConditionEvent
getById
(
@Param
(
"
eventId"
)
String
eventI
d
);
boolean
saveUnitWithDept
(
@Insert
(
"insert into roadcondition_emergencyevent (dept_id, unit_id) values (#{deptId},#{unit})"
)
@Param
(
"deptId"
)
String
deptId
,
@Param
(
"unit"
)
String
unit
);
boolean
saveUnitWithDept
(
@Param
(
"deptId"
)
String
deptId
,
@Param
(
"unit"
)
String
unit
);
@Delete
(
"delete from roadcondition_emergencyevent where dept_id=#{deptId}"
)
boolean
deleteUnitByDept
(
@Param
(
"deptId"
)
String
deptId
);
boolean
deleteUnitByDept
(
@Param
(
"deptId"
)
String
deptId
);
@Insert
(
"INSERT INTO roadcondition_emergency ( event_id, emergency_event_id )\n"
+
"\t\tvalues (#{eventId},#{emergencyEventId})"
)
boolean
saveEmergencyUnit
(
@Param
(
"eventId"
)
String
eventId
,
@Param
(
"emergencyEventId"
)
String
emergencyEventId
);
/**
/**
* 查询数据库是否存在该实体
* 查询数据库是否存在该实体
*
*
...
@@ -85,7 +93,20 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
...
@@ -85,7 +93,20 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
*/
*/
Integer
deleteBatchByEvent
(
RoadConditionEvent
event
);
Integer
deleteBatchByEvent
(
RoadConditionEvent
event
);
@Insert
(
"\t\tINSERT INTO roadcondition_unit ( unit_id, unit_name )\n"
+
"\t\tSELECT start_unit_no, maintain_unit FROM road_condition_event\n"
+
"\t\tGROUP BY start_unit_no, maintain_unit"
)
boolean
saveUnit
();
boolean
saveUnit
();
@Delete
(
"delete from emergency_event where event_id=(select emergency_event_id from roadcondition_emergency where event_id=#{eventId})"
)
boolean
deleteEmergencyEvent
(
@Param
(
"eventId"
)
String
eventId
);
@Delete
(
"delete from roadcondition_emergency where event_id=#{eventId}"
)
boolean
deleteEmergencyUnit
(
@Param
(
"eventId"
)
String
eventId
);
@Delete
(
"delete from roadcondition_unit;"
)
boolean
deleteUnit
();
boolean
deleteUnit
();
@Delete
(
"delete from road_condition_event"
)
boolean
deleteEvent
();
}
}
src/main/java/com/elephant/framework/galaxy/aroad/module/roadcondition/service/RoadConditionEventService.java
浏览文件 @
b6fce65b
...
@@ -76,7 +76,7 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
...
@@ -76,7 +76,7 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
String
yccd
);
String
yccd
);
IPage
<
RoadConditionEvent
>
getRoadConditionEventPage
(
IPage
<
RoadConditionEvent
>
getRoadConditionEventPage
(
Page
<
RoadConditionEvent
>
page
,
RoadConditionEvent
roadConditionEvent
,
String
units
);
Page
<
RoadConditionEvent
>
page
,
RoadConditionEvent
roadConditionEvent
);
List
<
SaveUnitDto
>
getUnitTree
();
List
<
SaveUnitDto
>
getUnitTree
();
...
@@ -148,9 +148,15 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
...
@@ -148,9 +148,15 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
*/
*/
BaseTreeDto
getTree
();
BaseTreeDto
getTree
();
boolean
deleteEmergencyEvent
(
String
eventId
);
boolean
deleteEmergencyUnit
(
String
eventId
);
boolean
saveEmergencyUnit
(
String
params
);
boolean
saveUnitWithDept
(
String
params
);
boolean
saveUnitWithDept
(
String
params
);
RoadConditionEvent
getById
(
Integer
i
d
);
RoadConditionEvent
getById
(
String
eventI
d
);
List
<
CoordinateDto
>
getYHCoordinates
();
List
<
CoordinateDto
>
getYHCoordinates
();
...
@@ -167,4 +173,6 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
...
@@ -167,4 +173,6 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
boolean
saveUnit
();
boolean
saveUnit
();
boolean
deleteUnit
();
boolean
deleteUnit
();
boolean
deleteEvent
();
}
}
src/main/java/com/elephant/framework/galaxy/aroad/module/roadcondition/service/impl/GetRoadPlatformImpl.java
浏览文件 @
b6fce65b
...
@@ -41,42 +41,35 @@ public class GetRoadPlatformImpl implements GetRoadPlatformService {
...
@@ -41,42 +41,35 @@ public class GetRoadPlatformImpl implements GetRoadPlatformService {
Map
mapTypes
=
JSON
.
parseObject
(
res
);
Map
mapTypes
=
JSON
.
parseObject
(
res
);
if
(
mapTypes
!=
null
){
if
(
mapTypes
!=
null
){
roadConditionEventService
.
deleteUnit
();
roadConditionEventService
.
deleteUnit
();
roadConditionEventService
.
deleteEvent
();
}
}
for
(
Object
obj
:
mapTypes
.
keySet
())
{
for
(
Object
obj
:
mapTypes
.
keySet
())
{
JSONArray
ojb
=
(
JSONArray
)
mapTypes
.
get
(
"ROADINFO"
);
JSONArray
ojb
=
(
JSONArray
)
mapTypes
.
get
(
"ROADINFO"
);
Object
[]
array
=
ojb
.
toArray
();
Object
[]
array
=
ojb
.
toArray
();
for
(
Object
o
:
array
)
{
for
(
Object
o
:
array
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Integer
rowNum
=
null
;
// Integer rowNum = null;
rowNum
=
// rowNum =
roadConditionEventService
.
getRoadMaintainEventByRoadPlatform
(
// roadConditionEventService.getRoadMaintainEventByRoadPlatform(
// ((JSONObject) o).get("infid").toString(),
// // ((JSONObject) o).get("infid").toString(),
((
JSONObject
)
o
).
get
(
"inftypename"
).
toString
(),
// ((JSONObject) o).get("inftypename").toString(),
((
JSONObject
)
o
).
get
(
"inftitle"
).
toString
(),
// ((JSONObject) o).get("inftitle").toString(),
((
JSONObject
)
o
).
get
(
"infcontent"
).
toString
(),
// ((JSONObject) o).get("infcontent").toString(),
((
JSONObject
)
o
).
get
(
"infwrinter"
).
toString
(),
// ((JSONObject) o).get("infwrinter").toString(),
formatter
.
parse
(((
JSONObject
)
o
).
get
(
"writerdate"
).
toString
()),
// formatter.parse(((JSONObject) o).get("writerdate").toString()),
((
JSONObject
)
o
).
get
(
"infchecker"
).
toString
(),
// ((JSONObject) o).get("infchecker").toString(),
formatter
.
parse
(((
JSONObject
)
o
).
get
(
"checkdate"
).
toString
()),
// formatter.parse(((JSONObject) o).get("checkdate").toString()),
formatter
.
parse
(((
JSONObject
)
o
).
get
(
"removedate"
).
toString
().
equals
(
"null"
)?
"1900-01-01 00:00:00"
:((
JSONObject
)
o
).
get
(
"removedate"
).
toString
()),
// formatter.parse(((JSONObject)o).get("removedate").toString().equals("null")?"1900-01-01 00:00:00":((JSONObject) o).get("removedate").toString()),
// ((JSONObject) o).get("remark").toString(),
// ((JSONObject) o).get("glno").toString(),
((
JSONObject
)
o
).
get
(
"glno"
).
toString
(),
// ((JSONObject) o).get("writerno").toString(),
((
JSONObject
)
o
).
get
(
"writerno"
).
toString
(),
// ((JSONObject) o).get("loctx").toString(),
((
JSONObject
)
o
).
get
(
"loctx"
).
toString
(),
// ((JSONObject) o).get("locty").toString(),
((
JSONObject
)
o
).
get
(
"locty"
).
toString
(),
// ((JSONObject) o).get("zhuanghao").toString(),
((
JSONObject
)
o
).
get
(
"zhuanghao"
).
toString
(),
// ((JSONObject) o).get("daolu").toString(),
((
JSONObject
)
o
).
get
(
"daolu"
).
toString
(),
// ((JSONObject) o).get("yccd").toString());
// ((JSONObject) o).get("removereson").toString(),
// if (rowNum > 0) {
// ((JSONObject) o).get("departname").toString(),
// continue;
// ((JSONObject) o).get("removedepart").toString(),
// } else {
// formatter.parse(((JSONObject) o).get("expdate").toString()),
// ((JSONObject) o).get("impact").toString(),
// ((JSONObject) o).get("zhfrom").toString(),
// ((JSONObject) o).get("zhto").toString(),
((
JSONObject
)
o
).
get
(
"yccd"
).
toString
());
if
(
rowNum
>
0
)
{
continue
;
}
else
{
roadConditionEventService
.
save
(
roadConditionEventService
.
save
(
RoadConditionEvent
.
builder
()
RoadConditionEvent
.
builder
()
.
eventId
(((
JSONObject
)
o
).
get
(
"infid"
).
toString
())
.
eventId
(((
JSONObject
)
o
).
get
(
"infid"
).
toString
())
...
@@ -109,7 +102,7 @@ public class GetRoadPlatformImpl implements GetRoadPlatformService {
...
@@ -109,7 +102,7 @@ public class GetRoadPlatformImpl implements GetRoadPlatformService {
.
endBz
(
""
)
.
endBz
(
""
)
.
endPerson
(
""
)
.
endPerson
(
""
)
.
build
());
.
build
());
}
//
}
}
}
}
}
if
(
mapTypes
!=
null
){
if
(
mapTypes
!=
null
){
...
...
src/main/java/com/elephant/framework/galaxy/aroad/module/roadcondition/service/impl/RoadConditionEventServiceImpl.java
浏览文件 @
b6fce65b
...
@@ -39,7 +39,7 @@ public class RoadConditionEventServiceImpl
...
@@ -39,7 +39,7 @@ public class RoadConditionEventServiceImpl
*/
*/
public
Integer
getRoadMaintainEventByEventID
(
String
eventID
)
{
public
Integer
getRoadMaintainEventByEventID
(
String
eventID
)
{
return
roadConditionEventMapper
.
selectCount
(
return
roadConditionEventMapper
.
selectCount
(
Wrappers
.<
RoadConditionEvent
>
query
().
lambda
().
eq
(
RoadConditionEvent:
:
getId
,
eventID
));
Wrappers
.<
RoadConditionEvent
>
query
().
lambda
().
eq
(
RoadConditionEvent:
:
get
Event
Id
,
eventID
));
}
}
/**
/**
...
@@ -120,8 +120,30 @@ public class RoadConditionEventServiceImpl
...
@@ -120,8 +120,30 @@ public class RoadConditionEventServiceImpl
.
eq
(
RoadConditionEvent:
:
getCarsLength
,
yccd
));
.
eq
(
RoadConditionEvent:
:
getCarsLength
,
yccd
));
}
}
public
RoadConditionEvent
getById
(
@Param
(
"id"
)
Integer
id
)
{
public
RoadConditionEvent
getById
(
@Param
(
"eventId"
)
String
eventId
)
{
return
baseMapper
.
getById
(
id
);
return
baseMapper
.
getById
(
eventId
);
}
public
boolean
deleteEmergencyEvent
(
@Param
(
"eventId"
)
String
eventId
){
return
baseMapper
.
deleteEmergencyEvent
(
eventId
);
}
public
boolean
deleteEmergencyUnit
(
@Param
(
"eventId"
)
String
eventId
){
boolean
eFlag
=
baseMapper
.
deleteEmergencyEvent
(
eventId
);
boolean
uFlag
=
baseMapper
.
deleteEmergencyUnit
(
eventId
);
return
eFlag
&&
uFlag
;
// try{
//
// }catch (RuntimeException r){
// throw r;
// }
}
public
boolean
saveEmergencyUnit
(
@Param
(
"params"
)
String
params
){
String
[]
arr
=
params
.
split
(
","
);
String
eventId
=
arr
[
0
];
String
emergencyEventId
=
arr
[
1
];
return
baseMapper
.
saveEmergencyUnit
(
eventId
,
emergencyEventId
);
}
}
public
boolean
saveUnitWithDept
(
@Param
(
"params"
)
String
params
)
{
public
boolean
saveUnitWithDept
(
@Param
(
"params"
)
String
params
)
{
...
@@ -143,13 +165,13 @@ public class RoadConditionEventServiceImpl
...
@@ -143,13 +165,13 @@ public class RoadConditionEventServiceImpl
}
}
public
IPage
<
RoadConditionEvent
>
getRoadConditionEventPage
(
public
IPage
<
RoadConditionEvent
>
getRoadConditionEventPage
(
Page
<
RoadConditionEvent
>
page
,
RoadConditionEvent
roadConditionEvent
,
String
units
)
{
Page
<
RoadConditionEvent
>
page
,
RoadConditionEvent
roadConditionEvent
)
{
List
<
DeptUnitDto
>
unitList
=
baseMapper
.
getUnitByDept
(
roadConditionEvent
.
getDeptId
());
List
<
DeptUnitDto
>
unitList
=
baseMapper
.
getUnitByDept
(
roadConditionEvent
.
getDeptId
());
List
<
String
>
units
=
new
ArrayList
<>();
if
(
unitList
.
size
()
>
0
)
{
if
(
unitList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
unitList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
unitList
.
size
();
i
++)
{
units
+=
",'"
+
unitList
.
get
(
i
).
getUnitId
()
+
"'"
;
units
.
add
(
unitList
.
get
(
i
).
getUnitId
())
;
}
}
units
=
units
.
substring
(
1
,
units
.
length
());
}
}
return
baseMapper
.
getRoadConditionEventPage
(
page
,
roadConditionEvent
,
units
);
return
baseMapper
.
getRoadConditionEventPage
(
page
,
roadConditionEvent
,
units
);
}
}
...
@@ -228,12 +250,11 @@ public class RoadConditionEventServiceImpl
...
@@ -228,12 +250,11 @@ public class RoadConditionEventServiceImpl
// @Cacheable(value = "roadConditionCoordinates")
// @Cacheable(value = "roadConditionCoordinates")
public
List
<
CoordinateDto
>
getCoordinates
(
@Param
(
"deptId"
)
String
deptId
)
{
public
List
<
CoordinateDto
>
getCoordinates
(
@Param
(
"deptId"
)
String
deptId
)
{
List
<
DeptUnitDto
>
unitList
=
baseMapper
.
getUnitByDept
(
deptId
);
List
<
DeptUnitDto
>
unitList
=
baseMapper
.
getUnitByDept
(
deptId
);
String
units
=
""
;
List
<
String
>
units
=
new
ArrayList
<>()
;
if
(
unitList
.
size
()
>
0
)
{
if
(
unitList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
unitList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
unitList
.
size
();
i
++)
{
units
+=
",'"
+
unitList
.
get
(
i
).
getUnitId
()
+
"'"
;
units
.
add
(
unitList
.
get
(
i
).
getUnitId
())
;
}
}
units
=
units
.
substring
(
1
,
units
.
length
());
}
}
return
baseMapper
.
getCoordinates
(
units
);
return
baseMapper
.
getCoordinates
(
units
);
}
}
...
@@ -266,6 +287,10 @@ public class RoadConditionEventServiceImpl
...
@@ -266,6 +287,10 @@ public class RoadConditionEventServiceImpl
return
baseMapper
.
deleteUnit
();
return
baseMapper
.
deleteUnit
();
}
}
public
boolean
deleteEvent
(){
return
baseMapper
.
deleteEvent
();
}
/**
/**
* @description : 根据城市查询
* @description : 根据城市查询
* @author : Xingyuyang
* @author : Xingyuyang
...
...
src/main/resources/mapper/roadcondition/RoadConditionEventMapper.xml
浏览文件 @
b6fce65b
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
<resultMap
id=
"roadConditionEventMap"
<resultMap
id=
"roadConditionEventMap"
type=
"com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent"
>
type=
"com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"eventId"
column=
"event_id"
/>
<result
property=
"eventId"
column=
"event_id"
/>
<result
property=
"roadCode"
column=
"road_code"
/>
<result
property=
"roadCode"
column=
"road_code"
/>
<result
property=
"roadName"
column=
"road_name"
/>
<result
property=
"roadName"
column=
"road_name"
/>
...
@@ -38,6 +37,7 @@
...
@@ -38,6 +37,7 @@
<result
property=
"latitude"
column=
"latitude"
/>
<result
property=
"latitude"
column=
"latitude"
/>
<result
property=
"current"
column=
"current"
/>
<result
property=
"current"
column=
"current"
/>
<result
property=
"size"
column=
"size"
/>
<result
property=
"size"
column=
"size"
/>
<result
property=
"count"
column=
"count"
/>
</resultMap>
</resultMap>
<resultMap
id=
"staticByEventTypeMap"
<resultMap
id=
"staticByEventTypeMap"
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
<resultMap
id=
"CoordinateDtoMap"
<resultMap
id=
"CoordinateDtoMap"
type=
"com.elephant.framework.galaxy.aroad.module.roadcondition.dto.CoordinateDto"
>
type=
"com.elephant.framework.galaxy.aroad.module.roadcondition.dto.CoordinateDto"
>
<
id
column=
"id"
property=
"
id"
/>
<
result
property=
"eventId"
column=
"event_
id"
/>
<result
property=
"eventType"
column=
"event_type"
/>
<result
property=
"eventType"
column=
"event_type"
/>
<result
property=
"eventTitle"
column=
"event_title"
/>
<result
property=
"eventTitle"
column=
"event_title"
/>
<result
column=
"longitude"
property=
"longitude"
/>
<result
column=
"longitude"
property=
"longitude"
/>
...
@@ -104,39 +104,56 @@
...
@@ -104,39 +104,56 @@
<result
property=
"deptId"
column=
"dept_id"
/>
<result
property=
"deptId"
column=
"dept_id"
/>
</resultMap>
</resultMap>
<resultMap
id=
"EmergencyUnitMap"
type=
"com.elephant.framework.galaxy.aroad.module.roadcondition.dto.EmergencyUnitDto"
>
<result
property=
"eventId"
column=
"event_id"
/>
<result
property=
"emergencyEventId"
column=
"emergency_event_id"
/>
</resultMap>
<!-- <insert id="saveEmergencyUnit">-->
<!-- INSERT INTO roadcondition_emergency ( event_id, emergency_event_id )-->
<!-- values (#{eventId},#{emergencyEventId})-->
<!-- </insert>-->
<select
id=
"getUnitTree"
resultMap=
"SaveUnitMap"
>
<select
id=
"getUnitTree"
resultMap=
"SaveUnitMap"
>
select * from roadcondition_unit
select *
from roadcondition_unit
</select>
</select>
<delete
id=
"deleteUnit"
>
<!-- <insert id="saveUnit">-->
delete from roadcondition_unit;
<!-- INSERT INTO roadcondition_unit ( unit_id, unit_name )-->
</delete>
<!-- SELECT start_unit_no, maintain_unit FROM road_condition_event-->
<insert
id=
"saveUnit"
>
<!-- GROUP BY start_unit_no, maintain_unit-->
INSERT INTO roadcondition_unit ( unit_id, unit_name )
<!-- </insert>-->
SELECT start_unit_no, maintain_unit FROM road_condition_event
GROUP BY start_unit_no, maintain_unit
</insert>
<
delete
id=
"deleteUnitByDept"
>
<
!-- <delete id="deleteUnitByDept">--
>
delete from roadcondition_emergencyevent where dept_id=#{deptId}
<!-- delete from roadcondition_emergencyevent where dept_id=#{deptId}-->
<
/delete
>
<
!-- </delete>--
>
<
insert
id=
"saveUnitWithDept"
>
<
!-- <insert id="saveUnitWithDept">--
>
insert into roadcondition_emergencyevent (dept_id, unit_id) values (#{deptId},#{unit})
<!-- insert into roadcondition_emergencyevent (dept_id, unit_id) values (#{deptId},#{unit})-->
<
/insert
>
<
!-- </insert>--
>
<select
id=
"getRoadConditionEventPage"
resultMap=
"roadConditionEventMap"
<select
id=
"getRoadConditionEventPage"
resultMap=
"roadConditionEventMap"
parameterType=
"com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent"
>
parameterType=
"com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent"
>
SELECT
SELECT
rce.*,count(re.event_id) as count
*
FROM `road_condition_event` rce left join `roadcondition_emergency` re
FROM road_condition_event
on (rce.event_id = re.event_id)
<where>
<where>
<if
test=
"roadConditionEvent.startUnit != null"
>
maintain_unit like CONCAT('%',#{roadConditionEvent.startUnit},'%') and
</if>
<if
test=
"roadConditionEvent.startUnit != null"
>
maintain_unit like
<if
test=
"roadConditionEvent.eventType != null"
>
event_type like concat('%',#{roadConditionEvent.eventType},'%') and
</if>
CONCAT('%',#{roadConditionEvent.startUnit},'%') and
</if>
<if
test=
"roadConditionEvent.eventType != null"
>
event_type like
concat('%',#{roadConditionEvent.eventType},'%') and
</if>
<if
test=
"roadConditionEvent.influence != null"
>
influence = #{roadConditionEvent.influence} and
</if>
<if
test=
"roadConditionEvent.influence != null"
>
influence = #{roadConditionEvent.influence} and
</if>
<if
test=
"roadConditionEvent.startTime != null"
>
start_time
>
#{roadConditionEvent.startTime} and
</if>
<if
test=
"roadConditionEvent.startTime != null"
>
start_time
>
#{roadConditionEvent.startTime} and
</if>
<if
test=
"roadConditionEvent.endTime != null"
>
end_time
<
#{roadConditionEvent.endTime} and
</if>
<if
test=
"roadConditionEvent.endTime != null"
>
end_time
<
#{roadConditionEvent.endTime} and
</if>
start_unit_no in (#{units})
start_unit_no in
<foreach
item=
"item"
collection=
"units"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item}
</foreach>
group by event_id
</where>
</where>
</select>
</select>
...
@@ -148,7 +165,7 @@
...
@@ -148,7 +165,7 @@
<select
id=
"getById"
resultMap=
"roadConditionEventMap"
>
<select
id=
"getById"
resultMap=
"roadConditionEventMap"
>
SELECT *
SELECT *
FROM road_condition_event
FROM road_condition_event
where
id = #{i
d}
where
event_id = #{eventI
d}
</select>
</select>
<select
id=
"staticByEventType"
resultMap=
"staticByEventTypeMap"
>
<select
id=
"staticByEventType"
resultMap=
"staticByEventTypeMap"
>
...
@@ -184,15 +201,12 @@
...
@@ -184,15 +201,12 @@
</select>
</select>
<select
id=
"staticByCity"
resultMap=
"staticByCityMap"
>
<select
id=
"staticByCity"
resultMap=
"staticByCityMap"
>
SELECT
SELECT count(*) AS count,
count( * ) AS count,
# maintain_unit,
# maintain_unit,
SUBSTRING( maintain_unit FROM 1 FOR 2 ) as city
SUBSTRING(maintain_unit FROM 1 FOR 2) as city
FROM
FROM road_condition_event
road_condition_event
where SUBSTRING(maintain_unit FROM 1 FOR 2) != '山东'
where SUBSTRING( maintain_unit FROM 1 FOR 2 )!='山东'
GROUP BY maintain_unit
GROUP BY
maintain_unit
</select>
</select>
<select
id=
"staticByYHCity"
resultMap=
"staticByYHCityMap"
>
<select
id=
"staticByYHCity"
resultMap=
"staticByYHCityMap"
>
...
@@ -214,51 +228,49 @@
...
@@ -214,51 +228,49 @@
</select>
</select>
<select
id=
"getUnitByDept"
resultMap=
"DeptUnitMap"
>
<select
id=
"getUnitByDept"
resultMap=
"DeptUnitMap"
>
select unit_id from roadcondition_emergencyevent
select unit_id
from roadcondition_emergencyevent
where dept_id = #{deptId}
where dept_id = #{deptId}
</select>
</select>
<select
id=
"getCoordinates"
resultMap=
"CoordinateDtoMap"
>
<select
id=
"getCoordinates"
resultMap=
"CoordinateDtoMap"
parameterType=
"list"
>
select id, longitude, latitude, event_type,event_title
select
event_
id, longitude, latitude, event_type,event_title
from `road_condition_event`
from `road_condition_event`
where start_unit_no in (#{units});
where start_unit_no in
<foreach
item=
"item"
collection=
"units"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item}
</foreach>
</select>
</select>
<select
id=
"getTQCoordinates"
resultMap=
"CoordinateDtoMap"
>
<select
id=
"getTQCoordinates"
resultMap=
"CoordinateDtoMap"
>
select
id, longitude, latitude, event_type,
event_title
select
event_id, longitude, latitude, event_type,
event_title
from `road_condition_event`
from `road_condition_event`
where event_title = '异常天气';
where event_title = '异常天气';
</select>
</select>
<select
id=
"getYHCoordinates"
resultMap=
"roadConditionEventMap"
>
<select
id=
"getYHCoordinates"
resultMap=
"roadConditionEventMap"
>
select
id, longitude, latitude, event_type,
event_title
select
event_id, longitude, latitude, event_type,
event_title
from `road_condition_event`
from `road_condition_event`
where event_title = '养护施工';
where event_title = '养护施工';
</select>
</select>
<select
id=
"getTFCoordinates"
resultMap=
"CoordinateDtoMap"
>
<select
id=
"getTFCoordinates"
resultMap=
"CoordinateDtoMap"
>
select
id, longitude, latitude, event_type,
event_title
select
event_id, longitude, latitude, event_type,
event_title
from `road_condition_event`
from `road_condition_event`
where event_title = '突发事件';
where event_title = '突发事件';
</select>
</select>
<select
id=
"getSFZCoordinates"
resultMap=
"CoordinateDtoMap"
>
<select
id=
"getSFZCoordinates"
resultMap=
"CoordinateDtoMap"
>
select
id, longitude, latitude, event_type,
event_title
select
event_id, longitude, latitude, event_type,
event_title
from `road_condition_event`
from `road_condition_event`
where event_title = '收费站异常';
where event_title = '收费站异常';
</select>
</select>
<select
id=
"selectRoadMaintainEvent"
<select
id=
"selectRoadMaintainEvent"
parameterType=
"com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent"
resultMap=
"roadConditionEventMap"
>
parameterType=
"com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent"
resultMap=
"roadConditionEventMap"
>
SELECT * FROM road_condition_event
SELECT * FROM road_condition_event
WHERE
WHERE
<if
test=
"id != null"
>
id = #{id} AND
</if>
<if
test=
"id == null"
>
ISNULL(id) AND
</if>
<if
test=
"eventId != null"
>
<if
test=
"eventId != null"
>
event_id = #{eventId} AND
event_id = #{eventId} AND
</if>
</if>
...
@@ -475,12 +487,6 @@
...
@@ -475,12 +487,6 @@
parameterType=
"com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent"
>
parameterType=
"com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent"
>
UPDATE road_condition_event
UPDATE road_condition_event
WHERE
WHERE
<if
test=
"id != null"
>
id = #{id} AND
</if>
<if
test=
"id == null"
>
ISNULL(id) AND
</if>
<if
test=
"eventId != null"
>
<if
test=
"eventId != null"
>
event_id = #{eventId} AND
event_id = #{eventId} AND
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论