Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-dc into develop

develop
xiepufeng 1 year ago
parent
commit
b32ef54698
  1. 41
      zc-business/src/main/java/com/zc/business/controller/NonAutomaticWarningController.java
  2. 2
      zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java
  3. 2
      zc-business/src/main/java/com/zc/business/domain/DcEventVehicleAccident.java
  4. 21
      zc-business/src/main/java/com/zc/business/domain/DcWarning.java
  5. 2
      zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java
  6. 5
      zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java
  7. 2
      zc-business/src/main/resources/mapper/business/DcInfoBoardVocabularyMapper.xml
  8. 44
      zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml
  9. 2
      zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

41
zc-business/src/main/java/com/zc/business/controller/NonAutomaticWarningController.java

@ -7,7 +7,6 @@ import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig; import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.zc.business.domain.DcWarning; import com.zc.business.domain.DcWarning;
import com.zc.business.service.IDcWarningService; import com.zc.business.service.IDcWarningService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -102,12 +101,7 @@ public class NonAutomaticWarningController extends BaseController {
client.setCallback(new MqttCallback() { client.setCallback(new MqttCallback() {
public void connectionLost(Throwable cause) { public void connectionLost(Throwable cause) {
System.out.println("断开连接"); System.out.println("断开连接..........");
//try {
// eventSubscription();
//} catch (Exception e) {
// throw new RuntimeException(e);
//}
} }
public void messageArrived(String topic, MqttMessage message) { public void messageArrived(String topic, MqttMessage message) {
@ -122,18 +116,25 @@ public class NonAutomaticWarningController extends BaseController {
events.forEach(item -> { events.forEach(item -> {
JSONObject event = JSONObject.parseObject(String.valueOf(item)); JSONObject event = JSONObject.parseObject(String.valueOf(item));
JSONObject data = event.getJSONObject("data"); JSONObject data = event.getJSONObject("data");
String crossingIndexCode = event.getString("crossingIndexCode");
Date happenTime = event.getDate("happenTime"); Date happenTime = event.getDate("happenTime");
String srcName = event.getString("srcName").split("收费站")[1]; String srcName = event.getString("srcName").split("收费站")[0];
String illegalTrafficEvent = data.getString("illegalTrafficEvent"); String illegalTrafficEvent = data.getString("illegalTrafficEvent");
String directionName = data.getString("directionName"); String directionName = data.getString("directionName");
String crossingName = data.getString("crossingName"); String crossingName = data.getString("crossingName");
String targetPicUrl = data.getString("targetPicUrl"); String targetPicUrl = "https://10.0.81.28" + data.getString("targetPicUrl");
String laneNo = data.getString("laneNo");
ArrayList<String> pictures = new ArrayList<>();
pictures.add(targetPicUrl);
JSONObject jsonObject = new JSONObject();
jsonObject.put("pictures", pictures);
DcWarning dcWarning = new DcWarning(); DcWarning dcWarning = new DcWarning();
dcWarning.setOtherConfig(jsonObjString); dcWarning.setOtherConfig(String.valueOf(jsonObject));
dcWarning.setLane(laneNo);
String warningType = "";
switch (illegalTrafficEvent) { switch (illegalTrafficEvent) {
case "congestion"://拥堵 case "congestion"://拥堵
warningType = "拥堵";
dcWarning.setWarningType(1); dcWarning.setWarningType(1);
break; break;
//case "laneChange"://变道 //case "laneChange"://变道
@ -149,6 +150,7 @@ public class NonAutomaticWarningController extends BaseController {
// dcWarning.setWarningType(); // dcWarning.setWarningType();
// break; // break;
case "llegalParking"://停车 case "llegalParking"://停车
warningType = "停车";
dcWarning.setWarningType(4); dcWarning.setWarningType(4);
break; break;
//case "crossLane"://压线 //case "crossLane"://压线
@ -158,22 +160,29 @@ public class NonAutomaticWarningController extends BaseController {
// dcWarning.setWarningType(); // dcWarning.setWarningType();
// break; // break;
case "wrongDirection"://逆行 case "wrongDirection"://逆行
warningType = "逆行";
dcWarning.setWarningType(5); dcWarning.setWarningType(5);
break; break;
case "pedestrian"://行人 case "pedestrian"://行人
warningType = "行人";
dcWarning.setWarningType(2); dcWarning.setWarningType(2);
break; break;
case "abandonedObject"://抛洒物 case "abandonedObject"://抛洒物
warningType = "抛洒物";
dcWarning.setWarningType(7); dcWarning.setWarningType(7);
break; break;
default://其他 default://其他
warningType = "其他";
dcWarning.setWarningType(99); dcWarning.setWarningType(99);
} }
String direction = "";
if (Objects.equals(directionName, "上行")) { if (Objects.equals(directionName, "上行")) {
direction = "菏泽方向";
dcWarning.setDirection("1"); dcWarning.setDirection("1");
} else if (Objects.equals(directionName, "中")) { } else if (Objects.equals(directionName, "中")) {
dcWarning.setDirection("2"); dcWarning.setDirection("2");
} else if (Objects.equals(directionName, "下行")) { } else if (Objects.equals(directionName, "下行")) {
direction = "济南方向";
dcWarning.setDirection("3"); dcWarning.setDirection("3");
} }
dcWarning.setWarningTime(happenTime); dcWarning.setWarningTime(happenTime);
@ -199,7 +208,7 @@ public class NonAutomaticWarningController extends BaseController {
} else if (crossingName.startsWith("嘉祥")) { } else if (crossingName.startsWith("嘉祥")) {
dcWarning.setStakeMark("k190+495"); dcWarning.setStakeMark("k190+495");
} }
dcWarning.setWarningTitle(crossingName+srcName); dcWarning.setWarningTitle(srcName + "收费站" + direction + "发生" + warningType + "事件");
dcWarning.setWarningSource(6); dcWarning.setWarningSource(6);
dcWarning.setWarningState(1); dcWarning.setWarningState(1);
dcWarningService.insertDcWarning(dcWarning); dcWarningService.insertDcWarning(dcWarning);
@ -224,10 +233,10 @@ public class NonAutomaticWarningController extends BaseController {
//System.out.println("开始监听" + topicName.getString("6274883585")); //System.out.println("开始监听" + topicName.getString("6274883585"));
client.subscribe(topicName.getString("6274879489"), 1); client.subscribe(topicName.getString("6274879489"), 1);
System.out.println("开始监听" + topicName.getString("6274879489")); System.out.println("开始监听" + topicName.getString("6274879489"));
client.subscribe(topicName.getString("7768236033"), 1); //client.subscribe(topicName.getString("7768236033"), 1);
System.out.println("开始监听" + topicName.getString("7768236033")); //System.out.println("开始监听" + topicName.getString("7768236033"));
client.subscribe(topicName.getString("7835340801"), 1); //client.subscribe(topicName.getString("7835340801"), 1);
System.out.println("开始监听" + topicName.getString("7835340801")); //System.out.println("开始监听" + topicName.getString("7835340801"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

2
zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java

@ -77,7 +77,7 @@ public class DcEventTrafficControl extends BaseEntity
@ApiModelProperty("措施 1-临时关闭2-限行车辆3-限行车道4-限行车道且限行车辆5-间隔放行6-并道行驶 7-限速',") @ApiModelProperty("措施 1-临时关闭2-限行车辆3-限行车道4-限行车道且限行车辆5-间隔放行6-并道行驶 7-限速',")
private Long measure; //措施 private Long measure; //措施
@ApiModelProperty("分类 1-主线关闭2-主线限行3-主线间隔放行4-主线并道5-主线限速',") @ApiModelProperty("分类 1-主线关闭 2-主线限行3-主线间隔放行 4-主线并道 5-主线限速6-收费站关闭7-收费站限行8-收费站分流9-收费站间隔放行10-立交匝道关闭11-立交限行12-立交匝道限行13-立交分流14-服务区关闭,")
private Long classify; //分类 private Long classify; //分类
@ApiModelProperty("限制类型 1-只允许2-禁止',") @ApiModelProperty("限制类型 1-只允许2-禁止',")
private Long limitedType ;//限制类型 private Long limitedType ;//限制类型

2
zc-business/src/main/java/com/zc/business/domain/DcEventVehicleAccident.java

@ -78,8 +78,10 @@ public class DcEventVehicleAccident extends BaseEntity
3-行3 3-行3
4-行4 4-行4
*/ */
/*
@ApiModelProperty("车道占用:0-应急,1-行1 ,2-行2,3-行3,4-行4") @ApiModelProperty("车道占用:0-应急,1-行1 ,2-行2,3-行3,4-行4")
private Long laneOccupancy; private Long laneOccupancy;
*/
/** 小型车(辆) */ /** 小型车(辆) */
@ApiModelProperty("小型车(辆)") @ApiModelProperty("小型车(辆)")

21
zc-business/src/main/java/com/zc/business/domain/DcWarning.java

@ -59,7 +59,7 @@ public class DcWarning extends BaseEntity
private Integer warningType; private Integer warningType;
/** 事件子类:1-1 拥堵1-2 缓行 */ /** 事件子类:1-1 拥堵1-2 缓行 */
@Excel(name = "事件子类: 1-1 拥堵 1-2 缓行") @Excel(name = "事件子类: 1-1 拥堵 1-2 缓行 2-1 普通行人")
private String warningSubclass; private String warningSubclass;
/** 事件标题 */ /** 事件标题 */
@ -69,17 +69,16 @@ public class DcWarning extends BaseEntity
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "其它配置", readConverterExp = "$column.readConverterExp()")
private String otherConfig; private String otherConfig;
/** 车道0-应急 1-行1 2-行2 3-行3 4-行4 */ /** 车道0-应急 1-行1 2-行2 3-行3 4-行4 */
@Excel(name = "车道0-应急 1-行1 2-行2 3-行3 4-行4") @Excel(name = "车道0-应急 1-行1 2-行2 3-行3 4-行4")
private String lane; private String lane;
/** 所属辖区路段名称 */ /** 所属辖区路段名称 */
@Excel(name = "所属辖区路段名称")
private String sectionName; private String sectionName;
/** 数量 */ /** 数量 */
@Excel(name = "数量")
private int number; private int number;
private String type; private String type;
@ -89,8 +88,19 @@ public class DcWarning extends BaseEntity
private String latitude; private String latitude;
/** 车辆类型 */ /** 车辆类型 */
@Excel(name = "车辆类型") //@Excel(name = "车辆类型")
private String vehicleType; private String vehicleType;
/** 持续时长 */
@Excel(name = "持续时长(秒)")
private int duration;
public int getDuration() {
return duration;
}
public void setDuration(int duration) {
this.duration = duration;
}
public String getVehicleType() { public String getVehicleType() {
return vehicleType; return vehicleType;
@ -295,6 +305,7 @@ public class DcWarning extends BaseEntity
.append("warningSubclass", getWarningSubclass()) .append("warningSubclass", getWarningSubclass())
.append("warningTitle", getWarningTitle()) .append("warningTitle", getWarningTitle())
.append("otherConfig", getOtherConfig()) .append("otherConfig", getOtherConfig())
.append("duration", getDuration())
.toString(); .toString();
} }
} }

2
zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java

@ -35,7 +35,7 @@ public interface DcPerceivedEventsWarningMapper {
List<HashMap<String,Object>> selectWarningSourceGroup(DcWarning dcWarning); List<HashMap<String,Object>> selectWarningSourceGroup(DcWarning dcWarning);
String selectWarningSourceGroupCount(DcWarning dcWarning); String selectWarningSourceGroupCount(DcWarning dcWarning);
//当日感知事件的处置情况占比 //当日感知事件的处置情况占比
List<HashMap<String,Object>> selectWarningStateDay(DcWarning dcWarning); List<HashMap<String,Object>> selectWarningStateDay();
//感知事件类型占比 //感知事件类型占比
List<HashMap<String,Object>> selectWarningTypeDay(DcWarning dcWarning); List<HashMap<String,Object>> selectWarningTypeDay(DcWarning dcWarning);
//事件总数量 //事件总数量

5
zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java

@ -96,10 +96,7 @@ public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWa
//当日感知事件的处置情况占比 //当日感知事件的处置情况占比
@Override @Override
public List<HashMap<String, Object>> selectWarningStateDay() { public List<HashMap<String, Object>> selectWarningStateDay() {
DcWarning dcWarning = new DcWarning(); return perceivedEventsWarningMapper.selectWarningStateDay();
Date nowDate = DateUtils.getNowDate();
dcWarning.setCreateTime(nowDate);
return perceivedEventsWarningMapper.selectWarningStateDay(dcWarning);
} }
//感知事件类型占比 //感知事件类型占比
@Override @Override

2
zc-business/src/main/resources/mapper/business/DcInfoBoardVocabularyMapper.xml

@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDcInfoBoardVocabularyList" parameterType="DcInfoBoardVocabulary" resultMap="DcInfoBoardVocabularyResult"> <select id="selectDcInfoBoardVocabularyList" parameterType="DcInfoBoardVocabulary" resultMap="DcInfoBoardVocabularyResult">
<include refid="selectDcInfoBoardVocabularyVo"/> <include refid="selectDcInfoBoardVocabularyVo"/>
<where> <where>
<if test="word != null and word != ''"> and word = #{word}</if> <if test="word != null and word != ''"> and word like concat('%', #{word}, '%')</if>
</where> </where>
</select> </select>

44
zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

@ -15,6 +15,7 @@
</select> </select>
<select id="selectWarningById" resultType="com.zc.business.domain.DcWarning"> <select id="selectWarningById" resultType="com.zc.business.domain.DcWarning">
SELECT DISTINCT warning.`id`,warning.`stake_mark`, warning.`direction`, SELECT DISTINCT warning.`id`,warning.`stake_mark`, warning.`direction`,
warning.duration,
mark.longitude,mark.latitude,warning.lane,warning.vehicle_type vehicleType, mark.longitude,mark.latitude,warning.lane,warning.vehicle_type vehicleType,
warning.`dept_id`,warning.`warning_state`,warning.`warning_time`, warning.`dept_id`,warning.`warning_state`,warning.`warning_time`,
warning.`user_id`, warning.`warning_source`,warning.`warning_level`, warning.`user_id`, warning.`warning_source`,warning.`warning_level`,
@ -26,7 +27,7 @@
</select> </select>
<select id="selectPerceivedEventsList" resultType="com.zc.business.domain.DcWarning"> <select id="selectPerceivedEventsList" resultType="com.zc.business.domain.DcWarning">
SELECT warning.`id`,warning.`stake_mark`, warning.`direction`, SELECT warning.`id`,warning.`stake_mark`, warning.`direction`,
mark.longitude,mark.latitude,warning.lane, mark.longitude,mark.latitude,warning.lane,duration,
warning.`dept_id`,warning.`warning_state`,warning.`warning_time`, warning.`dept_id`,warning.`warning_state`,warning.`warning_time`,
warning.`user_id`, warning.`warning_source`,warning.`warning_level`, warning.`user_id`, warning.`warning_source`,warning.`warning_level`,
warning.`remark`, warning.`create_time`,warning.`update_time`, warning.`remark`, warning.`create_time`,warning.`update_time`,
@ -47,6 +48,7 @@
LEFT JOIN dc_road_section as s ON mark.section_id=s.id LEFT JOIN dc_road_section as s ON mark.section_id=s.id
where mark.stake_mark is not null where mark.stake_mark is not null
group by w.stake_mark group by w.stake_mark
HAVING number !=0
order by number desc order by number desc
</select> </select>
<select id="selectSectionPerceivedNumber" resultType="java.util.HashMap"> <select id="selectSectionPerceivedNumber" resultType="java.util.HashMap">
@ -58,6 +60,7 @@
LEFT JOIN dc_road_section as s ON mark.section_id=s.id LEFT JOIN dc_road_section as s ON mark.section_id=s.id
where mark.stake_mark is not null where mark.stake_mark is not null
group by w.stake_mark group by w.stake_mark
HAVING number !=0
</select> </select>
<select id="selectDailyCumulative" resultType="java.util.HashMap"> <select id="selectDailyCumulative" resultType="java.util.HashMap">
SELECT DATE_FORMAT(create_time, '%Y-%m-%d %H') AS time, COUNT(*) AS number SELECT DATE_FORMAT(create_time, '%Y-%m-%d %H') AS time, COUNT(*) AS number
@ -84,9 +87,17 @@
where DATE_FORMAT(create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') where DATE_FORMAT(create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d')
</select> </select>
<select id="selectWarningStateDay" resultType="java.util.HashMap"> <select id="selectWarningStateDay" resultType="java.util.HashMap">
SELECT warning_state warningState,COUNT(*) AS number FROM dc_warning select t1.warningState,t1.warningStateName,IFNULL(t2.num,0)number from
where DATE_FORMAT(create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') (select '1' as warningState,'上报' as warningStateName
GROUP BY warning_state UNION ALL select '2' as warningState,'已完成' as warningStateName
UNION ALL select '3' as warningState,'已终止' as warningStateName
UNION ALL select '4' as warningState,'自动结束' as warningStateName) t1
LEFT JOIN
(SELECT warning_state warningState,count(*) num
from dc_warning
where DATE_FORMAT(create_time,'%Y-%m-%d')=DATE_FORMAT(now(),'%Y-%m-%d')
GROUP BY warning_state)t2
on t1.warningState=t2.warningState
</select> </select>
<select id="selectWarningTypeDay" resultType="java.util.HashMap"> <select id="selectWarningTypeDay" resultType="java.util.HashMap">
SELECT warning_type warningType,COUNT(*) AS number FROM dc_warning SELECT warning_type warningType,COUNT(*) AS number FROM dc_warning
@ -98,7 +109,7 @@
FROM dc_warning AS warning FROM dc_warning AS warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') WHERE DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
AND mark.`section_id`=#{sectionId} AND mark.`section_id`=#{sectionId}
GROUP BY time GROUP BY time
</select> </select>
@ -107,7 +118,7 @@
FROM dc_warning as warning FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m') WHERE DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId} and mark.`section_id`=#{sectionId}
GROUP BY day GROUP BY day
ORDER BY day ORDER BY day
@ -125,7 +136,7 @@
FROM dc_warning as warning FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y') WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId} and mark.`section_id`=#{sectionId}
GROUP BY QUARTER, MONTH GROUP BY QUARTER, MONTH
ORDER BY QUARTER, MONTH; ORDER BY QUARTER, MONTH;
@ -135,7 +146,7 @@
SELECT month(warning.create_time) AS month, COUNT(*) AS number SELECT month(warning.create_time) AS month, COUNT(*) AS number
FROM dc_warning as warning FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction}
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y')
GROUP BY month GROUP BY month
</select> </select>
@ -143,7 +154,7 @@
SELECT COUNT(*) AS number FROM dc_warning as warning SELECT COUNT(*) AS number FROM dc_warning as warning
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark
where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId} and mark.`section_id`=#{sectionId}
</select> </select>
<select id="selectWarningSectionTypeDay" resultType="java.util.HashMap"> <select id="selectWarningSectionTypeDay" resultType="java.util.HashMap">
@ -152,7 +163,7 @@
FROM dc_warning as warning FROM dc_warning as warning
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark
where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId} and mark.`section_id`=#{sectionId}
GROUP BY warning_type GROUP BY warning_type
ORDER BY number DESC ORDER BY number DESC
@ -161,7 +172,7 @@
SELECT COUNT(*) AS number FROM dc_warning as warning SELECT COUNT(*) AS number FROM dc_warning as warning
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark
where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m') where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId} and mark.`section_id`=#{sectionId}
</select> </select>
<select id="selectWarningSectionTypeMonth" resultType="java.util.HashMap"> <select id="selectWarningSectionTypeMonth" resultType="java.util.HashMap">
@ -169,7 +180,7 @@
FROM dc_warning as warning FROM dc_warning as warning
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark
where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m') where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId} and mark.`section_id`=#{sectionId}
GROUP BY warning_type GROUP BY warning_type
ORDER BY number DESC ORDER BY number DESC
@ -180,7 +191,7 @@
FROM dc_warning as warning FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y') WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId} and mark.`section_id`=#{sectionId}
</select> </select>
<select id="selectWarningSectionTypeQuarter" resultType="java.util.HashMap"> <select id="selectWarningSectionTypeQuarter" resultType="java.util.HashMap">
@ -196,7 +207,7 @@
FROM dc_warning as warning FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y') WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y')
AND warning.direction=#{direction} AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId} and mark.`section_id`=#{sectionId}
GROUP BY QUARTER, warningType GROUP BY QUARTER, warningType
ORDER BY QUARTER; ORDER BY QUARTER;
@ -204,7 +215,7 @@
<select id="selectWarningSectionTypeYearCount" resultType="java.lang.String"> <select id="selectWarningSectionTypeYearCount" resultType="java.lang.String">
SELECT COUNT(*) AS number FROM dc_warning as warning SELECT COUNT(*) AS number FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction}
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y')
</select> </select>
@ -212,7 +223,7 @@
SELECT warning.warning_type warningType, COUNT(*) AS number SELECT warning.warning_type warningType, COUNT(*) AS number
FROM dc_warning as warning FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction}
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y')
GROUP BY warningType GROUP BY warningType
</select> </select>
@ -309,6 +320,7 @@
<if test = 'type == "year"' >and YEAR(w.create_time) =DATE_FORMAT(#{createTime},'%Y')</if> <if test = 'type == "year"' >and YEAR(w.create_time) =DATE_FORMAT(#{createTime},'%Y')</if>
AND w.direction = #{direction}) sectionNumber FROM dc_stake_mark AS m AND w.direction = #{direction}) sectionNumber FROM dc_stake_mark AS m
WHERE m.section_id = #{sectionId} WHERE m.section_id = #{sectionId}
HAVING sectionNumber!=0
</select> </select>

2
zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

@ -120,7 +120,7 @@
) t1 ) t1
LEFT JOIN LEFT JOIN
(SELECT (SELECT
hour(create_time) hours, hour(start_time) hours,
count(*) num count(*) num
FROM dc_event FROM dc_event
WHERE date_format(start_time, '%Y-%m-%d') = current_date WHERE date_format(start_time, '%Y-%m-%d') = current_date

Loading…
Cancel
Save