新增文件
parent
e6da1d36cc
commit
7b3737e83b
@ -0,0 +1,109 @@
|
||||
package com.ruoyi.basetyre.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.basetyre.domain.BaseElectronicFence;
|
||||
import com.ruoyi.basetyre.service.IBaseElectronicFenceService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 电子围栏Controller
|
||||
*
|
||||
* @author Yangwl
|
||||
* @date 2023-04-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basetyre/fence")
|
||||
public class BaseElectronicFenceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBaseElectronicFenceService baseElectronicFenceService;
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basetyre:fence:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseElectronicFence baseElectronicFence)
|
||||
{
|
||||
startPage();
|
||||
List<BaseElectronicFence> list = baseElectronicFenceService.selectBaseElectronicFenceList(baseElectronicFence);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电子围栏列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basetyre:fence:export')")
|
||||
@Log(title = "电子围栏", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseElectronicFence baseElectronicFence)
|
||||
{
|
||||
List<BaseElectronicFence> list = baseElectronicFenceService.selectBaseElectronicFenceList(baseElectronicFence);
|
||||
ExcelUtil<BaseElectronicFence> util = new ExcelUtil<BaseElectronicFence>(BaseElectronicFence.class);
|
||||
util.exportExcel(response, list, "电子围栏数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子围栏详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basetyre:fence:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(baseElectronicFenceService.selectBaseElectronicFenceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电子围栏
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basetyre:fence:add')")
|
||||
@Log(title = "电子围栏", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(List<BaseElectronicFence> baseElectronicFenceList)
|
||||
{
|
||||
for (BaseElectronicFence baseElectronicFence:
|
||||
baseElectronicFenceList ) {
|
||||
baseElectronicFenceService.insertBaseElectronicFence(baseElectronicFence);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basetyre:fence:edit')")
|
||||
@Log(title = "电子围栏", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseElectronicFence baseElectronicFence)
|
||||
{
|
||||
return toAjax(baseElectronicFenceService.updateBaseElectronicFence(baseElectronicFence));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电子围栏
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basetyre:fence:remove')")
|
||||
@Log(title = "电子围栏", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(baseElectronicFenceService.deleteBaseElectronicFenceByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.ruoyi.basetyre.controller;
|
||||
|
||||
import com.ruoyi.basetyre.domain.BaseCar;
|
||||
import com.ruoyi.basetyre.domain.BaseTyre;
|
||||
import com.ruoyi.basetyre.service.IBaseCarService;
|
||||
import com.ruoyi.basetyre.service.IBaseTyreService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/report")
|
||||
public class ReportController {
|
||||
@Autowired
|
||||
private IBaseCarService iBaseCarService;
|
||||
@Autowired
|
||||
private IBaseTyreService iBaseTyreService;
|
||||
@PostMapping("/indexreport")
|
||||
public AjaxResult indexreport()
|
||||
{
|
||||
Map map=new HashMap();
|
||||
List<BaseCar> baseCarList=iBaseCarService.selectBaseCarList(new BaseCar());
|
||||
map.put("carMap",baseCarList);
|
||||
map.put("carTotal",baseCarList.size());
|
||||
baseCarList=baseCarList.stream().filter(item-> !StringUtils.isBlank(item.getDeviceId())).collect(Collectors.toList());
|
||||
map.put("carBindGps",baseCarList.size());
|
||||
List<BaseTyre> baseTyreList =iBaseTyreService.selectBaseTyreList(new BaseTyre());
|
||||
map.put("tyreTotal",baseTyreList.size());
|
||||
baseTyreList=baseTyreList.stream().filter(item-> !StringUtils.isBlank(item.getSensorId())).collect(Collectors.toList());
|
||||
map.put("tyreBindSensor",baseTyreList.size());
|
||||
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
package com.ruoyi.basetyre.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电子围栏对象 base_electronic_fence
|
||||
*
|
||||
* @author Yangwl
|
||||
* @date 2023-04-07
|
||||
*/
|
||||
public class BaseElectronicFence extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 车辆id */
|
||||
@Excel(name = "车辆id")
|
||||
private String carId;
|
||||
|
||||
/** 维度 */
|
||||
@Excel(name = "维度")
|
||||
private Long latitude;
|
||||
|
||||
/** 经度 */
|
||||
@Excel(name = "经度")
|
||||
private Long longitude;
|
||||
|
||||
/** 创建人姓名 */
|
||||
@Excel(name = "创建人姓名")
|
||||
private String createName;
|
||||
|
||||
/** 编辑时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "编辑时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date modifyTime;
|
||||
|
||||
/** 编辑人 */
|
||||
@Excel(name = "编辑人")
|
||||
private String modifyBy;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String other1;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String other2;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCarId(String carId)
|
||||
{
|
||||
this.carId = carId;
|
||||
}
|
||||
|
||||
public String getCarId()
|
||||
{
|
||||
return carId;
|
||||
}
|
||||
public void setLatitude(Long latitude)
|
||||
{
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public Long getLatitude()
|
||||
{
|
||||
return latitude;
|
||||
}
|
||||
public void setLongitude(Long longitude)
|
||||
{
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public Long getLongitude()
|
||||
{
|
||||
return longitude;
|
||||
}
|
||||
public void setCreateName(String createName)
|
||||
{
|
||||
this.createName = createName;
|
||||
}
|
||||
|
||||
public String getCreateName()
|
||||
{
|
||||
return createName;
|
||||
}
|
||||
public void setModifyTime(Date modifyTime)
|
||||
{
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public Date getModifyTime()
|
||||
{
|
||||
return modifyTime;
|
||||
}
|
||||
public void setModifyBy(String modifyBy)
|
||||
{
|
||||
this.modifyBy = modifyBy;
|
||||
}
|
||||
|
||||
public String getModifyBy()
|
||||
{
|
||||
return modifyBy;
|
||||
}
|
||||
public void setOther1(String other1)
|
||||
{
|
||||
this.other1 = other1;
|
||||
}
|
||||
|
||||
public String getOther1()
|
||||
{
|
||||
return other1;
|
||||
}
|
||||
public void setOther2(String other2)
|
||||
{
|
||||
this.other2 = other2;
|
||||
}
|
||||
|
||||
public String getOther2()
|
||||
{
|
||||
return other2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("carId", getCarId())
|
||||
.append("latitude", getLatitude())
|
||||
.append("longitude", getLongitude())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createName", getCreateName())
|
||||
.append("modifyTime", getModifyTime())
|
||||
.append("modifyBy", getModifyBy())
|
||||
.append("remark", getRemark())
|
||||
.append("other1", getOther1())
|
||||
.append("other2", getOther2())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -1,10 +1,14 @@
|
||||
package com.ruoyi.basetyre.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class PatternTextureReport {
|
||||
private double textureDepth;
|
||||
private int course;
|
||||
private Data time;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
}
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.basetyre.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.basetyre.domain.BaseElectronicFence;
|
||||
|
||||
/**
|
||||
* 电子围栏Mapper接口
|
||||
*
|
||||
* @author Yangwl
|
||||
* @date 2023-04-07
|
||||
*/
|
||||
public interface BaseElectronicFenceMapper
|
||||
{
|
||||
/**
|
||||
* 查询电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
public BaseElectronicFence selectBaseElectronicFenceById(String id);
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 电子围栏集合
|
||||
*/
|
||||
public List<BaseElectronicFence> selectBaseElectronicFenceList(BaseElectronicFence baseElectronicFence);
|
||||
|
||||
/**
|
||||
* 新增电子围栏
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseElectronicFence(BaseElectronicFence baseElectronicFence);
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseElectronicFence(BaseElectronicFence baseElectronicFence);
|
||||
|
||||
/**
|
||||
* 删除电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseElectronicFenceById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除电子围栏
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseElectronicFenceByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.basetyre.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.basetyre.domain.BaseElectronicFence;
|
||||
|
||||
/**
|
||||
* 电子围栏Service接口
|
||||
*
|
||||
* @author Yangwl
|
||||
* @date 2023-04-07
|
||||
*/
|
||||
public interface IBaseElectronicFenceService
|
||||
{
|
||||
/**
|
||||
* 查询电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
public BaseElectronicFence selectBaseElectronicFenceById(String id);
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 电子围栏集合
|
||||
*/
|
||||
public List<BaseElectronicFence> selectBaseElectronicFenceList(BaseElectronicFence baseElectronicFence);
|
||||
|
||||
/**
|
||||
* 新增电子围栏
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseElectronicFence(BaseElectronicFence baseElectronicFence);
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseElectronicFence(BaseElectronicFence baseElectronicFence);
|
||||
|
||||
/**
|
||||
* 批量删除电子围栏
|
||||
*
|
||||
* @param ids 需要删除的电子围栏主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseElectronicFenceByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除电子围栏信息
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseElectronicFenceById(String id);
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.ruoyi.basetyre.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.basetyre.mapper.BaseElectronicFenceMapper;
|
||||
import com.ruoyi.basetyre.domain.BaseElectronicFence;
|
||||
import com.ruoyi.basetyre.service.IBaseElectronicFenceService;
|
||||
|
||||
/**
|
||||
* 电子围栏Service业务层处理
|
||||
*
|
||||
* @author Yangwl
|
||||
* @date 2023-04-07
|
||||
*/
|
||||
@Service
|
||||
public class BaseElectronicFenceServiceImpl implements IBaseElectronicFenceService
|
||||
{
|
||||
@Autowired
|
||||
private BaseElectronicFenceMapper baseElectronicFenceMapper;
|
||||
|
||||
/**
|
||||
* 查询电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
@Override
|
||||
public BaseElectronicFence selectBaseElectronicFenceById(String id)
|
||||
{
|
||||
return baseElectronicFenceMapper.selectBaseElectronicFenceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 电子围栏
|
||||
*/
|
||||
@Override
|
||||
public List<BaseElectronicFence> selectBaseElectronicFenceList(BaseElectronicFence baseElectronicFence)
|
||||
{
|
||||
return baseElectronicFenceMapper.selectBaseElectronicFenceList(baseElectronicFence);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电子围栏
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseElectronicFence(BaseElectronicFence baseElectronicFence)
|
||||
{
|
||||
baseElectronicFence.setCreateTime(DateUtils.getNowDate());
|
||||
return baseElectronicFenceMapper.insertBaseElectronicFence(baseElectronicFence);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*
|
||||
* @param baseElectronicFence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseElectronicFence(BaseElectronicFence baseElectronicFence)
|
||||
{
|
||||
return baseElectronicFenceMapper.updateBaseElectronicFence(baseElectronicFence);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除电子围栏
|
||||
*
|
||||
* @param ids 需要删除的电子围栏主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseElectronicFenceByIds(String[] ids)
|
||||
{
|
||||
return baseElectronicFenceMapper.deleteBaseElectronicFenceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电子围栏信息
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseElectronicFenceById(String id)
|
||||
{
|
||||
return baseElectronicFenceMapper.deleteBaseElectronicFenceById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
<?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.ruoyi.basetyre.mapper.BaseElectronicFenceMapper">
|
||||
|
||||
<resultMap type="BaseElectronicFence" id="BaseElectronicFenceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="carId" column="car_id" />
|
||||
<result property="latitude" column="latitude" />
|
||||
<result property="longitude" column="longitude" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createName" column="create_name" />
|
||||
<result property="modifyTime" column="modify_time" />
|
||||
<result property="modifyBy" column="modify_by" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="other1" column="other1" />
|
||||
<result property="other2" column="other2" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseElectronicFenceVo">
|
||||
select id, car_id, latitude, longitude, create_time, create_by, create_name, modify_time, modify_by, remark, other1, other2 from base_electronic_fence
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseElectronicFenceList" parameterType="BaseElectronicFence" resultMap="BaseElectronicFenceResult">
|
||||
<include refid="selectBaseElectronicFenceVo"/>
|
||||
<where>
|
||||
<if test="carId != null and carId != ''"> and car_id = #{carId}</if>
|
||||
<if test="latitude != null "> and latitude = #{latitude}</if>
|
||||
<if test="longitude != null "> and longitude = #{longitude}</if>
|
||||
<if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
|
||||
<if test="modifyTime != null "> and modify_time = #{modifyTime}</if>
|
||||
<if test="modifyBy != null and modifyBy != ''"> and modify_by = #{modifyBy}</if>
|
||||
<if test="other1 != null and other1 != ''"> and other1 = #{other1}</if>
|
||||
<if test="other2 != null and other2 != ''"> and other2 = #{other2}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseElectronicFenceById" parameterType="String" resultMap="BaseElectronicFenceResult">
|
||||
<include refid="selectBaseElectronicFenceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseElectronicFence" parameterType="BaseElectronicFence">
|
||||
insert into base_electronic_fence
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="carId != null">car_id,</if>
|
||||
<if test="latitude != null">latitude,</if>
|
||||
<if test="longitude != null">longitude,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createName != null">create_name,</if>
|
||||
<if test="modifyTime != null">modify_time,</if>
|
||||
<if test="modifyBy != null">modify_by,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="other1 != null">other1,</if>
|
||||
<if test="other2 != null">other2,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="carId != null">#{carId},</if>
|
||||
<if test="latitude != null">#{latitude},</if>
|
||||
<if test="longitude != null">#{longitude},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createName != null">#{createName},</if>
|
||||
<if test="modifyTime != null">#{modifyTime},</if>
|
||||
<if test="modifyBy != null">#{modifyBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="other1 != null">#{other1},</if>
|
||||
<if test="other2 != null">#{other2},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseElectronicFence" parameterType="BaseElectronicFence">
|
||||
update base_electronic_fence
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="carId != null">car_id = #{carId},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createName != null">create_name = #{createName},</if>
|
||||
<if test="modifyTime != null">modify_time = #{modifyTime},</if>
|
||||
<if test="modifyBy != null">modify_by = #{modifyBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="other1 != null">other1 = #{other1},</if>
|
||||
<if test="other2 != null">other2 = #{other2},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseElectronicFenceById" parameterType="String">
|
||||
delete from base_electronic_fence where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseElectronicFenceByIds" parameterType="String">
|
||||
delete from base_electronic_fence where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,9 +1,10 @@
|
||||
package com.ruoyi.framework.websocket;
|
||||
package com.ruoyi.common.websocket;
|
||||
|
||||
import java.util.concurrent.Semaphore;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
/**
|
||||
* 信号量相关处理
|
||||
*
|
@ -0,0 +1,28 @@
|
||||
package com.ruoyi.common.websocket;
|
||||
|
||||
import javax.websocket.Session;
|
||||
|
||||
public class WebSocketClient {
|
||||
// 与某个客户端的连接会话,需要通过它来给客户端发送数据
|
||||
private Session session;
|
||||
|
||||
//连接的uri
|
||||
private String uri;
|
||||
|
||||
public Session getSession() {
|
||||
return session;
|
||||
}
|
||||
|
||||
public void setSession(Session session) {
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
|
||||
public void setUri(String uri) {
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.ruoyi.common.websocket;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
/**
|
||||
* websocket 配置
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketConfig
|
||||
{
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter()
|
||||
{
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package com.ruoyi.framework.websocket;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
/**
|
||||
* websocket 配置
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketConfig
|
||||
{
|
||||
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter()
|
||||
{
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
// @Bean
|
||||
// public EchoSocketServer echoSocketServer(){
|
||||
// return new EchoSocketServer(8691);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue