package com.zy.acs.manager.manager.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.zy.acs.framework.common.Cools; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; @Data @TableName("man_guarantee") public class Guarantee implements Serializable { private static final long serialVersionUID = 1L; /** * ID */ @ApiModelProperty(value= "ID") @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 标识 */ @ApiModelProperty(value= "标识") private String uuid; /** * 名称 */ @ApiModelProperty(value= "名称") private String name; /** * 作用范围 */ @ApiModelProperty(value= "作用范围") private String scopeType; /** * 范围值 */ @ApiModelProperty(value= "范围值") private String scopeValue; /** * 调度时间 */ @ApiModelProperty(value= "调度时间") private String cronExpr; /** * 目标数量 */ @ApiModelProperty(value= "目标数量") private Integer requiredCount; /** * 最低电量 */ @ApiModelProperty(value= "最低电量") private Integer minSoc; /** * 准备时间 */ @ApiModelProperty(value= "准备时间") private Integer leadTime; /** * 状态 1: 正常 0: 冻结 */ @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") private Integer status; /** * 是否删除 1: 是 0: 否 */ @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") @TableLogic private Integer deleted; /** * 租户 */ @ApiModelProperty(value= "租户") private Integer tenantId; /** * 添加人员 */ @ApiModelProperty(value= "添加人员") private Long createBy; /** * 添加时间 */ @ApiModelProperty(value= "添加时间") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date createTime; /** * 修改人员 */ @ApiModelProperty(value= "修改人员") private Long updateBy; /** * 修改时间 */ @ApiModelProperty(value= "修改时间") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date updateTime; /** * 备注 */ @ApiModelProperty(value= "备注") private String memo; public Guarantee() {} public Guarantee(String uuid,String name,String scopeType,String scopeValue,String cronExpr,Integer requiredCount,Integer minSoc,Integer leadTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { this.uuid = uuid; this.name = name; this.scopeType = scopeType; this.scopeValue = scopeValue; this.cronExpr = cronExpr; this.requiredCount = requiredCount; this.minSoc = minSoc; this.leadTime = leadTime; this.status = status; this.deleted = deleted; this.tenantId = tenantId; this.createBy = createBy; this.createTime = createTime; this.updateBy = updateBy; this.updateTime = updateTime; this.memo = memo; } // Guarantee guarantee = new Guarantee( // null, // 标识 // null, // 名称 // null, // 作用范围 // null, // 范围值 // null, // 调度时间 // null, // 目标数量 // null, // 最低电量 // null, // 准备时间 // null, // 状态[非空] // null, // 是否删除[非空] // null, // 租户 // null, // 添加人员 // null, // 添加时间[非空] // null, // 修改人员 // null, // 修改时间 // null // 备注 // ); public String getCreateTime$(){ if (Cools.isEmpty(this.createTime)){ return ""; } return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); } public String getUpdateTime$(){ if (Cools.isEmpty(this.updateTime)){ return ""; } return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); } public Boolean getStatusBool(){ if (null == this.status){ return null; } switch (this.status){ case 1: return true; case 0: return false; default: return null; } } }