Commit 9bc23146 authored by caotao's avatar caotao

车辆统计页面接口提交

parent 5282006a
package com.yeejoin.equipmanage.common.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import org.joda.time.DateTime;
import java.util.Date;
/**
* 消防车信息
*
* @author wujiang
* @date 2020-07-07
*/
@Data
public class CarEquipAlarmInfoDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "序号")
private Integer no;
@ApiModelProperty(value = "告警车辆")
private String carNum;
@ApiModelProperty(value = "扩展字段2")
private String extra2;
@ApiModelProperty(value = "告警时间")
private String alarmDate = new DateTime().toLocalDate().toString();
@ApiModelProperty(value = "告警信息")
private String alarmMessage = "该设备电量低!";
}
package com.yeejoin.equipmanage.common.entity.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentOnCarAppVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.List;
/**
* 消防车信息
*
* @author wujiang
* @date 2020-07-07
*/
@Data
public class CarEquipStateInfoDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "车牌号")
private String carNum;
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ApiModelProperty(value = "扩展字段2")
private String extra2;
@ApiModelProperty(value = "设备状态")
private String equipState;
}
......@@ -12,6 +12,8 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.equipmanage.common.dto.CarInfoDto;
import com.yeejoin.equipmanage.common.dto.CarStatusInfoDto;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.dto.CarEquipAlarmInfoDto;
import com.yeejoin.equipmanage.common.entity.dto.CarEquipStateInfoDto;
import com.yeejoin.equipmanage.common.entity.dto.CommonFile;
import com.yeejoin.equipmanage.common.entity.publics.CommonResponse;
import com.yeejoin.equipmanage.common.entity.vo.CarIndexVo;
......@@ -20,6 +22,7 @@ import com.yeejoin.equipmanage.common.entity.vo.EquipmentOnCarAppVO;
import com.yeejoin.equipmanage.common.enums.*;
import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.dto.*;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.service.*;
......@@ -31,6 +34,7 @@ import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -49,6 +53,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
......@@ -416,7 +421,7 @@ public class CarController extends AbstractBaseController {
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public Car selectById(HttpServletRequest request, @PathVariable Long id) {
return iCarService.selectOneById(id);
......@@ -1391,10 +1396,82 @@ public class CarController extends AbstractBaseController {
return ResponseHelper.buildResponse(iCarService.getQRCode(id));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/location", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取二维码图片", notes = "获取二维码图片")
public ResponseModel<Object> location() throws Exception {
return ResponseHelper.buildResponse(iCarService.location());
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCountOfCar", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-获取车辆总数", notes = "车辆统计-获取车辆总数")
public Map<String, Integer> getCountOfCar() {
return iCarService.getCountOfCar();
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCountOfCarBelongCompany", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-获取车辆归属单位总数", notes = "车辆统计-获取车辆归属单位总数")
public ResponseModel<Integer> getCountOfCarBelongCompany() {
return CommonResponseUtil.success(iCarService.getCountOfCarBelongCompany());
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarCategoryInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-获取车辆分类用途信息", notes = "车辆统计-获取车辆分类用途信息")
public List<ChartIntegerDto> getCarCategoryInfo() {
return iCarService.getCarCategoryInfo();
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarEquipStateInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-获取设备状态信息", notes = "车辆统计-获取设备状态信息")
public Page<CarEquipStateInfoDto> getCarEquipStateInfo() {
return iCarService.getCarEquipStateInfo();
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarEquipAlarmInfoDto", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-获取设备告警信息", notes = "车辆统计-获取设备告警信息")
public Page<CarEquipAlarmInfoDto> getCarEquipAlarmInfoDto() {
return iCarService.getCarEquipAlarmInfoDto();
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarBelongAreaInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-获取车辆归属信息接口", notes = "车辆统计-获取车辆归属信息接口")
public List<ChartIntegerDto> getCarBelongAreaInfo() {
return iCarService.getCarBelongAreaInfo();
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarAreaInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-获取片区车辆归属信息接口", notes = "车辆统计-获取片区车辆归属信息接口")
public Page<CarAreaInfoDto> getCarAreaInfo(@RequestParam Long id) {
return iCarService.getCarAreaInfo(id);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarMileageInfoByMoth", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-按照月份统计车辆里程", notes = "车辆统计-按照月份统计车辆里程")
public Page<MileageDto> getCarMileageInfoByMoth(@RequestParam String date) {
return iCarService.getCarMileageInfoByMoth(date);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/exportCarMileageInfoByMoth", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-按照月份统计车辆里程", notes = "车辆统计-按照月份统计车辆里程")
public void exportCarMileageInfoByMoth(@RequestParam String date, HttpServletResponse response) {
List<CarExportDto> list = this.iCarService.exportCarMileageInfoByMoth(date);
String name = "车辆里程月度统计表-"+date;
FileHelper.exportExcel(list,name,name,CarExportDto.class,UUID.randomUUID().toString()+".xls",response);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarMileageInfoByMothOFDay", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-按照月份统计每天的车辆里程", notes = "车辆统计-按照月份统计每天的车辆里程")
public ZZChartsDto getCarMileageInfoByMothOFDay(@RequestParam String iotCode) {
return iCarService.getCarMileageInfoByMothOFDay(iotCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarExcepitonTrack", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-按照日期范围获取异常车辆", notes = "车辆统计-按照日期范围获取异常车辆")
public Page<CarExceptionDto> getCarExcepitonTrack(@RequestParam Integer type) {
return iCarService.getCarExcepitonTrack(type);
}
}
package com.yeejoin.equipmanage.dto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import java.util.List;
@Data
public class BasicTableDataDto {
// {
// "dataGridMock": {
// "current": 1,
// "total": 5,
// "pagination": false,
// "totalPage": 1,
// "dataList": [
// {
// "title2_measure": "蒋公岭风电场",
// "title1_measure": "鄂A 350L9",
// "title3_measure": "开机",
// "title4_measure": "20%",
// "_id": 1
// },
// {
// "title2_measure": "蒋公岭风电场",
// "title1_measure": "鄂A 350L8",
// "title3_measure": "开机",
// "title4_measure": "20%",
// "_id": 2
// },
// {
// "title2_measure": "蒋公岭风电场",
// "title1_measure": "鄂A 350L4",
// "title3_measure": "开机",
// "title4_measure": "20%",
// "_id": 3
// },
// {
// "title2_measure": "蒋公岭风电场",
// "title1_measure": "鄂A 350L5",
// "title3_measure": "关机",
// "title4_measure": "20%",
// "_id": 4
// },
// {
// "title2_measure": "蒋公岭风电场",
// "title1_measure": "鄂A 350L6",
// "title3_measure": "开机",
// "title4_measure": "20%",
// "_id": 5
// }
// ],
// "pageSize": 10
// },
// "colModel": [
// {
// "fid": "title1_measure",
// "dataIndex": "title1_measure",
// "name": "车牌号",
// "title": "车牌号",
// "type": "dataGrid",
// "key": "title1_measure"
// },
// {
// "fid": "title2_measure",
// "dataIndex": "title2_measure",
// "name": "所属单位",
// "title": "所属单位",
// "type": "dataGrid",
// "key": "title2_measure"
// },
// {
// "fid": "title3_measure",
// "dataIndex": "title3_measure",
// "name": "设备状态",
// "title": "设备状态",
// "type": "dataGrid",
// "key": "title3_measure"
// },
// {
// "fid": "title4_measure",
// "dataIndex": "title4_measure",
// "name": "设备电量",
// "title": "设备电量",
// "type": "dataGrid",
// "key": "title4_measure"
// }
// ]
// }
private MypageDto dataGridMock;
private List<ColModel> colModel ;
}
package com.yeejoin.equipmanage.dto;
import lombok.Data;
@Data
public class CarAreaInfoDto {
private Integer no;
private String name;
private Integer countOfCar = 0;
}
package com.yeejoin.equipmanage.dto;
import lombok.Data;
@Data
public class CarExceptionDto {
private String carNumber;
private String belongStation;
private String belongStation1="运行轨迹";
private String carId;
}
package com.yeejoin.equipmanage.dto;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
@Data
public class CarExportDto {
@Excel(name="车辆编号")
private String code;
@Excel(name="车牌号")
private String carNumber;
@Excel(name="所属单位")
private String orgName;
@Excel(name="车辆型号")
private String standard;
@Excel(name = "排量(升)")
private String displacement;
@Excel(name = "里程数(km)")
private String totalTravel;
}
package com.yeejoin.equipmanage.dto;
import lombok.Data;
@Data
public class ChartIntegerDto {
private Long companyId ;
private String name;
private Integer value = 0;
}
package com.yeejoin.equipmanage.dto;
import lombok.Data;
@Data
public class ColModel {
private String fid;
private String dataIndex;
private String name;
private String title;
private String type = "dataGrid";
private String key ;
public ColModel(String fid, String name){
this.fid = fid;
this.dataIndex = fid;
this.key =fid;
this.type = "dataGrid";
this.name = name;
this.title =name;
}
}
package com.yeejoin.equipmanage.dto;
import lombok.Data;
@Data
public class MileageDto {
private String carCode;
private String carNum;
private Double totalTravel;
private String total;
//iotCode+date
private String iotCode;
}
package com.yeejoin.equipmanage.dto;
import io.swagger.models.auth.In;
import lombok.Data;
import java.util.List;
@Data
public class MypageDto {
private Integer current ;
private Integer total;
private Boolean pagination;
private Integer totalPage;
private List dataList;
private Integer pageSize;
}
package com.yeejoin.equipmanage.dto;
import lombok.Data;
import java.util.List;
@Data
public class ZZChartsDto {
// {
// "seriesData": [
// 2,
// 1,
// 1,
// 2,
// "1.7"
// ],
// "axisData": [
// "A",
// "B",
// "C",
// "D",
// "E"
// ]
// }
//Y轴
private List seriesData;
// X轴
private List axisData;
}
......@@ -65,8 +65,10 @@ public class CarIotNewListener extends EmqxListener {
String deviceName = topic.split("/")[1];
String iotCode = measurement + deviceName;
JSONObject jsonObject = JSONObject.parseObject(message.toString());
//通过消息存电量到扩展字段2
this.updateEquipBattery(jsonObject,iotCode);
if (jsonObject.containsKey("FireCar_Longitude")) {
this.updateCarLocation(jsonObject,iotCode);
this.updateCarLocation(jsonObject, iotCode);
//如果map中已经存在该设备或者该设备有但是线程已经执行了
if ((!deviceInfo.containsKey(iotCode)) || (deviceInfo.containsKey(iotCode) && deviceInfo.get(iotCode) == null)) {
ThreadCar threadCar = new ThreadCar(iotCode, jsonObject, this.iWlCarMileageService, this.iotFeign, this.iCarService, this.emqkeeper, clipping_time);
......@@ -163,6 +165,7 @@ public class CarIotNewListener extends EmqxListener {
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) + 8);
return calendar.getTime();
}
public void updateCarLocation(JSONObject jsonObject, String iotCode) {
if (jsonObject.containsKey("FireCar_Longitude") && jsonObject.containsKey("FireCar_Latitude")) {
// 获取开始坐标
......@@ -196,4 +199,25 @@ public class CarIotNewListener extends EmqxListener {
}
}
}
//存储设备电量到扩展字段2
public void updateEquipBattery(JSONObject jsonObject, String iotCode) {
Integer power = 0;
if (jsonObject.containsKey("additionalInformations") && jsonObject.get("additionalInformations") != null) {
JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("additionalInformations").toString());
if (jsonObject1 != null) {
JSONObject jsonObject2 = JSONObject.parseObject(jsonObject1.get("additionalInformations").toString());
if (jsonObject2 != null && jsonObject2.containsKey("power")) {
power = jsonObject2.getInteger("power");
}
}
}
Car car = iCarService.getOne(new LambdaQueryWrapper<Car>().eq(Car::getIotCode, iotCode));
if (car != null && power != 0) {
car.setExtra2(power.toString());
iCarService.updateById(car);
System.out.println("-----------更新车辆设备电池电量成功--------");
}
}
}
......@@ -5,6 +5,8 @@ import com.yeejoin.equipmanage.common.datasync.entity.FireVehicle;
import com.yeejoin.equipmanage.common.dto.CarFusionDto;
import com.yeejoin.equipmanage.common.entity.Car;
import com.yeejoin.equipmanage.common.entity.dto.CarDto;
import com.yeejoin.equipmanage.common.entity.dto.CarEquipAlarmInfoDto;
import com.yeejoin.equipmanage.common.entity.dto.CarEquipStateInfoDto;
import com.yeejoin.equipmanage.common.entity.vo.CarIndexVo;
import com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentOnCarAppVO;
......@@ -82,5 +84,7 @@ public interface CarMapper extends BaseMapper<Car> {
List<Map<String, Object>> getCarState();
List<Map<String, Object>> getFirePowerInfo();
Integer getCarCategoryCountByCategoryID(Long categoryID);
List<CarEquipStateInfoDto> getCarEquipStateInfo();
List<CarEquipAlarmInfoDto> getCarEquipAlarmInfo(Integer batteryNumber);
}
......@@ -20,5 +20,7 @@ public interface WlCarMileageMapper extends BaseMapper<WlCarMileage> {
Double totalMileage(String iotCode);
List<WlCarMileage> list(@Param("date") String date);
Double getTotalTravelByIotCodeAndDate(String date,String iotCode);
Double getTotalTravelByIotCodeAndDateProd(String startDate, String endDate, String iotCode);
}
......@@ -13,10 +13,14 @@ import com.yeejoin.equipmanage.common.entity.CarInfo;
import com.yeejoin.equipmanage.common.entity.CarProperty;
import com.yeejoin.equipmanage.common.entity.EquipmentCategory;
import com.yeejoin.equipmanage.common.entity.dto.CarDto;
import com.yeejoin.equipmanage.common.entity.dto.CarEquipAlarmInfoDto;
import com.yeejoin.equipmanage.common.entity.dto.CarEquipStateInfoDto;
import com.yeejoin.equipmanage.common.entity.vo.CarIndexVo;
import com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.dto.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -189,4 +193,18 @@ public interface ICarService extends IService<Car> {
IPage getQRCode(Long id);
List<Car> location();
// 获取车辆总数
Map<String,Integer> getCountOfCar();
// 获取车辆归属单位总数
Map<String,Integer> getCountOfCarBelongCompany();
List<ChartIntegerDto> getCarCategoryInfo() ;
Page<CarEquipStateInfoDto> getCarEquipStateInfo();
Page<CarEquipAlarmInfoDto> getCarEquipAlarmInfoDto();
List<ChartIntegerDto>getCarBelongAreaInfo() ;
Page<CarAreaInfoDto> getCarAreaInfo(Long id ) ;
Page<MileageDto> getCarMileageInfoByMoth(String date);
List<CarExportDto> exportCarMileageInfoByMoth(String date);
ZZChartsDto getCarMileageInfoByMothOFDay(String iotCode);
Page<CarExceptionDto> getCarExcepitonTrack(Integer type);
}
......@@ -33,4 +33,6 @@ public interface IWlCarMileageService extends IService<WlCarMileage> {
//根据iot编码查询是否有未结束里程
Boolean getUncompleteMileagByIotCode(String iotCode);
Double getTotalTravelByIotCodeAndDate(String date,String iotCode);
Double getTotalTravelByIotCodeAndDateProd(String StartDate,String endDate,String iotCode);
}
......@@ -391,7 +391,6 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
return integer <= 0 ;
}
private String getAddress(double longitude, double lantitude) {
StringBuilder api = new StringBuilder(GUIDE_ADDRESS_URL);
api.append("key=").append(GUIDE_KEY).append("&location=").append(longitude).append(",").append(lantitude)
......@@ -430,4 +429,13 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
}
return res.toString();
}
@Override
public Double getTotalTravelByIotCodeAndDate(String date, String iotCode) {
return this.baseMapper.getTotalTravelByIotCodeAndDate(date,iotCode);
}
@Override
public Double getTotalTravelByIotCodeAndDateProd(String startDate, String endDate, String iotCode) {
return this.baseMapper.getTotalTravelByIotCodeAndDateProd(startDate,endDate,iotCode);
}
}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.10.215:3307/dl_business_v3.0.1.3?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.url = jdbc:mysql://172.16.10.220:3306/equipment?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=Yeejoin@2020
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
......@@ -14,13 +14,13 @@ spring.datasource.hikari.connection-test-query= SELECT 1
# \u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740
fileserver_domain=http://172.16.10.215:9000/
fileserver_domain=http://172.16.10.220:9000/
#eureka.instance.ip-address= 172.16.3.135
eureka.instance.hostname= 172.16.10.215
eureka.instance.hostname= 172.16.10.220
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@172.16.10.215:10001/eureka/
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@172.16.10.220:10001/eureka/
spring.security.user.name=admin
spring.security.user.password=a1234560
security.productApp=STUDIO_APP_MOBILE
......@@ -35,7 +35,7 @@ amos.system.user.product=STUDIO_APP_WEB
spring.redis.database=1
spring.redis.host=172.16.10.215
spring.redis.host=172.16.10.220
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200
......@@ -47,10 +47,10 @@ spring.redis.expire.time=30000
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.215:1883
emqx.broker=tcp://172.16.10.220:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.10.215:8083/mqtt
mqtt.scene.host=mqtt://172.16.10.220:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
......@@ -136,3 +136,7 @@ mileage.parameter=0.5
# 江西电建-车辆里程跨天记录切分(每日0点执行)
mileage.segmentation.cron=0 0 0 * * ?
mileage.clippingtime=600000
equip.car.alarmBattery= 10
equip.car.maxTravel=400
equip.risk.model.topic=""
#mileage.segmentation.cron= 0 */2 * * * ?
\ No newline at end of file
......@@ -80,8 +80,7 @@ equip.message.create.topic=emq.risk.created
# \u4E2D\u5FC3\u7EA7\u76D1\u542C\u4E3B\u9898
equip.center.risk.topic=equip/risk/trigger
patrol.center.risk.topic=patrol/risk/trigger
# \u4E2D\u5FC3\u7EA7\u53D1\u9001\u81F3\u98CE\u9669\u670D\u52A1\u6D88\u606F\u683C\u5F0F
equip.risk.model.topic=equip/data/analysis
# \u4E2D\u5FC3\u7EA7\u53D1\u9001\u81F3\u98CE\u9669\u670D\u52A1\u6D88\u606F\u683C\u5
# \u63A5\u53E3\u5730\u5740
equip.scene.detail.url=${server.servlet.context-path}/scene/%s/detail/list
......
......@@ -561,9 +561,6 @@
</select>
<select id="equipmentCarList" resultType="com.yeejoin.equipmanage.common.entity.Car">
select * from wl_car c LEFT JOIN wl_equipment w on c.equipment_id=w.id
where c.car_state in ('1','2')
......@@ -652,25 +649,24 @@
</select>
<select id="queryCompanyIotStaData" resultType="java.util.Map">
-- SELECT
-- s.biz_org_code as bizOrgCode,
-- c.code as categoryCode,
-- count(1) as total
-- FROM
-- `wl_car` s,
-- wl_equipment e,
-- wl_equipment_category c
-- where
-- e.is_iot=1
-- and s.equipment_id = e.`id`
-- and e.category_id = c.id
-- and s.biz_org_code is not null
-- GROUP BY s.biz_org_code ,c.code
--
-- UNION
-- SELECT
-- s.biz_org_code as bizOrgCode,
-- c.code as categoryCode,
-- count(1) as total
-- FROM
-- `wl_car` s,
-- wl_equipment e,
-- wl_equipment_category c
-- where
-- e.is_iot=1
-- and s.equipment_id = e.`id`
-- and e.category_id = c.id
-- and s.biz_org_code is not null
-- GROUP BY s.biz_org_code ,c.code
--
-- UNION
SELECT
s.biz_org_code as bizOrgCode,
......@@ -702,4 +698,19 @@
FROM
v_duty_person
</select>
<select id="getCarCategoryCountByCategoryID" resultType="Integer">
SELECT count(1) count
FROM `wl_car` LEFT JOIN wl_equipment
on wl_car.equipment_id = wl_equipment.id
WHERE wl_equipment.category_id = #{categoryID}
</select>
<select id="getCarEquipStateInfo" resultType="com.yeejoin.equipmanage.common.entity.dto.CarEquipStateInfoDto">
SELECT car_num carNum,biz_org_name bizOrgName,extra2
FROM `wl_car`
</select>
<select id="getCarEquipAlarmInfo" resultType="com.yeejoin.equipmanage.common.entity.dto.CarEquipAlarmInfoDto">
SELECT car_num carNum,extra2
FROM `wl_car`
where extra2 &lt; #{batteryNumber}
</select>
</mapper>
......@@ -54,4 +54,19 @@
AND wcm.start_time IS NOT NULL
AND wcm.end_time IS NULL
</select>
<select id ="getTotalTravelByIotCodeAndDate" resultType="Double">
SELECT SUM(travel)
FROM wl_car_mileage
WHERE date LIKE concat('%',#{date},'%')
AND
iot_code = #{iotCode}
</select>
<select id ="getTotalTravelByIotCodeAndDateProd" resultType="Double">
SELECT SUM(travel)
FROM wl_car_mileage
WHERE date &lt;= #{startDate} AND date &gt;= #{endDate}
AND
iot_code = #{iotCode}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment