车辆实时轨迹
parent
82a3e58710
commit
4c9ff6ff05
|
@ -0,0 +1,32 @@
|
|||
package com.god.base.server.common.constants;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆信息
|
||||
*/
|
||||
public class VehicleConstant {
|
||||
|
||||
/**
|
||||
* 车辆启动
|
||||
*/
|
||||
public static final Integer VEHICLE_START = 1;
|
||||
/**
|
||||
* 车辆停止
|
||||
*/
|
||||
public static final Integer VEHICLE_END = 0 ;
|
||||
/**
|
||||
* 车辆状态更改队列
|
||||
*/
|
||||
public static final String VEHICLE_STATUS_UPDATE_QUEUE = "vehicle_status_update_queue";
|
||||
/**
|
||||
* 车辆信息前缀
|
||||
*/
|
||||
public static final String VEHICLE_INFO_MAP = "vehicle_info_map";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -12,8 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName Car
|
||||
* @Author WenHao.Sao
|
||||
* 车辆信息管理对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
@ -22,6 +21,8 @@ import java.util.Date;
|
|||
@TableName(value = "t_car")
|
||||
public class Car {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 车辆Vin 主键
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package com.god.base.server.common.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.god.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 车辆行驶记录对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("driving_record")
|
||||
@Builder
|
||||
public class DrivingRecord {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private long id;
|
||||
/**
|
||||
* vin
|
||||
*/
|
||||
private String vin;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "开始时间" , width = 30 , dateFormat = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "结束时间" , width = 30 , dateFormat = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 开始表示
|
||||
*/
|
||||
private String startKey;
|
||||
/**
|
||||
* 结束标识
|
||||
*/
|
||||
private String endKey;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id",getId())
|
||||
.append("vin",getVin())
|
||||
.append("startTime",getStartTime())
|
||||
.append("endTime",getEndKey())
|
||||
.append("startKey",getStartKey())
|
||||
.append("endKey",getEndKey())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ server:
|
|||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: god-car-management
|
||||
name: god-car-base
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.god.base.server.common.domain.Car;
|
||||
import com.god.base.server.common.domain.request.CarRequest;
|
||||
import com.god.base.server.service.CarService;
|
||||
import com.god.base.server.util.AopConfig;
|
||||
import com.god.common.core.domain.Result;
|
||||
import com.god.common.core.utils.poi.ExcelUtil;
|
||||
import com.god.common.core.web.controller.BaseController;
|
||||
|
@ -34,6 +35,9 @@ public class CarController extends BaseController {
|
|||
@Autowired
|
||||
private CarService carService;
|
||||
|
||||
@Autowired
|
||||
private AopConfig aopConfig;
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆信息管理列表
|
||||
|
@ -41,19 +45,10 @@ public class CarController extends BaseController {
|
|||
@RequiresPermissions
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Car>> list(@RequestBody CarRequest carRequest){
|
||||
log.info("功能介绍车辆信息列表查看,请求方式:{},请求路径:{},请求参数:{}",
|
||||
request.getMethod(),
|
||||
request.getRequestURL(),
|
||||
JSONObject.toJSONString(carRequest));
|
||||
|
||||
startPage();//设置请求分页数据
|
||||
List<Car> list = carService.selectCarInfoList(carRequest);
|
||||
|
||||
log.info("功能介绍车辆信息列表查看,响应方式:{},响应路径:{},响应参数:{}",
|
||||
request.getMethod(),
|
||||
request.getRequestURL(),
|
||||
JSONObject.toJSONString(list));
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
package com.god.base.server.controller;
|
||||
|
||||
import com.god.base.server.common.domain.DrivingRecord;
|
||||
import com.god.base.server.service.IDrivingRecordService;
|
||||
import com.god.common.core.domain.Result;
|
||||
import com.god.common.core.utils.poi.ExcelUtil;
|
||||
import com.god.common.core.web.controller.BaseController;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
import com.god.common.log.annotation.Log;
|
||||
import com.god.common.log.enums.BusinessType;
|
||||
import com.god.common.security.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆行驶记录 DrivingRecordController
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/record")
|
||||
public class DrivingRecordController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDrivingRecordService drivingRecordService;
|
||||
|
||||
/**
|
||||
* 查询车辆行驶记录
|
||||
*
|
||||
* @param drivingRecord
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("record:record:list")
|
||||
@GetMapping("list")
|
||||
public Result<TableDataInfo<DrivingRecord>> list(DrivingRecord drivingRecord){
|
||||
//设置请求分页数据
|
||||
startPage();
|
||||
List<DrivingRecord> list = drivingRecordService.selectDrivingRecordList(drivingRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出车辆行驶记录列表
|
||||
* @param response
|
||||
* @param drivingRecord
|
||||
*/
|
||||
@RequiresPermissions("record:record:export")
|
||||
@Log(title = "车辆行驶记录" , businessType = BusinessType.EXPORT) // 导出
|
||||
@PostMapping("export")
|
||||
public void export(HttpServletResponse response , DrivingRecord drivingRecord)
|
||||
{
|
||||
List<DrivingRecord> list = drivingRecordService.selectDrivingRecordList(drivingRecord);
|
||||
ExcelUtil<DrivingRecord> util = new ExcelUtil<>(DrivingRecord.class);
|
||||
//对list数据源将其里面的数据导入到excel表中
|
||||
util.exportExcel(response , list , "车辆行驶记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车辆行驶记录详细信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id){ //操作信息提醒
|
||||
//返回成功数据 | 查询车辆行驶记录
|
||||
return Result.success(drivingRecordService.selectDrivingRecordById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车辆行驶记录
|
||||
* @param drivingRecord
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("record:record:add")
|
||||
@Log(title = "车辆行驶记录" , businessType = BusinessType.INSERT) // 新增
|
||||
@PostMapping
|
||||
public Result add(@RequestBody DrivingRecord drivingRecord){
|
||||
//响应返回结果 | 新增车辆行驶记录
|
||||
return Result.success(drivingRecordService.insertDrivingRecord(drivingRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆行驶记录
|
||||
* @param drivingRecord
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("record:record:edit")
|
||||
@Log(title = "车辆行驶记录" , businessType = BusinessType.UPDATE) // 修改
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody DrivingRecord drivingRecord)
|
||||
{
|
||||
//响应返回结果 | 修改车辆行驶记录
|
||||
return Result.success(drivingRecordService.updateDrivingRecord(drivingRecord));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 车辆行驶记录的批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("record:record:remove")
|
||||
@Log(title = "车辆行驶记录" , businessType = BusinessType.DELETE) // 删除
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
//响应返回结果 | 批量删除车辆行驶记录
|
||||
return Result.success(drivingRecordService.deleteDrivingRecordByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.god.base.server.mapper;
|
||||
|
||||
import com.god.base.server.common.domain.DrivingRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆行驶轨迹 mapper 层
|
||||
*/
|
||||
@Mapper
|
||||
public interface DrivingRecordMapper {
|
||||
/**
|
||||
* 查询车辆行驶记录列表
|
||||
* @param drivingRecord
|
||||
* @return
|
||||
*/
|
||||
List<DrivingRecord> selectDrivingRecordList(DrivingRecord drivingRecord);
|
||||
|
||||
/**
|
||||
* 查询车辆行驶记录
|
||||
* @param id 车辆行驶主键
|
||||
* @return 车辆行驶记录
|
||||
*/
|
||||
DrivingRecord selectDrivingRecordById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 新增车辆行驶记录
|
||||
* @param drivingRecord
|
||||
* @return 结果
|
||||
*/
|
||||
int insertDrivingRecord(DrivingRecord drivingRecord);
|
||||
|
||||
/**
|
||||
* 修改车辆行驶记录
|
||||
* @param drivingRecord
|
||||
* @return 结果
|
||||
*/
|
||||
int updateDrivingRecord(DrivingRecord drivingRecord);
|
||||
|
||||
/**
|
||||
* 批量删除车辆行驶记录
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int deleteDrivingRecordByIds(@Param("ids") Long[] ids);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.god.base.server.service;
|
||||
|
||||
|
||||
import com.god.base.server.common.domain.DrivingRecord;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆行驶记录Service接口
|
||||
*/
|
||||
public interface IDrivingRecordService {
|
||||
|
||||
/**
|
||||
* 查询车辆行驶记录列表
|
||||
* @param drivingRecord
|
||||
* @return
|
||||
*/
|
||||
List<DrivingRecord> selectDrivingRecordList(DrivingRecord drivingRecord);
|
||||
|
||||
/**
|
||||
* 车辆行驶记录主键
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
DrivingRecord selectDrivingRecordById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 新增车辆行驶记录
|
||||
* @param drivingRecord 车辆行驶记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertDrivingRecord(DrivingRecord drivingRecord);
|
||||
|
||||
/**
|
||||
* 修改车辆行驶记录
|
||||
* @param drivingRecord 车辆行驶记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateDrivingRecord(DrivingRecord drivingRecord);
|
||||
|
||||
int deleteDrivingRecordByIds(Long[] ids);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.god.base.server.service.impl;
|
||||
|
||||
import com.god.base.server.common.domain.DrivingRecord;
|
||||
import com.god.base.server.mapper.DrivingRecordMapper;
|
||||
import com.god.base.server.service.IDrivingRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName IDrivingRecordServiceImpl
|
||||
* @Author WenHao.Sao
|
||||
*/
|
||||
|
||||
/**
|
||||
* 车辆行驶记录Service业务层处理
|
||||
*/
|
||||
public class IDrivingRecordServiceImpl implements IDrivingRecordService {
|
||||
|
||||
@Autowired
|
||||
private DrivingRecordMapper drivingRecordMapper;
|
||||
|
||||
@Override
|
||||
public List<DrivingRecord> selectDrivingRecordList(DrivingRecord drivingRecord) {
|
||||
return drivingRecordMapper.selectDrivingRecordList(drivingRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车辆行驶记录
|
||||
* @param id 车辆行驶记录主键
|
||||
* @return 车辆行驶记录
|
||||
*/
|
||||
@Override
|
||||
public DrivingRecord selectDrivingRecordById(Long id) {
|
||||
return drivingRecordMapper.selectDrivingRecordById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增车辆行驶记录
|
||||
* @param drivingRecord 车辆行驶记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDrivingRecord(DrivingRecord drivingRecord) {
|
||||
return drivingRecordMapper.insertDrivingRecord(drivingRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆行驶记录
|
||||
* @param drivingRecord 车辆行驶记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDrivingRecord(DrivingRecord drivingRecord) {
|
||||
//修改车辆行驶记录
|
||||
return drivingRecordMapper.updateDrivingRecord(drivingRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除车辆行驶记录
|
||||
* @param ids
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDrivingRecordByIds(Long[] ids) {
|
||||
//批量删除车辆行驶记录
|
||||
return drivingRecordMapper.deleteDrivingRecordByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.god.base.server.util;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
/**
|
||||
* aop切面 工具类
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class AopConfig {
|
||||
//日志打印
|
||||
private Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
ThreadLocal<Long> threadLocal = new ThreadLocal<>();
|
||||
|
||||
/**
|
||||
* @Description: 定义切面的那个类
|
||||
*/
|
||||
@Pointcut("execution(* com.god.base.server.controller.*.*(..))")
|
||||
public void print(){}
|
||||
|
||||
|
||||
@Around("print()")
|
||||
public Object LogStart(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
|
||||
threadLocal.set(System.currentTimeMillis());
|
||||
//使用ServletRequestAttributes请求上下文获取更多
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
String typeName = proceedingJoinPoint.getSignature().getDeclaringTypeName();
|
||||
String name = proceedingJoinPoint.getSignature().getName();
|
||||
//使用数据来获取参数
|
||||
Object[] pointArgs = proceedingJoinPoint.getArgs();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
logger.info("—_—方—_—_—法_—_—_—启—_—_—动—_—_—开—_—_—始—_—_—希—_—_—望—_—_—无—_—_—B—_—_—U—_—_—G—_—");
|
||||
logger.info("|调用前是: 【{}】", typeName);
|
||||
logger.info("|方法名称: 【{}】", name);
|
||||
logger.info("|传递参数: 【{}】", objectMapper.writeValueAsString(objectMapper));
|
||||
logger.info("|URL: 【{}】", request.getRequestURI().toString());
|
||||
logger.info("IP: 【{}】", request.getRemoteAddr());
|
||||
logger.info("______________________________________________________________________");
|
||||
|
||||
|
||||
Object proceed = proceedingJoinPoint.proceed();
|
||||
logger.info("|调用前是: 【{}】", typeName);
|
||||
logger.info("|方法名称: 【{}】", name);
|
||||
logger.info("|传递参数: 【{}】", objectMapper.writeValueAsString(objectMapper));
|
||||
logger.info("|URL: 【{}】", request.getRequestURI().toString());
|
||||
logger.info("IP: 【{}】", request.getRemoteAddr());
|
||||
logger.info("|耗时: 【{}】", System.currentTimeMillis() - threadLocal.get());
|
||||
|
||||
return proceed;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.god.base.server.mapper.DrivingRecordMapper">
|
||||
<resultMap id="DrivingRecordResult" type="com.god.base.server.common.domain.DrivingRecord">
|
||||
<result property="id" column="id"/>
|
||||
<result property="vin" column="vin"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="startKey" column="start_key"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="endKey" column="end_key"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectDrivingRecordVo">
|
||||
select id , vin ,start_time ,end_time , start_key , end_key , from driving_record
|
||||
</sql>
|
||||
|
||||
<!-- 查询车辆行驶记录列表-->
|
||||
<select id="selectDrivingRecordList" resultType="com.god.base.server.common.domain.DrivingRecord">
|
||||
<include refid="selectDrivingRecordVo"/>
|
||||
<where>
|
||||
<if test="vin != null and vin != '' "> and vin = #{vin} </if>
|
||||
<if test="startTime != null"> and start_time = #{startTime} </if>
|
||||
<if test="endTime != null"> and endTime = #{endTime} </if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 查询车辆行驶记录-->
|
||||
<select id="selectDrivingRecordById" resultType="com.god.base.server.common.domain.DrivingRecord">
|
||||
<include refid="selectDrivingRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 新增车辆行驶记录 -->
|
||||
<insert id="insertDrivingRecord" parameterType="com.god.base.server.common.domain.DrivingRecord" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into driving_record
|
||||
<trim prefix="(" suffix= ")" suffixOverrides=",">
|
||||
<if test="vin != null and vin != '' ">vin,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="startTime != null ">start_time,</if>
|
||||
<if test="endKey != null">end_key,</if>
|
||||
</trim>
|
||||
<trim prefix="values(" suffix=")" suffixOverrides=",">
|
||||
<if test="vin != null and vin != '' ">#{vin},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="startKey != null ">#{startKey},</if>
|
||||
<if test="endKey != null">#{endKey},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 修改车辆行驶记录-->
|
||||
<update id="updateDrivingRecord" parameterType="com.god.base.server.common.domain.DrivingRecord">
|
||||
update driving_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="vin != null and vin != '' ">vin = #{vin},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="startKey != null ">start_time = #{startKey},</if>
|
||||
<if test="endKey != null">end_key = #{endKey},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 批量删除车辆行驶数据-->
|
||||
<delete id="deleteDrivingRecordByIds" parameterType="String">
|
||||
delete from drving_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{ids}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue