组塔检测-检测记录,预警记录;施工质量-质量检测记录,预警记录
This commit is contained in:
parent
76be09c046
commit
e0356d4004
|
|
@ -5,7 +5,9 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
|
|
||||||
import com.securitycontrol.background.constructionQuality.service.EarlyWarningsRecordService;
|
import com.securitycontrol.background.constructionQuality.service.EarlyWarningsRecordService;
|
||||||
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleVo;
|
||||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||||
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||||
import com.securitycontrol.common.log.annotation.Log;
|
import com.securitycontrol.common.log.annotation.Log;
|
||||||
import com.securitycontrol.common.log.enums.OperationType;
|
import com.securitycontrol.common.log.enums.OperationType;
|
||||||
|
|
@ -47,6 +49,13 @@ public class EarlyWarningsRecordController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "预警处置")
|
||||||
|
@PostMapping("updEarly")
|
||||||
|
@Log(title = "施工质量", menu = "施工质量->预警处置", grade = OperationType.UPDATE_BUSINESS, details = "预警处置", type = "业务日志")
|
||||||
|
public AjaxResult addEarly(@RequestBody EarlyWarningsRecordVo vo) {
|
||||||
|
return service.updEarly(vo);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("exportProData")
|
@GetMapping("exportProData")
|
||||||
@Log(title = "施工质量", menu = "施工质量->预警记录", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
|
@Log(title = "施工质量", menu = "施工质量->预警记录", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
|
||||||
public void exportData(HttpServletRequest request, HttpServletResponse response, EarlyWarningsRecordVo dto) {
|
public void exportData(HttpServletRequest request, HttpServletResponse response, EarlyWarningsRecordVo dto) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.securitycontrol.background.constructionQuality.mapper;
|
package com.securitycontrol.background.constructionQuality.mapper;
|
||||||
|
|
||||||
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleVo;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -18,4 +19,6 @@ public interface EarlyWarningsRecordMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<EarlyWarningsRecordVo> getEarlyWarningsRecordLists(EarlyWarningsRecordVo dto);
|
List<EarlyWarningsRecordVo> getEarlyWarningsRecordLists(EarlyWarningsRecordVo dto);
|
||||||
|
|
||||||
|
void updEarly(EarlyWarningsRecordVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.securitycontrol.background.constructionQuality.service;
|
||||||
|
|
||||||
|
|
||||||
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
||||||
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -17,4 +18,6 @@ public interface EarlyWarningsRecordService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<EarlyWarningsRecordVo> getEarlyWarningRecordLists(EarlyWarningsRecordVo dto);
|
List<EarlyWarningsRecordVo> getEarlyWarningRecordLists(EarlyWarningsRecordVo dto);
|
||||||
|
|
||||||
|
AjaxResult updEarly(EarlyWarningsRecordVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,16 @@ package com.securitycontrol.background.constructionQuality.service.impl;
|
||||||
import com.securitycontrol.background.constructionQuality.mapper.EarlyWarningsRecordMapper;
|
import com.securitycontrol.background.constructionQuality.mapper.EarlyWarningsRecordMapper;
|
||||||
import com.securitycontrol.background.constructionQuality.service.EarlyWarningsRecordService;
|
import com.securitycontrol.background.constructionQuality.service.EarlyWarningsRecordService;
|
||||||
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleVo;
|
||||||
|
import com.securitycontrol.common.core.utils.StringUtils;
|
||||||
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
|
import com.securitycontrol.common.security.utils.SecurityUtils;
|
||||||
|
import com.securitycontrol.system.api.model.LoginUser;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
@ -26,4 +34,19 @@ public class EarlyWarningsRecordServiceImpl implements EarlyWarningsRecordServic
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public AjaxResult updEarly(EarlyWarningsRecordVo vo) {
|
||||||
|
String userId = SecurityUtils.getLoginUser().getUserid() +"";
|
||||||
|
vo.setUserId(userId);
|
||||||
|
try {
|
||||||
|
mapper.updEarly(vo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("预警处置", e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,5 +27,12 @@ public class EarlyWarningsRecordVo {
|
||||||
@ApiModelProperty(value = "监测时间")
|
@ApiModelProperty(value = "监测时间")
|
||||||
private String createTime;
|
private String createTime;
|
||||||
|
|
||||||
private String keyWord;
|
@ApiModelProperty(value = "预警处置")
|
||||||
|
@Excel(name = "预警处置", width = 10.0, orderNum = "3")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
private String date;
|
||||||
|
private String warnId;
|
||||||
|
private String userId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,25 +22,28 @@ public class QualityRecordVo {
|
||||||
@Excel(name = "区域名称", width = 10.0, orderNum = "2")
|
@Excel(name = "区域名称", width = 10.0, orderNum = "2")
|
||||||
private String areaName;
|
private String areaName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "监测点名称")
|
@ApiModelProperty(value = "施工工艺")
|
||||||
@Excel(name = "监测点名称", width = 10.0, orderNum = "3")
|
@Excel(name = "施工工艺", width = 10.0, orderNum = "3")
|
||||||
private String modeName;
|
private String modeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准值")
|
||||||
|
@Excel(name = "标准值", width = 10.0, orderNum = "4")
|
||||||
|
private String standardValue;
|
||||||
|
|
||||||
@ApiModelProperty(value = "检测值")
|
@ApiModelProperty(value = "检测值")
|
||||||
@Excel(name = "检测值", width = 10.0, orderNum = "4")
|
@Excel(name = "检测值", width = 10.0, orderNum = "5")
|
||||||
private String val;
|
private String val;
|
||||||
|
|
||||||
@ApiModelProperty(value = "累计变化")
|
|
||||||
@Excel(name = "累计变化", width = 10.0, orderNum = "5")
|
|
||||||
private String changeVal;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
@Excel(name = "状态", width = 10.0, orderNum = "6")
|
@Excel(name = "状态", width = 10.0, orderNum = "7")
|
||||||
private String isWarn;
|
private String isWarn;
|
||||||
|
|
||||||
@ApiModelProperty(value = "监测时间")
|
@ApiModelProperty(value = "监测时间")
|
||||||
@Excel(name = "监测时间", width = 10.0, orderNum = "7")
|
@Excel(name = "监测时间", width = 10.0, orderNum = "6")
|
||||||
private String createTime;
|
private String createTime;
|
||||||
|
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
private String proIds;
|
||||||
|
private String date;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,5 +26,5 @@ public class EarlyWarningRecordVo {
|
||||||
@ApiModelProperty(value = "监测时间")
|
@ApiModelProperty(value = "监测时间")
|
||||||
private String createTime;
|
private String createTime;
|
||||||
|
|
||||||
private String keyWord;
|
private String date;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,4 +42,6 @@ public class TowerRecordVo {
|
||||||
private String createTime;
|
private String createTime;
|
||||||
|
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
private String proIds;
|
||||||
|
private String date;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,134 @@
|
||||||
|
package com.securitycontrol.background.vehicleManagement.controller;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.service.VehicleService;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleDto;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleVo;
|
||||||
|
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||||
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
|
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||||
|
import com.securitycontrol.common.log.annotation.Log;
|
||||||
|
import com.securitycontrol.common.log.enums.OperationType;
|
||||||
|
import com.securitycontrol.entity.system.base.dto.GxPlanDto;
|
||||||
|
import com.securitycontrol.entity.system.base.vo.GxPlanVo;
|
||||||
|
import com.securitycontrol.system.export.util.ExcelStyleUtil;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人车管理 - 车辆管理
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/vehicle/")
|
||||||
|
@Slf4j
|
||||||
|
public class VehicleController extends BaseController {
|
||||||
|
|
||||||
|
@Resource(name = "VehicleService")
|
||||||
|
private VehicleService service;
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取车辆管理列表")
|
||||||
|
@GetMapping("getVehicleLists")
|
||||||
|
@Log(title = "人车管理", menu = "人车管理->车辆管理", grade = OperationType.QUERY_BUSINESS, details = "查询列表", type = "业务日志")
|
||||||
|
public TableDataInfo getVehicleLists(VehicleVo dto) {
|
||||||
|
startPage();
|
||||||
|
List<VehicleVo> list = service.getVehicleLists(dto);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增")
|
||||||
|
@PostMapping("addVehicle")
|
||||||
|
@Log(title = "人车管理", menu = "人车管理->车辆管理", grade = OperationType.ADD_BUSINESS, details = "新增", type = "业务日志")
|
||||||
|
public AjaxResult addVehicle(@RequestBody VehicleVo vo) {
|
||||||
|
return service.addOrUpdateVehicle(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改")
|
||||||
|
@PostMapping("editVehicle")
|
||||||
|
@Log(title = "人车管理", menu = "人车管理->车辆管理", grade = OperationType.UPDATE_BUSINESS, details = "修改", type = "业务日志")
|
||||||
|
public AjaxResult editVehicle(@RequestBody VehicleVo vo) {
|
||||||
|
return service.addOrUpdateVehicle(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除")
|
||||||
|
@PostMapping("delVehicleById")
|
||||||
|
@Log(title = "人车管理", menu = "人车管理->车辆管理", grade = OperationType.DELETE_BUSINESS, details = "删除", type = "业务日志")
|
||||||
|
public AjaxResult delVehicleById(@RequestBody VehicleVo dto) {
|
||||||
|
return service.delVehicleById(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取进出场记录列表")
|
||||||
|
@GetMapping("getLists")
|
||||||
|
@Log(title = "人车管理", menu = "人车管理->车辆管理", grade = OperationType.QUERY_BUSINESS, details = "查询进出场记录", type = "业务日志")
|
||||||
|
public TableDataInfo getLists(VehicleVo dto) {
|
||||||
|
startPage();
|
||||||
|
List<VehicleVo> list = service.getLists(dto);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("exportVehicleData")
|
||||||
|
@Log(title = "人车管理", menu = "人车管理->车辆管理", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
|
||||||
|
public void exportData(HttpServletRequest request, HttpServletResponse response, VehicleVo dto) {
|
||||||
|
try {
|
||||||
|
List<VehicleVo> proExportVoList = new ArrayList<>();
|
||||||
|
List<VehicleVo> proLists = service.getVehicleLists(dto);
|
||||||
|
for (int i = 0; i < proLists.size(); i++) {
|
||||||
|
proLists.get(i).setProId((i + 1) + "");
|
||||||
|
VehicleVo exportVo = new VehicleVo();
|
||||||
|
BeanUtils.copyProperties(proLists.get(i), exportVo);
|
||||||
|
proExportVoList.add(exportVo);
|
||||||
|
}
|
||||||
|
ExportParams exportParams = new ExportParams("车辆管理", "车辆管理", ExcelType.XSSF);
|
||||||
|
exportParams.setStyle(ExcelStyleUtil.class);
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, VehicleVo.class, proExportVoList);
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("车辆管理" + ".xlsx", "UTF-8"));
|
||||||
|
ServletOutputStream outputStream = response.getOutputStream();
|
||||||
|
workbook.write(outputStream);
|
||||||
|
outputStream.close();
|
||||||
|
workbook.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("导出车辆管理", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("exportListData")
|
||||||
|
@Log(title = "人车管理", menu = "人车管理->车辆管理", grade = OperationType.EXPORT_BUSINESS, details = "导出出入场列表", type = "业务日志")
|
||||||
|
public void exportListData(HttpServletRequest request, HttpServletResponse response, VehicleDto dto) {
|
||||||
|
try {
|
||||||
|
List<VehicleDto> proExportVoList = new ArrayList<>();
|
||||||
|
List<VehicleDto> proLists = service.getListsDto(dto);
|
||||||
|
for (int i = 0; i < proLists.size(); i++) {
|
||||||
|
proLists.get(i).setProId((i + 1) + "");
|
||||||
|
VehicleDto exportVo = new VehicleDto();
|
||||||
|
BeanUtils.copyProperties(proLists.get(i), exportVo);
|
||||||
|
proExportVoList.add(exportVo);
|
||||||
|
}
|
||||||
|
ExportParams exportParams = new ExportParams("车辆管理出入场"+proLists.get(0).getCarNum(), "车辆管理出入场"+proLists.get(0).getCarNum(), ExcelType.XSSF);
|
||||||
|
exportParams.setStyle(ExcelStyleUtil.class);
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, VehicleDto.class, proExportVoList);
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("车辆管理出入场"+proLists.get(0).getCarNum() + ".xlsx", "UTF-8"));
|
||||||
|
ServletOutputStream outputStream = response.getOutputStream();
|
||||||
|
workbook.write(outputStream);
|
||||||
|
outputStream.close();
|
||||||
|
workbook.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("导出出入场", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.securitycontrol.background.vehicleManagement.mapper;
|
||||||
|
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleDto;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleVo;
|
||||||
|
import com.securitycontrol.entity.system.base.dto.GxPlanDto;
|
||||||
|
import com.securitycontrol.entity.system.base.dto.ProGxPlanDto;
|
||||||
|
import com.securitycontrol.entity.system.base.vo.GxPlanVo;
|
||||||
|
import com.securitycontrol.entity.system.vo.ResourceFileVo;
|
||||||
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理
|
||||||
|
*/
|
||||||
|
@Repository(value = "VehicleMapper")
|
||||||
|
public interface VehicleMapper {
|
||||||
|
/**
|
||||||
|
* 获取
|
||||||
|
*/
|
||||||
|
List<VehicleVo> getVehicleLists(VehicleVo dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增/修改
|
||||||
|
*/
|
||||||
|
void addOrUpdateVehicle(VehicleVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
void delVehicleById(VehicleVo dto);
|
||||||
|
|
||||||
|
List<VehicleVo> getLists(VehicleVo dto);
|
||||||
|
|
||||||
|
List<VehicleDto> getListsDto(VehicleDto dto);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.securitycontrol.background.vehicleManagement.service;
|
||||||
|
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleDto;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleVo;
|
||||||
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
|
import com.securitycontrol.entity.system.base.dto.GxPlanDto;
|
||||||
|
import com.securitycontrol.entity.system.base.dto.ProGxPlanDto;
|
||||||
|
import com.securitycontrol.entity.system.base.vo.GxPlanVo;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理
|
||||||
|
*/
|
||||||
|
public interface VehicleService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取车辆列表
|
||||||
|
*/
|
||||||
|
List<VehicleVo> getVehicleLists(VehicleVo dto);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增/修改
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
AjaxResult addOrUpdateVehicle(VehicleVo vo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
AjaxResult delVehicleById(VehicleVo dto);
|
||||||
|
|
||||||
|
List<VehicleVo> getLists(VehicleVo dto);
|
||||||
|
|
||||||
|
List<VehicleDto> getListsDto(VehicleDto dto);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,149 @@
|
||||||
|
package com.securitycontrol.background.vehicleManagement.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.mapper.VehicleMapper;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.service.VehicleService;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleDto;
|
||||||
|
import com.securitycontrol.background.vehicleManagement.vo.VehicleVo;
|
||||||
|
import com.securitycontrol.common.core.constant.Constant;
|
||||||
|
import com.securitycontrol.common.core.constant.HttpStatus;
|
||||||
|
import com.securitycontrol.common.core.constant.SecurityConstants;
|
||||||
|
import com.securitycontrol.common.core.domain.Result;
|
||||||
|
import com.securitycontrol.common.core.utils.ImportExcelUtils;
|
||||||
|
import com.securitycontrol.common.core.utils.StringUtils;
|
||||||
|
import com.securitycontrol.common.core.utils.aes.DateTimeHelper;
|
||||||
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
|
import com.securitycontrol.common.security.utils.ValidatorsUtils;
|
||||||
|
import com.securitycontrol.entity.system.base.dto.GxPlanDto;
|
||||||
|
import com.securitycontrol.entity.system.base.dto.ProDto;
|
||||||
|
import com.securitycontrol.entity.system.base.dto.ProGxPlanDto;
|
||||||
|
import com.securitycontrol.entity.system.base.vo.GxPlanVo;
|
||||||
|
import com.securitycontrol.entity.system.base.vo.ProImportVo;
|
||||||
|
import com.securitycontrol.entity.system.base.vo.ProVo;
|
||||||
|
import com.securitycontrol.entity.system.vo.ResourceFileVo;
|
||||||
|
import com.securitycontrol.system.api.RemoteFileService;
|
||||||
|
import com.securitycontrol.system.api.domain.SysFile;
|
||||||
|
import com.securitycontrol.system.base.mapper.IProMapper;
|
||||||
|
import com.securitycontrol.system.base.service.IProService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*车辆管理
|
||||||
|
*/
|
||||||
|
@Service(value = "VehicleService")
|
||||||
|
@Slf4j
|
||||||
|
public class VehicleServiceImpl implements VehicleService {
|
||||||
|
|
||||||
|
@Resource(name = "VehicleMapper")
|
||||||
|
private VehicleMapper mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<VehicleVo> getVehicleLists(VehicleVo dto) {
|
||||||
|
List<VehicleVo> list = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
list = mapper.getVehicleLists(dto);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取车辆列表",e);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增修改
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public AjaxResult addOrUpdateVehicle(VehicleVo vo) {
|
||||||
|
try {
|
||||||
|
if (StringUtils.isEmpty(vo.getId())) {
|
||||||
|
String ids = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
vo.setId(ids);
|
||||||
|
vo.setType(1);
|
||||||
|
} else {
|
||||||
|
vo.setType(2);
|
||||||
|
}
|
||||||
|
mapper.addOrUpdateVehicle(vo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("车辆新增/修改", e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public AjaxResult delVehicleById(VehicleVo dto) {
|
||||||
|
try {
|
||||||
|
mapper.delVehicleById(dto);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("车辆删除", e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VehicleVo> getLists(VehicleVo dto) {
|
||||||
|
List<VehicleVo> list = new ArrayList<>();
|
||||||
|
String date = dto.getDate();
|
||||||
|
if (!StringUtils.isEmpty(date)) {
|
||||||
|
String[] arr = date.split("@");
|
||||||
|
dto.setStartDate(arr[0]);
|
||||||
|
dto.setEndDate(arr[1]);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
list = mapper.getLists(dto);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取进出场记录列表",e);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VehicleDto> getListsDto(VehicleDto dto) {
|
||||||
|
List<VehicleDto> list = new ArrayList<>();
|
||||||
|
String date = dto.getDate();
|
||||||
|
if (!StringUtils.isEmpty(date)) {
|
||||||
|
String[] arr = date.split("@");
|
||||||
|
dto.setStartDate(arr[0]);
|
||||||
|
dto.setEndDate(arr[1]);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
list = mapper.getListsDto(dto);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取进出场记录列表",e);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.securitycontrol.background.vehicleManagement.vo;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理-出入场
|
||||||
|
* @author lsun
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class VehicleDto {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程ID")
|
||||||
|
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||||
|
private String proId;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时间")
|
||||||
|
@Excel(name = "时间", width = 10.0, orderNum = "1")
|
||||||
|
private String accesssTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
@Excel(name = "状态", width = 10.0, orderNum = "2")
|
||||||
|
private String accessType;
|
||||||
|
|
||||||
|
private String bidCode;
|
||||||
|
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
private String carNum;
|
||||||
|
|
||||||
|
private String startDate;
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.securitycontrol.background.vehicleManagement.vo;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理
|
||||||
|
* @author lsun
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class VehicleVo {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程ID")
|
||||||
|
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||||
|
private String proId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "车牌号")
|
||||||
|
@Excel(name = "车牌号", width = 10.0, orderNum = "1")
|
||||||
|
private String carNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "司机姓名")
|
||||||
|
@Excel(name = "司机姓名", width = 10.0, orderNum = "2")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电话")
|
||||||
|
@Excel(name = "电话", width = 10.0, orderNum = "3")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "1. 新增 2.修改")
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时间")
|
||||||
|
@Excel(name = "时间", width = 10.0, orderNum = "1")
|
||||||
|
private String accesssTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
@Excel(name = "状态", width = 10.0, orderNum = "2")
|
||||||
|
private String accessType;
|
||||||
|
|
||||||
|
private String bidCode;
|
||||||
|
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
private String startDate;
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,21 +1,23 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?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" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.securitycontrol.background.constructionQuality.mapper.EarlyWarningsRecordMapper">
|
<mapper namespace="com.securitycontrol.background.constructionQuality.mapper.EarlyWarningsRecordMapper">
|
||||||
|
|
||||||
|
<update id="updEarly">
|
||||||
|
UPDATE tb_warn SET status = #{status}, update_time = NOW(), user_id = #{userId} WHERE `warn_id` = #{warnId}
|
||||||
|
</update>
|
||||||
<!--获取信息列表-->
|
<!--获取信息列表-->
|
||||||
<select id="getEarlyWarningsRecordLists" resultType="com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo">
|
<select id="getEarlyWarningsRecordLists" resultType="com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo">
|
||||||
SELECT tw.warn_content as warnContent, tw.warn_time as warnTime
|
SELECT tw.warn_id as warnId, tw.warn_content as warnContent, tw.warn_time as warnTime,
|
||||||
|
case when tw.`status` = '0' then '未处理'
|
||||||
|
when tw.`status` = '1' then '预警正确'
|
||||||
|
when tw.`status` = '2' then '预警错误' else '预警错误' end status
|
||||||
FROM tb_warn tw
|
FROM tb_warn tw
|
||||||
LEFT JOIN tb_device_detail tdd ON tw.device_id = tdd.device_id
|
LEFT JOIN tb_device_detail tdd ON tw.device_id = tdd.device_id
|
||||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||||
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
||||||
WHERE sd.dict_code ='6664'
|
WHERE sd.dict_code ='6664'
|
||||||
<if test="keyWord !=null and keyWord!=''">
|
<if test="date != null and date != ''">
|
||||||
AND (
|
and date (tw.warn_time) = #{date}
|
||||||
INSTR(tp.pro_name,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.jl_unit,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.sg_unit,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.manager,#{keyWord}) > 0
|
|
||||||
)
|
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -3,21 +3,30 @@
|
||||||
<mapper namespace="com.securitycontrol.background.constructionQuality.mapper.QualityRecordMapper">
|
<mapper namespace="com.securitycontrol.background.constructionQuality.mapper.QualityRecordMapper">
|
||||||
<!--获取信息列表-->
|
<!--获取信息列表-->
|
||||||
<select id="getQualityRecordLists" resultType="com.securitycontrol.background.constructionQuality.vo.QualityRecordVo">
|
<select id="getQualityRecordLists" resultType="com.securitycontrol.background.constructionQuality.vo.QualityRecordVo">
|
||||||
SELECT tbd.device_name as deviceName, ta.area_name as areaName, tdd.mode_name as modeName,a.val,
|
SELECT tbd.device_name as deviceName, ta.area_name as areaName, tdd.mode_name as modeName,
|
||||||
a.change_val as changeVal,a.is_warn as isWarn,a.create_time as createTime
|
CONCAT(tdd.min_valu,'-',tdd.max_value) as standardValue,
|
||||||
|
a.val,
|
||||||
|
case when a.is_warn = '0' then '否' else '是' end isWarn, sd.dict_code,
|
||||||
|
a.create_time as createTime
|
||||||
FROM tb_his_device_value a
|
FROM tb_his_device_value a
|
||||||
LEFT JOIN tb_device_detail tdd ON a.attribute_id = tdd.id
|
LEFT JOIN tb_device_detail tdd ON a.attribute_id = tdd.id
|
||||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||||
LEFT JOIN tb_area ta ON tbd.area_id = ta.area_id
|
LEFT JOIN tb_area ta ON tbd.area_id = ta.area_id
|
||||||
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
||||||
|
LEFT JOIN tb_project tp ON tp.bid_code = a.bid_code
|
||||||
WHERE sd.dict_code ='6662'
|
WHERE sd.dict_code ='6662'
|
||||||
<if test="keyWord !=null and keyWord!=''">
|
<if test="keyWord !=null and keyWord!=''">
|
||||||
AND (
|
AND (
|
||||||
INSTR(tp.pro_name,#{keyWord}) > 0 OR
|
INSTR(tbd.device_name,#{keyWord}) > 0
|
||||||
INSTR(tp.jl_unit,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.sg_unit,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.manager,#{keyWord}) > 0
|
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="proIds != null and proIds != ''">
|
||||||
|
AND tp.bid_code = #{proIds}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="date != null and date != ''">
|
||||||
|
and date (a.create_time) = #{date}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -9,13 +9,8 @@
|
||||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||||
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
||||||
WHERE sd.dict_code ='6663'
|
WHERE sd.dict_code ='6663'
|
||||||
<if test="keyWord !=null and keyWord!=''">
|
<if test="date != null and date != ''">
|
||||||
AND (
|
and date (tw.warn_time) = #{date}
|
||||||
INSTR(tp.pro_name,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.jl_unit,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.sg_unit,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.manager,#{keyWord}) > 0
|
|
||||||
)
|
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -4,20 +4,28 @@
|
||||||
<!--获取信息列表-->
|
<!--获取信息列表-->
|
||||||
<select id="getTowerRecordLists" resultType="com.securitycontrol.background.towerDetection.vo.TowerRecordVo">
|
<select id="getTowerRecordLists" resultType="com.securitycontrol.background.towerDetection.vo.TowerRecordVo">
|
||||||
SELECT tbd.device_name as deviceName, ta.area_name as areaName, tdd.mode_name as modeName,a.val,
|
SELECT tbd.device_name as deviceName, ta.area_name as areaName, tdd.mode_name as modeName,a.val,
|
||||||
a.change_val as changeVal,a.is_warn as isWarn,a.create_time as createTime
|
a.change_val as changeVal,
|
||||||
|
case when a.is_warn = '0' then '否' else '是' end isWarn,
|
||||||
|
a.create_time as createTime
|
||||||
FROM tb_his_device_value a
|
FROM tb_his_device_value a
|
||||||
LEFT JOIN tb_device_detail tdd ON a.attribute_id = tdd.id
|
LEFT JOIN tb_device_detail tdd ON a.attribute_id = tdd.id
|
||||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||||
LEFT JOIN tb_area ta ON tbd.area_id = ta.area_id
|
LEFT JOIN tb_area ta ON tbd.area_id = ta.area_id
|
||||||
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
||||||
|
LEFT JOIN tb_project tp ON tp.bid_code = a.bid_code
|
||||||
WHERE sd.dict_code ='6661'
|
WHERE sd.dict_code ='6661'
|
||||||
<if test="keyWord !=null and keyWord!=''">
|
<if test="keyWord !=null and keyWord!=''">
|
||||||
AND (
|
AND (
|
||||||
INSTR(tp.pro_name,#{keyWord}) > 0 OR
|
INSTR(tbd.device_name,#{keyWord}) > 0
|
||||||
INSTR(tp.jl_unit,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.sg_unit,#{keyWord}) > 0 OR
|
|
||||||
INSTR(tp.manager,#{keyWord}) > 0
|
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="proIds != null and proIds != ''">
|
||||||
|
AND tp.bid_code = #{proIds}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="date != null and date != ''">
|
||||||
|
and date (a.create_time) = #{date}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
<?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.securitycontrol.background.vehicleManagement.mapper.VehicleMapper">
|
||||||
|
|
||||||
|
<!--获取列表-->
|
||||||
|
<select id="getVehicleLists" resultType="com.securitycontrol.background.vehicleManagement.vo.VehicleVo">
|
||||||
|
SELECT tc.id,tc.car_num as carNum,tc.user_name as userName,tc.phone ,tp.bid_code as bidCode
|
||||||
|
FROM tb_car tc
|
||||||
|
LEFT JOIN tb_project tp ON tp.bid_code = tc.bid_code
|
||||||
|
where tc.del_flag = '0'
|
||||||
|
<if test="userName !=null and userName!=''">
|
||||||
|
AND (
|
||||||
|
INSTR(tc.user_name,#{userName}) > 0
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="bidCode != null and bidCode != ''">
|
||||||
|
AND tp.bid_code = #{bidCode}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getLists" resultType="com.securitycontrol.background.vehicleManagement.vo.VehicleVo">
|
||||||
|
SELECT accesss_time as accesssTime,
|
||||||
|
case WHEN access_type= '0' then '入场' ELSE '出场' end accessType
|
||||||
|
FROM `tb_car_access`
|
||||||
|
WHERE car_id = #{id}
|
||||||
|
<if test="date != null and date != ''">
|
||||||
|
AND accesss_time BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getListsDto" resultType="com.securitycontrol.background.vehicleManagement.vo.VehicleDto">
|
||||||
|
SELECT accesss_time as accesssTime,car_num as carNum,
|
||||||
|
case WHEN access_type= '0' then '入场' ELSE '出场' end accessType
|
||||||
|
FROM `tb_car_access`
|
||||||
|
WHERE car_id = #{id}
|
||||||
|
<if test="date != null and date != ''">
|
||||||
|
AND accesss_time BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--新增/修改-->
|
||||||
|
<insert id="addOrUpdateVehicle">
|
||||||
|
<if test="type == 1">
|
||||||
|
INSERT INTO tb_car
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
id,
|
||||||
|
<if test="bidCode != null and bidCode!=''">bid_code,</if>
|
||||||
|
<if test="carNum != null and carNum!=''">car_num,</if>
|
||||||
|
<if test="userName != null and userName!=''">user_name,</if>
|
||||||
|
<if test="phone != null and phone!=''">phone,</if>
|
||||||
|
create_time,del_flag,
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
#{id},
|
||||||
|
<if test="bidCode != null and bidCode!=''">#{bidCode},</if>
|
||||||
|
<if test="carNum != null and carNum!=''">#{carNum},</if>
|
||||||
|
<if test="userName != null and userName!=''">#{userName},</if>
|
||||||
|
<if test="phone != null and phone!=''">#{phone},</if>
|
||||||
|
NOW(),0,
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
<if test="type == 2">
|
||||||
|
UPDATE tb_car
|
||||||
|
<set>
|
||||||
|
<if test="bidCode != null and bidCode!=''">bid_code = #{bidCode},</if>
|
||||||
|
<if test="carNum != null and carNum!=''">car_num = #{carNum},</if>
|
||||||
|
<if test="userName != null and userName!=''">user_name = #{userName},</if>
|
||||||
|
<if test="phone != null and phone!=''">phone = #{phone},</if>
|
||||||
|
update_time = NOW()
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</if>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!--删除-->
|
||||||
|
<update id="delVehicleById">
|
||||||
|
UPDATE tb_car set del_flag = '1' where id = #{id}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue