Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
wangsixiang 1 year ago
parent
commit
d2e296b24d
  1. 8
      ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
  2. 80
      zc-business/src/main/java/com/zc/business/domain/DcBoardImgLane.java
  3. 4
      zc-business/src/main/java/com/zc/business/domain/DcEventAccident.java
  4. 150
      zc-business/src/main/java/com/zc/business/domain/ImageDTO.java
  5. 62
      zc-business/src/main/java/com/zc/business/enums/BoardIconEnum.java
  6. 49
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  7. 195
      zc-business/src/main/java/com/zc/business/utils/BoardImageUtils.java
  8. 9
      zc-business/src/main/resources/mapper/business/DcEventAccidentMapper.xml
  9. 2
      zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

8
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java

@ -138,4 +138,12 @@ public class RuoYiConfig
{ {
return getProfile() + "/protocol"; return getProfile() + "/protocol";
} }
/**
* 获取情报板下发图片路径
*/
public static String getBoardPath()
{
return getProfile() + "/boardTemplate";
}
} }

80
zc-business/src/main/java/com/zc/business/domain/DcBoardImgLane.java

@ -0,0 +1,80 @@
package com.zc.business.domain;
import com.zc.business.enums.BoardIconEnum;
/**
* @Description
*
* @author liuwenge
* @date 2024/2/27 17:07
*/
public class DcBoardImgLane {
//第一车道
private BoardIconEnum firstLane;
//第二车道
private BoardIconEnum secondLane;
//第三车道
private BoardIconEnum thirdLane;
//第四车道
private BoardIconEnum fourthLane;
//应急车道
private BoardIconEnum emergencyLane;
public BoardIconEnum getFirstLane() {
return firstLane;
}
public void setFirstLane(BoardIconEnum firstLane) {
this.firstLane = firstLane;
}
public BoardIconEnum getSecondLane() {
return secondLane;
}
public void setSecondLane(BoardIconEnum secondLane) {
this.secondLane = secondLane;
}
public BoardIconEnum getThirdLane() {
return thirdLane;
}
public void setThirdLane(BoardIconEnum thirdLane) {
this.thirdLane = thirdLane;
}
public BoardIconEnum getFourthLane() {
return fourthLane;
}
public void setFourthLane(BoardIconEnum fourthLane) {
this.fourthLane = fourthLane;
}
public BoardIconEnum getEmergencyLane() {
return emergencyLane;
}
public void setEmergencyLane(BoardIconEnum emergencyLane) {
this.emergencyLane = emergencyLane;
}
public DcBoardImgLane(){};
public DcBoardImgLane(BoardIconEnum firstLane, BoardIconEnum secondLane, BoardIconEnum thirdLane, BoardIconEnum fourthLane, BoardIconEnum emergencyLane){
this.firstLane = firstLane;
this.secondLane = secondLane;
this.thirdLane = thirdLane;
this.fourthLane = fourthLane;
this.emergencyLane = emergencyLane;
};
}

4
zc-business/src/main/java/com/zc/business/domain/DcEventAccident.java

@ -48,8 +48,8 @@ public class DcEventAccident extends BaseEntity {
* 5-自燃 * 5-自燃
* 6-追尾 * 6-追尾
*/ */
@ApiModelProperty("交通事故类型 * 1-侧翻* 2-撞障碍物* 3-货物洒落* 4-撞护栏* 5-自燃* 6-追尾") /* @ApiModelProperty("交通事故类型 * 1-侧翻* 2-撞障碍物* 3-货物洒落* 4-撞护栏* 5-自燃* 6-追尾")
private Long accidentType; private Long accidentType;*/
/** /**
* 地点方式 * 地点方式

150
zc-business/src/main/java/com/zc/business/domain/ImageDTO.java

@ -0,0 +1,150 @@
package com.zc.business.domain;
import sun.font.FontDesignMetrics;
import java.awt.*;
/**
* @Description:ruoyi
* @auther: Lenovo
* @date: 2024/2/2616:43
* @param: param
* @return: 结果
*/
public class ImageDTO {
//类型(0:文字,1:矩形)
private int type;
//文字内容
private String text;
//字体颜色和透明度
private Color color;
//字体和大小
private Font font;
//左上角起始点的x坐标
private int x;
//左上角起始点的y坐标
private int y;
//矩形宽度
private int rectWidth;
//矩形高度
private int rectHeight;
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Color getColor() {
return color;
}
public void setColor(Color color) {
this.color = color;
}
public Font getFont() {
return font;
}
public void setFont(Font font) {
this.font = font;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public int getRectWidth() {
return rectWidth;
}
public void setRectWidth(int rectWidth) {
this.rectWidth = rectWidth;
}
public int getRectHeight() {
return rectHeight;
}
public void setRectHeight(int rectHeight) {
this.rectHeight = rectHeight;
}
/**
* 创建文字ImageDTO, 每一个对象,代表在该图片中要插入的一段文字内容:
* @param text : 文本内容;
* @param color : 字体颜色(前三位)和透明度(第4位,值越小,越透明);
* @param font : 字体的样式和字体大小;
* @param x : 当前字体在该图片位置的横坐标;
* @param y : 当前字体在该图片位置的纵坐标;
* @return
*/
public static ImageDTO createImageDTO(String text,Color color,Font font,int x,int y){
ImageDTO imageDTO = new ImageDTO();
imageDTO.setType(0);
imageDTO.setText(text);
imageDTO.setColor(color);
imageDTO.setFont(font);
FontDesignMetrics metrics = FontDesignMetrics.getMetrics(font);
y = y + metrics.getAscent() - (metrics.getAscent() + metrics.getDescent() - font.getSize()) / 2;
imageDTO.setX(x);
imageDTO.setY(y);
return imageDTO;
}
public ImageDTO(){}
/**
* 创建ImageDTO, 每一个对象,代表在该图片中要插入的矩形:
* @param color : 颜色(前三位)和透明度(第4位,值越小,越透明);
* @param x : 当前矩形在该图片位置的横坐标;
* @param y : 当前矩形在该图片位置的纵坐标;
* @param rectWidth : 当前矩形的宽度;
* @param rectHeight : 当前矩形的高度;
* @return
*/
public static ImageDTO createRectImageDTO(Color color,int x,int y,int rectWidth,int rectHeight){
ImageDTO imageDTO = new ImageDTO();
imageDTO.setType(1);
imageDTO.setColor(color);
imageDTO.setX(x);
imageDTO.setY(y);
imageDTO.setRectWidth(rectWidth);
imageDTO.setRectHeight(rectHeight);
return imageDTO;
}
}

62
zc-business/src/main/java/com/zc/business/enums/BoardIconEnum.java

@ -0,0 +1,62 @@
package com.zc.business.enums;
/**
* 情报板车道图标枚举
* @author
*/
public enum BoardIconEnum {
// 直行标志
STRAIGHT_TRAVEL(1,"/zhixing.png"),
// 左侧绕行标志
LEFT_DETOUR(2,"/raozuo.png"),
// 右侧绕行标志
RIGHT_DETOUR(3,"/raoyou.png"),
// 禁行标志
LANE_PROHIBITION(4,"/jinxing.png"),
// 货车禁行
TRUCK_PROHIBITION(5,"/huochejinxing.png"),
// 应急车道标志
EMERGENCY_LANE(6,"/yingji.png"),
// 限速120
SPEED_LIMIT_120(7,"/xiansu120.png"),
// 限速100
SPEED_LIMIT_100(8,"/xiansu100.png"),
// 限速80
SPEED_LIMIT_80(9,"/xiansu80.png"),
// 限速60
SPEED_LIMIT_60(10,"/xiansu60.png"),
// 限速40
SPEED_LIMIT_40(11,"/xiansu40.png"),
// 限速30
SPEED_LIMIT_30(12,"/xiansu30.png");
private final int value;
private final String filePath;
BoardIconEnum(int value,String filePath) {
this.value = value;
this.filePath = filePath;
}
public int getValue() {
return this.value;
}
public String getFilePath() {
return this.filePath;
}
}

49
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -59,6 +59,9 @@ public class DcEventServiceImpl implements IDcEventService {
private ISysDeptService deptService; private ISysDeptService deptService;
@Autowired @Autowired
private IMiddleDatabaseService middleDatabaseService; private IMiddleDatabaseService middleDatabaseService;
//查询路网信息
@Autowired
private DcFacilityServiceImpl dcFacilityService;
/** /**
@ -113,6 +116,8 @@ public class DcEventServiceImpl implements IDcEventService {
*/ */
@Override @Override
public int insertDcEvent(DcEvent dcEvent) { public int insertDcEvent(DcEvent dcEvent) {
//获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType());
//设置事件Id UUID无下划线格式32 //设置事件Id UUID无下划线格式32
String uuid = IdUtils.fastSimpleUUID(); String uuid = IdUtils.fastSimpleUUID();
@ -124,6 +129,40 @@ public class DcEventServiceImpl implements IDcEventService {
dcEvent.setUserId(SecurityUtils.getUserId()); dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setCreateTime(DateUtils.getNowDate()); dcEvent.setCreateTime(DateUtils.getNowDate());
//处理无桩号事件
//交通事故
if (eventType ==1&& dcEvent.getDcEventAccident().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventAccident().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//车辆事故
if (eventType ==2 && dcEvent.getDcEventVehicleAccident().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventVehicleAccident().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//交通管制
if (eventType ==3 && dcEvent.getDcEventTrafficControl().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//交通拥堵
if (eventType ==4 && dcEvent.getDcEventTrafficCongestion().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//施工建设
if ( eventType ==7&& dcEvent.getDcEventConstruction().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventConstruction().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//服务区异常
if (eventType ==8 && dcEvent.getDcEventServiceArea().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventServiceArea().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
int i7 = dcEventMapper.insertDcEvent(dcEvent); int i7 = dcEventMapper.insertDcEvent(dcEvent);
if (i7 > 0) { if (i7 > 0) {
@ -131,14 +170,12 @@ public class DcEventServiceImpl implements IDcEventService {
//中间库 //中间库
MdEvent mdEvent = new MdEvent(dcEvent); MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent); middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
//获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType());
switch (eventType) { switch (eventType) {
//交通事故 //交通事故
case 1: case 1:
if (dcEvent.getDcEventAccident() != null) { if (dcEvent.getDcEventAccident() != null) {
dcEvent.getDcEventAccident().setId(uuid); dcEvent.getDcEventAccident().setId(uuid);
int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident()); int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident());
} }
@ -211,6 +248,12 @@ public class DcEventServiceImpl implements IDcEventService {
} }
} }
//根据路网设施查询桩号
private String extracted(String facilityId) {
DcFacility facility = dcFacilityService.getFacility(facilityId);
return facility.getStakeMark();
}
@Override @Override
public int insertDcEventWarning(DcEvent dcEvent) { public int insertDcEventWarning(DcEvent dcEvent) {
//设置事件Id UUID无下划线格式32 //设置事件Id UUID无下划线格式32

195
zc-business/src/main/java/com/zc/business/utils/BoardImageUtils.java

@ -0,0 +1,195 @@
package com.zc.business.utils;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.domain.DcBoardImgLane;
import com.zc.business.domain.ImageDTO;
import com.zc.business.enums.BoardIconEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* 情报板生成图片工具
*/
public class BoardImageUtils {
private static final Logger log = LoggerFactory.getLogger(BoardImageUtils.class);
//分辨率 宽度
private static final int width = 768;
//分辨率高度
private static final int height = 64;
//图标地址
private static final String templatePath = "D:\\ruoyi\\uploadPath\\boardTemplate";
// private static final String templatePath = RuoYiConfig.getBoardPath();
/**
* 事件场景
*
* @param list
*/
public static AjaxResult writeEventImage(List<ImageDTO> list) {
// String filePath = RuoYiConfig.getBoardPath() + "/boardImg.png";
String filePath = "C:/Users/Lenovo/Desktop/event.png";
FileOutputStream outImgStream = null;
try {
//创建图片
BufferedImage bufImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = bufImg.createGraphics();
//背景颜色
g.setBackground(Color.BLACK);
//编辑图片,插入要素
for (ImageDTO imgDTO : list) {
if (imgDTO.getType() == 0) {
//插入文本
g.setColor(imgDTO.getColor()); //根据图片的背景设置水印颜色
g.setFont(imgDTO.getFont()); //设置字体
g.drawString(imgDTO.getText(), imgDTO.getX(), imgDTO.getY()); //画出水印
} else if (imgDTO.getType() == 1){
//插入矩形
g.setColor(imgDTO.getColor());
g.fillRect(imgDTO.getX(),imgDTO.getY(),imgDTO.getRectWidth(),imgDTO.getRectHeight());
}
}
//事故图标
File srcImgFile = new File(templatePath + "/jinzhi.png");//得到文件
Image jinzhi = ImageIO.read(srcImgFile);//文件转化为图片
g.drawImage(jinzhi,534,17,30,30,null);
g.dispose();
// 输出图片
outImgStream = new FileOutputStream(filePath);
ImageIO.write(bufImg, "jpg", outImgStream);
} catch (Exception e) {
log.error("==== 系统异常::{} ====",e);
} finally {
try {
if (null != outImgStream){
outImgStream.flush();
outImgStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return AjaxResult.success(filePath);
}
/**
* 车道通行场景
*
* @param dcBoardImgLane
*/
public static AjaxResult writeLaneImage(DcBoardImgLane dcBoardImgLane) {
// String filePath = RuoYiConfig.getBoardPath() + "/boardImg.png";
String filePath = "C:/Users/Lenovo/Desktop/lane.png";
FileOutputStream outImgStream = null;
try {
//创建图片
BufferedImage bufImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = bufImg.createGraphics();
//背景颜色
g.setBackground(Color.BLACK);
//分割线图标
Image fenge = ImageIO.read(new File(templatePath + "/fenge.png"));//文件转化为图片
g.drawImage(fenge,150,4,8,56,null);
g.drawImage(fenge,304,4,8,56,null);
g.drawImage(fenge,458,4,8,56,null);
g.drawImage(fenge,612,4,8,56,null);
//第一车道
Image icon = ImageIO.read(new File(templatePath + dcBoardImgLane.getFirstLane().getFilePath()));
g.drawImage(icon,49,4,56,56,null);
//第二车道
icon = ImageIO.read(new File(templatePath + dcBoardImgLane.getSecondLane().getFilePath()));
g.drawImage(icon,203,4,56,56,null);
//第三车道
icon = ImageIO.read(new File(templatePath + dcBoardImgLane.getThirdLane().getFilePath()));
g.drawImage(icon,357,4,56,56,null);
//第四车道
icon = ImageIO.read(new File(templatePath + dcBoardImgLane.getFourthLane().getFilePath()));
g.drawImage(icon,511,4,56,56,null);
//应急车道
icon = ImageIO.read(new File(templatePath + dcBoardImgLane.getEmergencyLane().getFilePath()));
g.drawImage(icon,665,4,56,56,null);
g.dispose();
// 输出图片
outImgStream = new FileOutputStream(filePath);
ImageIO.write(bufImg, "jpg", outImgStream);
} catch (Exception e) {
log.error("==== 系统异常::{} ====",e);
} finally {
try {
if (null != outImgStream){
outImgStream.flush();
outImgStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return AjaxResult.success(filePath);
}
/**
* main方法:
* @param args
*/
public static void main(String[] args) {
//获取数据集合;
/*ArrayList<ImageDTO> list = new ArrayList<>();
list.add(ImageDTO.createRectImageDTO(new Color(0,255,0), 34, 26, 300,16));
list.add(ImageDTO.createRectImageDTO(new Color(255,255,0), 334, 26, 150,16));
list.add(ImageDTO.createRectImageDTO(new Color(255,0,0),484, 26,50,16));
list.add(ImageDTO.createRectImageDTO(new Color(0,255,0),534, 26,200,16));
list.add(ImageDTO.createImageDTO("前方5公里发生事故缓行10分钟",new Color(255,0,0),new Font("Default", Font.BOLD, 22), 34, 0));
list.add(ImageDTO.createImageDTO("长清收费站约5分钟到达",new Color(255,255,255),new Font("Default", Font.BOLD, 12 ), 296, 51));
//事件场景
BoardImageUtils.writeEventImage(list);*/
DcBoardImgLane boardImgLane = new DcBoardImgLane(BoardIconEnum.SPEED_LIMIT_120,BoardIconEnum.SPEED_LIMIT_120,BoardIconEnum.SPEED_LIMIT_100,BoardIconEnum.SPEED_LIMIT_100,BoardIconEnum.EMERGENCY_LANE);
//车道通行场景
BoardImageUtils.writeLaneImage(boardImgLane);
boardImgLane = new DcBoardImgLane(BoardIconEnum.STRAIGHT_TRAVEL,BoardIconEnum.LEFT_DETOUR,BoardIconEnum.LANE_PROHIBITION,BoardIconEnum.RIGHT_DETOUR,BoardIconEnum.EMERGENCY_LANE);
//车道通行场景
BoardImageUtils.writeLaneImage(boardImgLane);
//这句代码,自己项目中可以不用加,在这里防止main方法报错的;
System.exit(0);
}
}

9
zc-business/src/main/resources/mapper/business/DcEventAccidentMapper.xml

@ -7,7 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" /> <result property="id" column="id" />
<result property="reporterName" column="reporter_name" /> <result property="reporterName" column="reporter_name" />
<result property="reporterPhoneNumber" column="reporter_phone_number" /> <result property="reporterPhoneNumber" column="reporter_phone_number" />
<result property="accidentType" column="accident_type" /> <!--
-->
<result property="locationType" column="location_type" /> <result property="locationType" column="location_type" />
<result property="trafficJam" column="traffic_jam" /> <result property="trafficJam" column="traffic_jam" />
<result property="weatherCondition" column="weather_condition" /> <result property="weatherCondition" column="weather_condition" />
@ -35,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDcEventAccidentVo"> <sql id="selectDcEventAccidentVo">
select id, reporter_name, reporter_phone_number, accident_type, location_type, traffic_jam, weather_condition, impact_level, is_reverse_cargo, is_maintenance, police_contact, towing_service_contact, congestion_ahead, at_intersection, on_curve, spillage_item, vehicle_owner_phone, small_car, trucks, buses, tankers, minor_injuries, serious_injuries, fatalities, is_private, facility_id,location,ramp_id from dc_event_accident select id, reporter_name, reporter_phone_number, location_type, traffic_jam, weather_condition, impact_level, is_reverse_cargo, is_maintenance, police_contact, towing_service_contact, congestion_ahead, at_intersection, on_curve, spillage_item, vehicle_owner_phone, small_car, trucks, buses, tankers, minor_injuries, serious_injuries, fatalities, is_private, facility_id,location,ramp_id from dc_event_accident
</sql> </sql>
<select id="selectDcEventAccidentList" parameterType="DcEventAccident" resultMap="DcEventAccidentResult"> <select id="selectDcEventAccidentList" parameterType="DcEventAccident" resultMap="DcEventAccidentResult">
@ -43,7 +44,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="reporterName != null and reporterName != ''"> and reporter_name like concat('%', #{reporterName}, '%')</if> <if test="reporterName != null and reporterName != ''"> and reporter_name like concat('%', #{reporterName}, '%')</if>
<if test="reporterPhoneNumber != null and reporterPhoneNumber != ''"> and reporter_phone_number = #{reporterPhoneNumber}</if> <if test="reporterPhoneNumber != null and reporterPhoneNumber != ''"> and reporter_phone_number = #{reporterPhoneNumber}</if>
<if test="accidentType != null "> and accident_type = #{accidentType}</if>
<if test="locationType != null "> and location_type = #{locationType}</if> <if test="locationType != null "> and location_type = #{locationType}</if>
<if test="trafficJam != null "> and traffic_jam = #{trafficJam}</if> <if test="trafficJam != null "> and traffic_jam = #{trafficJam}</if>
<if test="weatherCondition != null "> and weather_condition = #{weatherCondition}</if> <if test="weatherCondition != null "> and weather_condition = #{weatherCondition}</if>
@ -80,7 +80,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">id,</if> <if test="id != null">id,</if>
<if test="reporterName != null and reporterName != ''">reporter_name,</if> <if test="reporterName != null and reporterName != ''">reporter_name,</if>
<if test="reporterPhoneNumber != null and reporterPhoneNumber != ''">reporter_phone_number,</if> <if test="reporterPhoneNumber != null and reporterPhoneNumber != ''">reporter_phone_number,</if>
<if test="accidentType != null">accident_type,</if>
<if test="locationType != null">location_type,</if> <if test="locationType != null">location_type,</if>
<if test="trafficJam != null">traffic_jam,</if> <if test="trafficJam != null">traffic_jam,</if>
<if test="weatherCondition != null">weather_condition,</if> <if test="weatherCondition != null">weather_condition,</if>
@ -110,7 +109,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
<if test="reporterName != null and reporterName != ''">#{reporterName},</if> <if test="reporterName != null and reporterName != ''">#{reporterName},</if>
<if test="reporterPhoneNumber != null and reporterPhoneNumber != ''">#{reporterPhoneNumber},</if> <if test="reporterPhoneNumber != null and reporterPhoneNumber != ''">#{reporterPhoneNumber},</if>
<if test="accidentType != null">#{accidentType},</if>
<if test="locationType != null">#{locationType},</if> <if test="locationType != null">#{locationType},</if>
<if test="trafficJam != null">#{trafficJam},</if> <if test="trafficJam != null">#{trafficJam},</if>
<if test="weatherCondition != null">#{weatherCondition},</if> <if test="weatherCondition != null">#{weatherCondition},</if>
@ -143,7 +141,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="reporterName != null and reporterName != ''">reporter_name = #{reporterName},</if> <if test="reporterName != null and reporterName != ''">reporter_name = #{reporterName},</if>
<if test="reporterPhoneNumber != null and reporterPhoneNumber != ''">reporter_phone_number = #{reporterPhoneNumber},</if> <if test="reporterPhoneNumber != null and reporterPhoneNumber != ''">reporter_phone_number = #{reporterPhoneNumber},</if>
<if test="accidentType != null">accident_type = #{accidentType},</if>
<if test="locationType != null">location_type = #{locationType},</if> <if test="locationType != null">location_type = #{locationType},</if>
<if test="trafficJam != null">traffic_jam = #{trafficJam},</if> <if test="trafficJam != null">traffic_jam = #{trafficJam},</if>
<if test="weatherCondition != null">weather_condition = #{weatherCondition},</if> <if test="weatherCondition != null">weather_condition = #{weatherCondition},</if>

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

@ -22,7 +22,7 @@
</select> </select>
<select id="getEventListByType" resultType="java.util.Map" parameterType="String"> <select id="getEventListByType" resultType="java.util.Map" parameterType="String">
select t1.id,t1.stake_mark stakeMark,t1.direction, t2.longitude,t2.latitude select t1.id,t1.stake_mark stakeMark,t1.direction,t1.lang, t2.longitude,t2.latitude
from dc_event t1 left join dc_stake_mark t2 on t1.stake_mark = t2.stake_mark and t1.direction = t2.direction from dc_event t1 left join dc_stake_mark t2 on t1.stake_mark = t2.stake_mark and t1.direction = t2.direction
where t1.event_type = #{eventType} and t1.event_state != '2' where t1.event_type = #{eventType} and t1.event_state != '2'
</select> </select>

Loading…
Cancel
Save