fast()获取实时信息,重构电子围栏
parent
f878804bf7
commit
598dff8d71
|
@ -0,0 +1,102 @@
|
||||||
|
package com.business.common.dev;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆与电子围栏
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CarFenceDev {
|
||||||
|
private Long carId;
|
||||||
|
|
||||||
|
/** 车辆识别码 */
|
||||||
|
@Excel(name = "车辆识别码")
|
||||||
|
private String vin;
|
||||||
|
|
||||||
|
/** 品牌 */
|
||||||
|
@Excel(name = "品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
/** 型号 */
|
||||||
|
@Excel(name = "型号")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
/** 生产年份 */
|
||||||
|
@Excel(name = "生产年份")
|
||||||
|
private Long manufactureYear;
|
||||||
|
|
||||||
|
/** 车身类型 */
|
||||||
|
@Excel(name = "车身类型")
|
||||||
|
private String bodyType;
|
||||||
|
|
||||||
|
/** 车辆颜色 */
|
||||||
|
@Excel(name = "车辆颜色")
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
/** 发动机排量 */
|
||||||
|
@Excel(name = "发动机排量")
|
||||||
|
private Long engineCapacity;
|
||||||
|
|
||||||
|
/** 燃油类型 */
|
||||||
|
@Excel(name = "燃油类型")
|
||||||
|
private String fuelType;
|
||||||
|
|
||||||
|
/** 变速器类型 */
|
||||||
|
@Excel(name = "变速器类型")
|
||||||
|
private String transmission;
|
||||||
|
|
||||||
|
/** 驱动类型 */
|
||||||
|
@Excel(name = "驱动类型")
|
||||||
|
private String driveType;
|
||||||
|
|
||||||
|
/** 行驶里程 */
|
||||||
|
@Excel(name = "行驶里程")
|
||||||
|
private Long mileage;
|
||||||
|
|
||||||
|
/** 注册日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "注册日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date registrationDate;
|
||||||
|
|
||||||
|
/** 车牌号 */
|
||||||
|
@Excel(name = "车牌号")
|
||||||
|
private String registrationNumber;
|
||||||
|
|
||||||
|
/** 所有者 */
|
||||||
|
@Excel(name = "所有者")
|
||||||
|
private Long ownerId;
|
||||||
|
/**
|
||||||
|
* 电子围栏主键
|
||||||
|
*/
|
||||||
|
private Long fenceId;
|
||||||
|
/**
|
||||||
|
* 围栏名称
|
||||||
|
*/
|
||||||
|
private String fenceName;
|
||||||
|
/**
|
||||||
|
* 围栏类型
|
||||||
|
*/
|
||||||
|
private String fenceType = "多边形";
|
||||||
|
/**
|
||||||
|
* 驶入驶出
|
||||||
|
*/
|
||||||
|
private String eventType = "N";
|
||||||
|
/**
|
||||||
|
* 围栏状态
|
||||||
|
*/
|
||||||
|
private String staut = "Y";
|
||||||
|
/**
|
||||||
|
*坐标
|
||||||
|
*/
|
||||||
|
private String polygonPoints;
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.business.common.dev;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆与围栏组
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CarGroupsDev {
|
||||||
|
private Long carId;
|
||||||
|
|
||||||
|
/** 车辆识别码 */
|
||||||
|
@Excel(name = "车辆识别码")
|
||||||
|
private String vin;
|
||||||
|
|
||||||
|
/** 品牌 */
|
||||||
|
@Excel(name = "品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
/** 型号 */
|
||||||
|
@Excel(name = "型号")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
/** 生产年份 */
|
||||||
|
@Excel(name = "生产年份")
|
||||||
|
private Long manufactureYear;
|
||||||
|
|
||||||
|
/** 车身类型 */
|
||||||
|
@Excel(name = "车身类型")
|
||||||
|
private String bodyType;
|
||||||
|
|
||||||
|
/** 车辆颜色 */
|
||||||
|
@Excel(name = "车辆颜色")
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
/** 发动机排量 */
|
||||||
|
@Excel(name = "发动机排量")
|
||||||
|
private Long engineCapacity;
|
||||||
|
|
||||||
|
/** 燃油类型 */
|
||||||
|
@Excel(name = "燃油类型")
|
||||||
|
private String fuelType;
|
||||||
|
|
||||||
|
/** 变速器类型 */
|
||||||
|
@Excel(name = "变速器类型")
|
||||||
|
private String transmission;
|
||||||
|
|
||||||
|
/** 驱动类型 */
|
||||||
|
@Excel(name = "驱动类型")
|
||||||
|
private String driveType;
|
||||||
|
|
||||||
|
/** 行驶里程 */
|
||||||
|
@Excel(name = "行驶里程")
|
||||||
|
private Long mileage;
|
||||||
|
|
||||||
|
/** 注册日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "注册日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date registrationDate;
|
||||||
|
|
||||||
|
/** 车牌号 */
|
||||||
|
@Excel(name = "车牌号")
|
||||||
|
private String registrationNumber;
|
||||||
|
|
||||||
|
/** 所有者 */
|
||||||
|
@Excel(name = "所有者")
|
||||||
|
private Long ownerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组id
|
||||||
|
*/
|
||||||
|
private Long groupsId;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupsName;
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.business.common.dev;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组与电子围栏
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class GroupFenceDev {
|
||||||
|
/**
|
||||||
|
* 围栏组id
|
||||||
|
*/
|
||||||
|
private Long groupsId;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupsName;
|
||||||
|
/**
|
||||||
|
* 电子围栏主键
|
||||||
|
*/
|
||||||
|
private Long fenceId;
|
||||||
|
/**
|
||||||
|
* 围栏名称
|
||||||
|
*/
|
||||||
|
private String fenceName;
|
||||||
|
/**
|
||||||
|
* 围栏类型
|
||||||
|
*/
|
||||||
|
private String fenceType = "多边形";
|
||||||
|
/**
|
||||||
|
* 驶入驶出
|
||||||
|
*/
|
||||||
|
private String eventType = "N";
|
||||||
|
/**
|
||||||
|
* 围栏状态
|
||||||
|
*/
|
||||||
|
private String staut = "Y";
|
||||||
|
/**
|
||||||
|
*坐标
|
||||||
|
*/
|
||||||
|
private String polygonPoints;
|
||||||
|
}
|
|
@ -1,13 +1,18 @@
|
||||||
package com.muyu.goods.controller;
|
package com.muyu.goods.controller;
|
||||||
|
|
||||||
|
import com.business.common.dev.CarFenceDev;
|
||||||
|
import com.business.common.dev.CarGroupsDev;
|
||||||
|
import com.business.common.dev.GroupFenceDev;
|
||||||
import com.business.common.domain.Fence;
|
import com.business.common.domain.Fence;
|
||||||
import com.business.common.domain.FenceGroups;
|
import com.business.common.domain.FenceGroups;
|
||||||
import com.business.common.domain.Path;
|
import com.business.common.domain.Path;
|
||||||
import com.business.common.psvm.Pences;
|
import com.business.common.psvm.Pences;
|
||||||
|
import com.dtflys.forest.annotation.Post;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.goods.service.IMapService;
|
import com.muyu.goods.service.IMapService;
|
||||||
import com.muyu.goods.service.impl.MapService;
|
import com.muyu.goods.service.impl.MapService;
|
||||||
|
import net.sf.jsqlparser.statement.select.Select;
|
||||||
import org.apache.commons.codec.language.bm.Rule;
|
import org.apache.commons.codec.language.bm.Rule;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -88,4 +93,31 @@ public class MapController extends BaseController {
|
||||||
public Result updateFence(@PathVariable Long fenceId) {
|
public Result updateFence(@PathVariable Long fenceId) {
|
||||||
return success(iMapService.updateFence(fenceId));
|
return success(iMapService.updateFence(fenceId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆与电子围栏
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("selectCarFence")
|
||||||
|
public Result<List<CarFenceDev>> selectCarFence() {
|
||||||
|
return success(iMapService.selectCarFence());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆与围栏组
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("selectCarGroups")
|
||||||
|
public Result<List<CarGroupsDev>> selectCarGroups() {
|
||||||
|
return success(iMapService.selectCarGroups());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组与电子围栏
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("selectGroupFence")
|
||||||
|
public Result<List<GroupFenceDev>> selectGroupFence() {
|
||||||
|
return success(iMapService.selectGroupFence());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.muyu.goods.mapper;
|
package com.muyu.goods.mapper;
|
||||||
|
|
||||||
import com.business.common.domain.Car;
|
import com.business.common.dev.CarFenceDev;
|
||||||
|
import com.business.common.dev.CarGroupsDev;
|
||||||
|
import com.business.common.dev.GroupFenceDev;
|
||||||
import com.business.common.domain.Fence;
|
import com.business.common.domain.Fence;
|
||||||
import com.business.common.domain.FenceGroups;
|
import com.business.common.domain.FenceGroups;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
@ -18,4 +20,20 @@ public interface MapMapper {
|
||||||
Fence queryFence(@Param("fenceId") Long fenceId);
|
Fence queryFence(@Param("fenceId") Long fenceId);
|
||||||
|
|
||||||
int updateFence(@Param("fenceId") Long fenceId, @Param("status") String status);
|
int updateFence(@Param("fenceId") Long fenceId, @Param("status") String status);
|
||||||
|
|
||||||
|
void indexCarGroupsMiddle(@Param("carId") Long carId);
|
||||||
|
|
||||||
|
List<GroupFenceDev> selectGroupFenceMiddleOne();
|
||||||
|
|
||||||
|
List<CarFenceDev> selectCarFence();
|
||||||
|
|
||||||
|
List<CarGroupsDev> selectCarGroups();
|
||||||
|
|
||||||
|
List<GroupFenceDev> selectGroupFence();
|
||||||
|
|
||||||
|
void indexCarFence(@Param("carId") Long carId, @Param("fenceId") Long fenceId);
|
||||||
|
|
||||||
|
void deleteCarGroups(@Param("carId") Long carId);
|
||||||
|
|
||||||
|
void deleteCarFence(@Param("carId") Long carId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.muyu.goods.service;
|
package com.muyu.goods.service;
|
||||||
|
|
||||||
|
import com.business.common.dev.CarFenceDev;
|
||||||
|
import com.business.common.dev.CarGroupsDev;
|
||||||
|
import com.business.common.dev.GroupFenceDev;
|
||||||
import com.business.common.domain.Fence;
|
import com.business.common.domain.Fence;
|
||||||
import com.business.common.domain.FenceGroups;
|
import com.business.common.domain.FenceGroups;
|
||||||
import com.business.common.domain.Path;
|
import com.business.common.domain.Path;
|
||||||
|
@ -24,4 +27,10 @@ public interface IMapService {
|
||||||
Fence queryFence(Long fenceId);
|
Fence queryFence(Long fenceId);
|
||||||
|
|
||||||
String updateFence(Long fenceId);
|
String updateFence(Long fenceId);
|
||||||
|
|
||||||
|
List<CarFenceDev> selectCarFence();
|
||||||
|
|
||||||
|
List<CarGroupsDev> selectCarGroups();
|
||||||
|
|
||||||
|
List<GroupFenceDev> selectGroupFence();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.business.common.dev.LongitudeAndLatitude;
|
import com.business.common.dev.*;
|
||||||
import com.business.common.domain.*;
|
import com.business.common.domain.*;
|
||||||
import com.business.common.pojo.HttpCar;
|
import com.business.common.pojo.HttpCar;
|
||||||
import com.muyu.goods.client.ManageApi;
|
import com.muyu.goods.client.ManageApi;
|
||||||
|
@ -19,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆信息Service业务层处理
|
* 车辆信息Service业务层处理
|
||||||
*
|
*
|
||||||
|
@ -37,6 +39,8 @@ public class CarServiceImpl implements ICarService
|
||||||
private MapMapper mapMapper;
|
private MapMapper mapMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisTemplate<String,String> redisTemplate;
|
private RedisTemplate<String,String> redisTemplate;
|
||||||
|
@Resource
|
||||||
|
private ExecuteService service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询车辆信息
|
* 查询车辆信息
|
||||||
|
@ -94,6 +98,7 @@ public class CarServiceImpl implements ICarService
|
||||||
int i = carMapper.insertCar(car);
|
int i = carMapper.insertCar(car);
|
||||||
if (i>0) {
|
if (i>0) {
|
||||||
Car car1 = carMapper.carByCar();
|
Car car1 = carMapper.carByCar();
|
||||||
|
service.indexGroupFence(car1);
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +124,13 @@ public class CarServiceImpl implements ICarService
|
||||||
@Override
|
@Override
|
||||||
public int deleteCarByCarIds(Long[] carIds)
|
public int deleteCarByCarIds(Long[] carIds)
|
||||||
{
|
{
|
||||||
return carMapper.deleteCarByCarIds(carIds);
|
int i = carMapper.deleteCarByCarIds(carIds);
|
||||||
|
if (i>0){
|
||||||
|
for (Long carId : carIds) {
|
||||||
|
service.deleteCarGroupFence(carId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,7 +142,11 @@ public class CarServiceImpl implements ICarService
|
||||||
@Override
|
@Override
|
||||||
public int deleteCarByCarId(Long carId)
|
public int deleteCarByCarId(Long carId)
|
||||||
{
|
{
|
||||||
return carMapper.deleteCarByCarId(carId);
|
int i = carMapper.deleteCarByCarId(carId);
|
||||||
|
if (i>0) {
|
||||||
|
service.deleteCarGroupFence(carId);
|
||||||
|
}
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.muyu.goods.service.impl;
|
||||||
|
|
||||||
|
import com.business.common.dev.GroupFenceDev;
|
||||||
|
import com.business.common.domain.Car;
|
||||||
|
import com.muyu.goods.mapper.MapMapper;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Log4j2
|
||||||
|
public class ExecuteService {
|
||||||
|
@Autowired
|
||||||
|
private MapMapper mapMapper;
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void indexGroupFence(Car car) {
|
||||||
|
mapMapper.indexCarGroupsMiddle(car.getCarId());
|
||||||
|
List<GroupFenceDev> list = mapMapper.selectGroupFenceMiddleOne();
|
||||||
|
List<GroupFenceDev> groupFenceDevList = list.stream().filter(fence -> fence.getGroupsId() == 1).collect(Collectors.toList());
|
||||||
|
System.out.println(groupFenceDevList);
|
||||||
|
for (GroupFenceDev groupFenceDev : groupFenceDevList) {
|
||||||
|
mapMapper.indexCarFence(car.getCarId(),groupFenceDev.getFenceId());
|
||||||
|
}
|
||||||
|
log.info("indexGroupFence完成");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void deleteCarGroupFence(Long carId){
|
||||||
|
mapMapper.deleteCarGroups(carId);
|
||||||
|
mapMapper.deleteCarFence(carId);
|
||||||
|
log.info("delete完成");
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,9 @@ package com.muyu.goods.service.impl;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.business.common.dev.CarFenceDev;
|
||||||
|
import com.business.common.dev.CarGroupsDev;
|
||||||
|
import com.business.common.dev.GroupFenceDev;
|
||||||
import com.business.common.domain.Fence;
|
import com.business.common.domain.Fence;
|
||||||
import com.business.common.domain.FenceGroups;
|
import com.business.common.domain.FenceGroups;
|
||||||
import com.business.common.domain.Path;
|
import com.business.common.domain.Path;
|
||||||
|
@ -105,4 +108,19 @@ public class MapService implements IMapService {
|
||||||
}
|
}
|
||||||
return "失败";
|
return "失败";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CarFenceDev> selectCarFence() {
|
||||||
|
return mapMapper.selectCarFence();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CarGroupsDev> selectCarGroups() {
|
||||||
|
return mapMapper.selectCarGroups();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GroupFenceDev> selectGroupFence() {
|
||||||
|
return mapMapper.selectGroupFence();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="polygonPoints != null">#{polygonPoints},</if>
|
<if test="polygonPoints != null">#{polygonPoints},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="indexCarGroupsMiddle">
|
||||||
|
insert into car_groups_middle
|
||||||
|
values (0,#{carId},1);
|
||||||
|
</insert>
|
||||||
|
<insert id="indexCarFence">
|
||||||
|
insert into car_fence_middle
|
||||||
|
values (0,#{carId},#{fenceId});
|
||||||
|
</insert>
|
||||||
<update id="updateFence">
|
<update id="updateFence">
|
||||||
update fence
|
update fence
|
||||||
set staut = #{status}
|
set staut = #{status}
|
||||||
|
@ -58,6 +66,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from fence
|
from fence
|
||||||
where fence_id = #{fenceId};
|
where fence_id = #{fenceId};
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deleteCarGroups">
|
||||||
|
delete
|
||||||
|
from car_groups_middle
|
||||||
|
where car_id = #{carId};
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteCarFence">
|
||||||
|
delete
|
||||||
|
from car_fence_middle
|
||||||
|
where car_id = #{carId};
|
||||||
|
</delete>
|
||||||
<select id="selectFenceGroups" resultType="com.business.common.domain.FenceGroups">
|
<select id="selectFenceGroups" resultType="com.business.common.domain.FenceGroups">
|
||||||
<include refid="FenceGroupsVo"></include>
|
<include refid="FenceGroupsVo"></include>
|
||||||
</select>
|
</select>
|
||||||
|
@ -68,6 +86,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="FencesVo"></include>
|
<include refid="FencesVo"></include>
|
||||||
where fence_id = #{fenceId}
|
where fence_id = #{fenceId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectGroupFenceMiddleOne" resultType="com.business.common.dev.GroupFenceDev">
|
||||||
|
select g.*,f.* from fence f
|
||||||
|
left join group_fence_middle m on f.fence_id = m.fence_id
|
||||||
|
left join fence_groups g on m.groups_id = g.groups_id;
|
||||||
|
</select>
|
||||||
|
<select id="selectCarFence" resultType="com.business.common.dev.CarFenceDev">
|
||||||
|
select c.*,f.* from car c
|
||||||
|
left join car_fence_middle m on c.car_id = m.car_id
|
||||||
|
left join fence f on f.fence_id = m.fence_id
|
||||||
|
</select>
|
||||||
|
<select id="selectCarGroups" resultType="com.business.common.dev.CarGroupsDev">
|
||||||
|
select c.*,g.* from car c
|
||||||
|
left join car_groups_middle m on c.car_id = m.car_id
|
||||||
|
left join fence_groups g on m.groups_id = g.groups_id
|
||||||
|
</select>
|
||||||
|
<select id="selectGroupFence" resultType="com.business.common.dev.GroupFenceDev">
|
||||||
|
select g.*,f.* from fence f
|
||||||
|
left join group_fence_middle m on f.fence_id = m.fence_id
|
||||||
|
left join fence_groups g on m.groups_id = g.groups_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue