Merge branch 'main' of http://8.137.62.52:3000/admin/JdcProject
This commit is contained in:
commit
e429032a14
@ -0,0 +1,81 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord;
|
||||
import com.jdc.jdcproject.entity.FangpaishuiUnit;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
|
||||
import com.jdc.jdcproject.service.EquipmentService;
|
||||
import com.jdc.jdcproject.service.FangpaishuiPumpoperationrecordService;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/FangpaishuiPumpoperationrecordController")
|
||||
public class FangpaishuiPumpoperationrecordController {
|
||||
@Autowired
|
||||
private FangpaishuiPumpoperationrecordService fangpaishuiPumpoperationrecordService;
|
||||
|
||||
@Operation(summary = "根据条件查询水泵运行日志")
|
||||
@PostMapping("findPumpoperationrecordByDetail")
|
||||
public Result findPumpoperationrecordByDetail(@RequestBody FangpaishuiPumpoperationrecordVo fangpaishuiPumpoperationrecordVo) {
|
||||
List<FangpaishuiPumpoperationrecordVo> vos = fangpaishuiPumpoperationrecordService.findDetail(fangpaishuiPumpoperationrecordVo);
|
||||
return Result.successResult().data("vos", vos);
|
||||
}
|
||||
@Operation(summary = "新增水泵运行日志")
|
||||
@PostMapping("addFangpaishuiPumpoperationrecord")
|
||||
public Result addFangpaishuiPumpoperationrecord(@RequestBody FangpaishuiPumpoperationrecord fangpaishuiPumpoperationrecord) {
|
||||
Date date = new Date();
|
||||
Instant instant = date.toInstant();
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
LocalDate localDate = instant.atZone(zoneId).toLocalDate();
|
||||
fangpaishuiPumpoperationrecord.setMonth(localDate);
|
||||
//计算小时差并写入操作时间
|
||||
Long start = fangpaishuiPumpoperationrecord.getStartupTime().getTime();
|
||||
Long end = fangpaishuiPumpoperationrecord.getEndTime().getTime();
|
||||
int minutes = (int) ((end - start) / (1000 * 60));
|
||||
fangpaishuiPumpoperationrecord.setOperationTime((double) (minutes/60));
|
||||
System.out.println(fangpaishuiPumpoperationrecord);
|
||||
|
||||
boolean updateflag = fangpaishuiPumpoperationrecordService.save(fangpaishuiPumpoperationrecord);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "删除水泵运行日志")
|
||||
@DeleteMapping("deleteFangpaishuiPumpoperationrecord/{id}")
|
||||
public Result deleteFangpaishuiPumpoperationrecord(@PathVariable int id) {
|
||||
boolean updateflag = fangpaishuiPumpoperationrecordService.removeById(id);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "修改水泵运行日志")
|
||||
@PostMapping("updateFangpaishuiPumpoperationrecord")
|
||||
public Result updateFangpaishuiPumpoperationrecord(@RequestBody FangpaishuiPumpoperationrecord fangpaishuiPumpoperationrecord) {
|
||||
//计算小时差并写入操作时间
|
||||
Long start = fangpaishuiPumpoperationrecord.getStartupTime().getTime();
|
||||
Long end = fangpaishuiPumpoperationrecord.getEndTime().getTime();
|
||||
int minutes = (int) ((end - start) / (1000 * 60));
|
||||
fangpaishuiPumpoperationrecord.setOperationTime((double) (minutes/60));
|
||||
boolean updateflag = fangpaishuiPumpoperationrecordService.updateById(fangpaishuiPumpoperationrecord);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import com.jdc.jdcproject.entity.Equipment;
|
||||
import com.jdc.jdcproject.entity.FangpaishuiUnit;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
|
||||
import com.jdc.jdcproject.service.EquipmentService;
|
||||
import com.jdc.jdcproject.service.FangpaishuiUnitService;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/fangpaishuiUnitController")
|
||||
public class FangpaishuiUnitController {
|
||||
@Autowired
|
||||
private FangpaishuiUnitService fangpaishuiUnitService;
|
||||
|
||||
@Operation(summary = "根据条件查询机组信息")
|
||||
@PostMapping("findUnitByDetail")
|
||||
public Result findUnitByDetail(@RequestBody FangpaishuiUnitVo fangpaishuiUnitVo) {
|
||||
List<FangpaishuiUnitVo> vos = fangpaishuiUnitService.findUnitByDetail(fangpaishuiUnitVo);
|
||||
return Result.successResult().data("vos", vos);
|
||||
}
|
||||
@Operation(summary = "修改机组信息")
|
||||
@PostMapping("updateUnit")
|
||||
public Result updateUnit(@RequestBody FangpaishuiUnit fangpaishuiUnit) {
|
||||
boolean updateflag = fangpaishuiUnitService.updateById(fangpaishuiUnit);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "删除机组信息")
|
||||
@DeleteMapping("deleteUnit/{id}")
|
||||
public Result deleteUnit(@PathVariable int id) {
|
||||
boolean updateflag = fangpaishuiUnitService.removeById(id);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "新增机组信息")
|
||||
@PostMapping("addUnit")
|
||||
public Result addUnit(@RequestBody FangpaishuiUnit fangpaishuiUnit) {
|
||||
System.out.println(fangpaishuiUnit);
|
||||
|
||||
boolean updateflag = fangpaishuiUnitService.save(fangpaishuiUnit);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 泵站操作记录表;
|
||||
* @TableName fangpaishui_pumpoperationrecord
|
||||
*/
|
||||
@TableName(value ="fangpaishui_pumpoperationrecord")
|
||||
@Data
|
||||
public class FangpaishuiPumpoperationrecord implements Serializable {
|
||||
/**
|
||||
* 主键,唯一标识操作记录
|
||||
*/
|
||||
@TableId(value = "RecordID")
|
||||
private Integer recordID;
|
||||
|
||||
/**
|
||||
* 外键,关联操作的机组
|
||||
*/
|
||||
@TableField(value = "UnitID")
|
||||
private Integer unitID;
|
||||
|
||||
/**
|
||||
* 操作类型(“排水”或“倒水”)
|
||||
*/
|
||||
@TableField(value = "OperationType")
|
||||
private String operationType;
|
||||
|
||||
/**
|
||||
* 操作时间(小时)
|
||||
*/
|
||||
@TableField(value = "OperationTime")
|
||||
private Double operationTime;
|
||||
|
||||
/**
|
||||
* 排水量/倒水量(单位:立方米)
|
||||
*/
|
||||
@TableField(value = "Volume")
|
||||
private Integer volume;
|
||||
|
||||
/**
|
||||
* 月份(格式:YYYY-MM-dd)
|
||||
*/
|
||||
@TableField(value = "Month")
|
||||
private LocalDate month;
|
||||
|
||||
/**
|
||||
* 班次(白班、零点班、四点班)
|
||||
*/
|
||||
@TableField(value = "Sailings")
|
||||
private String sailings;
|
||||
|
||||
/**
|
||||
* 启动时间(格式:YYYY-MM-dd HH:mm:ss)
|
||||
*/
|
||||
@TableField(value = "StartupTime")
|
||||
private Date startupTime;
|
||||
|
||||
/**
|
||||
* 停止时间(格式:YYYY-MM-dd HH:mm:ss)
|
||||
*/
|
||||
@TableField(value = "EndTime")
|
||||
private Date endTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FangpaishuiPumpoperationrecord other = (FangpaishuiPumpoperationrecord) that;
|
||||
return (this.getRecordID() == null ? other.getRecordID() == null : this.getRecordID().equals(other.getRecordID()))
|
||||
&& (this.getUnitID() == null ? other.getUnitID() == null : this.getUnitID().equals(other.getUnitID()))
|
||||
&& (this.getOperationType() == null ? other.getOperationType() == null : this.getOperationType().equals(other.getOperationType()))
|
||||
&& (this.getOperationTime() == null ? other.getOperationTime() == null : this.getOperationTime().equals(other.getOperationTime()))
|
||||
&& (this.getVolume() == null ? other.getVolume() == null : this.getVolume().equals(other.getVolume()))
|
||||
&& (this.getMonth() == null ? other.getMonth() == null : this.getMonth().equals(other.getMonth()))
|
||||
&& (this.getSailings() == null ? other.getSailings() == null : this.getSailings().equals(other.getSailings()))
|
||||
&& (this.getStartupTime() == null ? other.getStartupTime() == null : this.getStartupTime().equals(other.getStartupTime()))
|
||||
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getRecordID() == null) ? 0 : getRecordID().hashCode());
|
||||
result = prime * result + ((getUnitID() == null) ? 0 : getUnitID().hashCode());
|
||||
result = prime * result + ((getOperationType() == null) ? 0 : getOperationType().hashCode());
|
||||
result = prime * result + ((getOperationTime() == null) ? 0 : getOperationTime().hashCode());
|
||||
result = prime * result + ((getVolume() == null) ? 0 : getVolume().hashCode());
|
||||
result = prime * result + ((getMonth() == null) ? 0 : getMonth().hashCode());
|
||||
result = prime * result + ((getSailings() == null) ? 0 : getSailings().hashCode());
|
||||
result = prime * result + ((getStartupTime() == null) ? 0 : getStartupTime().hashCode());
|
||||
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", recordID=").append(recordID);
|
||||
sb.append(", unitID=").append(unitID);
|
||||
sb.append(", operationType=").append(operationType);
|
||||
sb.append(", operationTime=").append(operationTime);
|
||||
sb.append(", volume=").append(volume);
|
||||
sb.append(", month=").append(month);
|
||||
sb.append(", sailings=").append(sailings);
|
||||
sb.append(", startupTime=").append(startupTime);
|
||||
sb.append(", endTime=").append(endTime);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
86
src/main/java/com/jdc/jdcproject/entity/FangpaishuiUnit.java
Normal file
86
src/main/java/com/jdc/jdcproject/entity/FangpaishuiUnit.java
Normal file
@ -0,0 +1,86 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 机组表;
|
||||
* @TableName fangpaishui_unit
|
||||
*/
|
||||
@TableName(value ="fangpaishui_unit")
|
||||
@Data
|
||||
public class FangpaishuiUnit implements Serializable {
|
||||
/**
|
||||
* 主键,唯一标识机组
|
||||
*/
|
||||
@TableId(value = "UnitID")
|
||||
private Integer unitID;
|
||||
|
||||
/**
|
||||
* 外键,关联所属设备
|
||||
*/
|
||||
@TableField(value = "EquipmentId")
|
||||
private Integer equipmentId;
|
||||
|
||||
/**
|
||||
* 机组编号(如“4#多级泵(200)”)
|
||||
*/
|
||||
@TableField(value = "UnitCode")
|
||||
private String unitCode;
|
||||
|
||||
/**
|
||||
* 额定排水量(固定属性)
|
||||
*/
|
||||
@TableField(value = "RatedCapacity")
|
||||
private Integer ratedCapacity;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FangpaishuiUnit other = (FangpaishuiUnit) that;
|
||||
return (this.getUnitID() == null ? other.getUnitID() == null : this.getUnitID().equals(other.getUnitID()))
|
||||
&& (this.getEquipmentId() == null ? other.getEquipmentId() == null : this.getEquipmentId().equals(other.getEquipmentId()))
|
||||
&& (this.getUnitCode() == null ? other.getUnitCode() == null : this.getUnitCode().equals(other.getUnitCode()))
|
||||
&& (this.getRatedCapacity() == null ? other.getRatedCapacity() == null : this.getRatedCapacity().equals(other.getRatedCapacity()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getUnitID() == null) ? 0 : getUnitID().hashCode());
|
||||
result = prime * result + ((getEquipmentId() == null) ? 0 : getEquipmentId().hashCode());
|
||||
result = prime * result + ((getUnitCode() == null) ? 0 : getUnitCode().hashCode());
|
||||
result = prime * result + ((getRatedCapacity() == null) ? 0 : getRatedCapacity().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", unitID=").append(unitID);
|
||||
sb.append(", equipmentId=").append(equipmentId);
|
||||
sb.append(", unitCode=").append(unitCode);
|
||||
sb.append(", ratedCapacity=").append(ratedCapacity);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,160 @@
|
||||
package com.jdc.jdcproject.entity.VO;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 泵站操作VO
|
||||
*/
|
||||
@Data
|
||||
public class FangpaishuiPumpoperationrecordVo implements Serializable {
|
||||
/**
|
||||
* 主键,唯一标识操作记录
|
||||
*/
|
||||
@TableId(value = "RecordID")
|
||||
@Schema(description = "主键")
|
||||
private Integer recordID;
|
||||
|
||||
/**
|
||||
* 外键,关联操作的设备
|
||||
*/
|
||||
@Schema(description = "设备ID")
|
||||
private Integer EquipmentId;
|
||||
|
||||
/**
|
||||
* 外键,关联操作的机组
|
||||
*/
|
||||
@Schema(description = "机组编码")
|
||||
private String unitCode;
|
||||
|
||||
/**
|
||||
* 外键,关联操作的设备
|
||||
*/
|
||||
@Schema(description = "设备名称")
|
||||
private String EquipmentName;
|
||||
|
||||
/**
|
||||
* 外键,关联操作的机组
|
||||
*/
|
||||
@Schema(description = "机组ID")
|
||||
private Integer unitID;
|
||||
|
||||
/**
|
||||
* 额定排水量(固定属性)
|
||||
*/
|
||||
@Schema(description = "额定排水量")
|
||||
private Integer ratedCapacity;
|
||||
|
||||
/**
|
||||
* 班次(白班、零点班、四点班)
|
||||
*/
|
||||
@Schema(description = "班次")
|
||||
private String sailings;
|
||||
|
||||
/**
|
||||
* 操作类型(“排水”或“倒水”)
|
||||
*/
|
||||
@Schema(description = "操作类型")
|
||||
private String operationType;
|
||||
|
||||
/**
|
||||
* 操作时间(小时)
|
||||
*/
|
||||
@Schema(description = "操作时间(小时)")
|
||||
private Double operationTime;
|
||||
|
||||
/**
|
||||
* 排水量/倒水量(单位:立方米)
|
||||
*/
|
||||
@Schema(description = "排水量/倒水量(单位:立方米)")
|
||||
private Integer volume;
|
||||
|
||||
/**
|
||||
* 日期(格式:YYYY-MM-dd )
|
||||
*/
|
||||
@Schema(description = "日期")
|
||||
private LocalDate month;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 启动时间(格式:YYYY-MM-dd HH:mm:ss )
|
||||
*/
|
||||
@Schema(description = "启动时间")
|
||||
private Date startupTime;
|
||||
|
||||
/**
|
||||
* 停止时间(格式:YYYY-MM-dd HH:mm:ss )
|
||||
*/
|
||||
@Schema(description = "停止时间")
|
||||
private Date endTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FangpaishuiPumpoperationrecordVo other = (FangpaishuiPumpoperationrecordVo) that;
|
||||
return (this.getRecordID() == null ? other.getRecordID() == null : this.getRecordID().equals(other.getRecordID()))
|
||||
&& (this.getUnitID() == null ? other.getUnitID() == null : this.getUnitID().equals(other.getUnitID()))
|
||||
&& (this.getOperationType() == null ? other.getOperationType() == null : this.getOperationType().equals(other.getOperationType()))
|
||||
&& (this.getOperationTime() == null ? other.getOperationTime() == null : this.getOperationTime().equals(other.getOperationTime()))
|
||||
&& (this.getVolume() == null ? other.getVolume() == null : this.getVolume().equals(other.getVolume()))
|
||||
&& (this.getMonth() == null ? other.getMonth() == null : this.getMonth().equals(other.getMonth()))
|
||||
&& (this.getSailings() == null ? other.getSailings() == null : this.getSailings().equals(other.getSailings()))
|
||||
&& (this.getStartupTime() == null ? other.getStartupTime() == null : this.getStartupTime().equals(other.getStartupTime()))
|
||||
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getRecordID() == null) ? 0 : getRecordID().hashCode());
|
||||
result = prime * result + ((getUnitID() == null) ? 0 : getUnitID().hashCode());
|
||||
result = prime * result + ((getOperationType() == null) ? 0 : getOperationType().hashCode());
|
||||
result = prime * result + ((getOperationTime() == null) ? 0 : getOperationTime().hashCode());
|
||||
result = prime * result + ((getVolume() == null) ? 0 : getVolume().hashCode());
|
||||
result = prime * result + ((getMonth() == null) ? 0 : getMonth().hashCode());
|
||||
result = prime * result + ((getSailings() == null) ? 0 : getSailings().hashCode());
|
||||
result = prime * result + ((getStartupTime() == null) ? 0 : getStartupTime().hashCode());
|
||||
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", recordID=").append(recordID);
|
||||
sb.append(", unitID=").append(unitID);
|
||||
sb.append(", operationType=").append(operationType);
|
||||
sb.append(", operationTime=").append(operationTime);
|
||||
sb.append(", volume=").append(volume);
|
||||
sb.append(", month=").append(month);
|
||||
sb.append(", sailings=").append(sailings);
|
||||
sb.append(", startupTime=").append(startupTime);
|
||||
sb.append(", endTime=").append(endTime);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.jdc.jdcproject.entity.VO;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FangpaishuiUnitVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键")
|
||||
@TableId("UnitID")
|
||||
private int UnitID;
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private int EquipmentId;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
@Schema(description = "机组编号")
|
||||
private String UnitCode;
|
||||
|
||||
@Schema(description = "额定排水量")
|
||||
private int ratedCapacity;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FangpaishuiUnit{" +
|
||||
"UnitID = " + UnitID +
|
||||
", EquipmentId = " + EquipmentId +
|
||||
", equipmentName = " + equipmentName +
|
||||
", UnitCode = " + UnitCode +
|
||||
", ratedCapacity = " + ratedCapacity +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 95262
|
||||
* @description 针对表【fangpaishui_pumpoperationrecord(泵站操作记录表;)】的数据库操作Mapper
|
||||
* @createDate 2025-05-07 13:37:49
|
||||
* @Entity com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord
|
||||
*/
|
||||
public interface FangpaishuiPumpoperationrecordMapper extends BaseMapper<FangpaishuiPumpoperationrecord> {
|
||||
|
||||
List<FangpaishuiPumpoperationrecordVo> findDetail(FangpaishuiPumpoperationrecordVo vo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.FangpaishuiUnit;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeMininglossVo;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 95262
|
||||
* @description 针对表【fangpaishui_unit(机组表;)】的数据库操作Mapper
|
||||
* @createDate 2025-05-07 09:47:44
|
||||
* @Entity com.jdc.jdcproject.entity.FangpaishuiUnit
|
||||
*/
|
||||
public interface FangpaishuiUnitMapper extends BaseMapper<FangpaishuiUnit> {
|
||||
|
||||
|
||||
List<FangpaishuiUnitVo> findUnitByDetail(FangpaishuiUnitVo vo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
<?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.jdc.jdcproject.mapper.FangpaishuiPumpoperationrecordMapper">
|
||||
<select id="findDetail" parameterType="com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo" resultType="com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo">
|
||||
select fp.RecordID,
|
||||
e.EquipmentId,
|
||||
e.EquipmentName,
|
||||
fn.UnitId,
|
||||
fn.UnitCode,
|
||||
fn.RatedCapacity,
|
||||
fp.OperationType,
|
||||
fp.Sailings,
|
||||
fp.StartupTime,
|
||||
fp.EndTime,
|
||||
fp.OperationTime,
|
||||
fp.Month
|
||||
FROM fangpaishui_pumpoperationrecord fp
|
||||
LEFT JOIN fangpaishui_unit fn ON fn.UnitID = fp.UnitID and fn.EquipmentId
|
||||
join equipment e on fn.EquipmentId = e.EquipmentId
|
||||
<where>
|
||||
<if test="operationType !=null">
|
||||
and fp.OperationType = #{operationType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?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.jdc.jdcproject.mapper.FangpaishuiUnitMapper">
|
||||
|
||||
<select id="findUnitByDetail" parameterType="com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo" resultType="com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo">
|
||||
select fn.*,
|
||||
e.equipmentName
|
||||
FROM fangpaishui_unit fn
|
||||
LEFT JOIN equipment e ON e.EquipmentId = fn.EquipmentId
|
||||
<where>
|
||||
<if test="UnitID !=0">
|
||||
and fn.UnitID = #{UnitID}
|
||||
</if>
|
||||
<if test="equipmentName !=null">
|
||||
and e.equipmentName like concat(concat('%',#{equipmentName}),'%')
|
||||
</if>
|
||||
<if test="UnitCode !=null">
|
||||
and fn.UnitCode like concat(concat('%',#{UnitCode}),'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,17 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 95262
|
||||
* @description 针对表【fangpaishui_pumpoperationrecord(泵站操作记录表;)】的数据库操作Service
|
||||
* @createDate 2025-05-07 13:37:49
|
||||
*/
|
||||
public interface FangpaishuiPumpoperationrecordService extends IService<FangpaishuiPumpoperationrecord> {
|
||||
List<FangpaishuiPumpoperationrecordVo> findDetail(FangpaishuiPumpoperationrecordVo vo);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.FangpaishuiUnit;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeMininglossVo;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 95262
|
||||
* @description 针对表【fangpaishui_unit(机组表;)】的数据库操作Service
|
||||
* @createDate 2025-05-07 09:47:44
|
||||
*/
|
||||
public interface FangpaishuiUnitService extends IService<FangpaishuiUnit> {
|
||||
|
||||
|
||||
List<FangpaishuiUnitVo> findUnitByDetail(FangpaishuiUnitVo vo);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo;
|
||||
import com.jdc.jdcproject.service.FangpaishuiPumpoperationrecordService;
|
||||
import com.jdc.jdcproject.mapper.FangpaishuiPumpoperationrecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 95262
|
||||
* @description 针对表【fangpaishui_pumpoperationrecord(泵站操作记录表;)】的数据库操作Service实现
|
||||
* @createDate 2025-05-07 13:37:49
|
||||
*/
|
||||
@Service
|
||||
public class FangpaishuiPumpoperationrecordServiceImpl extends ServiceImpl<FangpaishuiPumpoperationrecordMapper, FangpaishuiPumpoperationrecord>
|
||||
implements FangpaishuiPumpoperationrecordService{
|
||||
|
||||
@Override
|
||||
public List<FangpaishuiPumpoperationrecordVo> findDetail(FangpaishuiPumpoperationrecordVo vo) {
|
||||
return baseMapper.findDetail(vo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jdc.jdcproject.entity.FangpaishuiUnit;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
|
||||
import com.jdc.jdcproject.service.FangpaishuiUnitService;
|
||||
import com.jdc.jdcproject.mapper.FangpaishuiUnitMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 95262
|
||||
* @description 针对表【fangpaishui_unit(机组表;)】的数据库操作Service实现
|
||||
* @createDate 2025-05-07 09:47:44
|
||||
*/
|
||||
@Service
|
||||
public class FangpaishuiUnitServiceImpl extends ServiceImpl<FangpaishuiUnitMapper, FangpaishuiUnit>
|
||||
implements FangpaishuiUnitService{
|
||||
|
||||
|
||||
@Override
|
||||
public List<FangpaishuiUnitVo> findUnitByDetail(FangpaishuiUnitVo vo) {
|
||||
return baseMapper.findUnitByDetail(vo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user