Commit 950a2985 by 丁伟峰

createTime, updateTime 默认值

1 parent a0100d1a
...@@ -34,10 +34,10 @@ public class CapacityEngineerCalendarEntity { ...@@ -34,10 +34,10 @@ public class CapacityEngineerCalendarEntity {
private String memo; private String memo;
@Column(name = "create_time", nullable = false, updatable = false, columnDefinition = "timestamp default current_timestamp") @Column(name = "create_time", nullable = false, updatable = false, columnDefinition = "timestamp default current_timestamp")
private Timestamp createTime; private LocalDateTime createTime = LocalDateTime.now();
@Column(name = "update_time", nullable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp") @Column(name = "update_time", nullable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp")
private Timestamp updateTime; private LocalDateTime updateTime = LocalDateTime.now();
// 其他字段和关联关系的定义 // 其他字段和关联关系的定义
// ... // ...
......
...@@ -63,10 +63,10 @@ public class CapacityEngineerStatEntity { ...@@ -63,10 +63,10 @@ public class CapacityEngineerStatEntity {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
} }
...@@ -68,11 +68,11 @@ public class CapacityOrgStatEntity { ...@@ -68,11 +68,11 @@ public class CapacityOrgStatEntity {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
} }
...@@ -58,9 +58,9 @@ public class CapacityTeamStatEntity implements Serializable { ...@@ -58,9 +58,9 @@ public class CapacityTeamStatEntity implements Serializable {
private String memo; private String memo;
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
} }
...@@ -69,11 +69,11 @@ public class EngineerBusinessEntity implements Serializable { ...@@ -69,11 +69,11 @@ public class EngineerBusinessEntity implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "create_time", nullable = false, updatable = false, columnDefinition = "timestamp default current_timestamp") @Column(name = "create_time", nullable = false, updatable = false, columnDefinition = "timestamp default current_timestamp")
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "update_time", nullable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp") @Column(name = "update_time", nullable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp")
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
} }
...@@ -100,12 +100,12 @@ public class EngineerInfoEntity { ...@@ -100,12 +100,12 @@ public class EngineerInfoEntity {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
public EngineerInfoEntity() {} public EngineerInfoEntity() {}
} }
...@@ -24,7 +24,7 @@ public class OrderEventEntity { ...@@ -24,7 +24,7 @@ public class OrderEventEntity {
private String suborderId; private String suborderId;
@Column(name = "happen", nullable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp") @Column(name = "happen", nullable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp")
private LocalDateTime happen; private LocalDateTime happen = LocalDateTime.now();
@Column(name = "event", nullable = false, length = 50, columnDefinition = "varchar(50) default ''") @Column(name = "event", nullable = false, length = 50, columnDefinition = "varchar(50) default ''")
private String event; private String event;
...@@ -45,10 +45,10 @@ public class OrderEventEntity { ...@@ -45,10 +45,10 @@ public class OrderEventEntity {
private String memo; private String memo;
@Column(name = "create_time", nullable = false, columnDefinition = "datetime default current_timestamp") @Column(name = "create_time", nullable = false, columnDefinition = "datetime default current_timestamp")
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
@Column(name = "update_time", nullable = false, columnDefinition = "datetime default current_timestamp") @Column(name = "update_time", nullable = false, columnDefinition = "datetime default current_timestamp")
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
// Getters and setters (省略) // Getters and setters (省略)
} }
......
package com.dituhui.pea.order.entity;
import lombok.Data;
import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
@Entity
@Table(name = "order_request")
public class OrderRequestEntity {
@Id
private String id;
@Column(name = "order_id", nullable = false)
private String orderId;
@Column(nullable = false)
private LocalDate dt;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String phone;
@Column(nullable = false)
private String address;
@Column(nullable = false)
private String x;
@Column(nullable = false)
private String y;
@Column
private String province;
@Column
private String city;
@Column
private String county;
@Column(nullable = false)
private String brand;
@Column(nullable = false)
private String type;
@Column(nullable = false)
private String skill;
@Column(name = "apply_note")
private String applyNote;
@Column(name = "fault_describe")
private String faultDescribe;
@Column(name = "expect_time_begin", nullable = false, columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP")
private LocalDateTime expectTimeBegin;
@Column(name = "expect_time_end")
private LocalDateTime expectTimeEnd;
@Column(name = "expect_time_desc")
private String expectTimeDesc;
@Column
private String source;
@Column(name = "area_id")
private String areaId;
@Column(name = "order_priority")
private String orderPriority;
@Column(name = "order_tags")
private String orderTags;
@Column
private Integer priority;
@Column
private String tags;
@Column(nullable = false)
private String status;
@Column(name = "appointment_status", nullable = false)
private String appointmentStatus;
@Column(name = "appointment_method", nullable = false)
private String appointmentMethod;
@Column(name = "org_cluster_id")
private String orgClusterId;
@Column(name = "org_cluster_name")
private String orgClusterName;
@Column(name = "org_branch_id")
private String orgBranchId;
@Column(name = "org_branch_name")
private String orgBranchName;
@Column(name = "org_group_id")
private String orgGroupId;
@Column(name = "org_group_name")
private String orgGroupName;
@Column(name = "org_team_id")
private String orgTeamId;
@Column(name = "org_team_name")
private String orgTeamName;
@Column
private String description;
@Column(name = "create_time", nullable = false, columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP")
private LocalDateTime createTime;
@Column(name = "update_time", nullable = false, columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
private LocalDateTime updateTime;
// Getters and Setters
// ...
}
...@@ -19,6 +19,6 @@ public class OrderTagStrategyEntity { ...@@ -19,6 +19,6 @@ public class OrderTagStrategyEntity {
private Integer priority; private Integer priority;
private Integer disabled; private Integer disabled;
private String memo; private String memo;
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
} }
...@@ -45,10 +45,10 @@ public class OrgBranchEntity { ...@@ -45,10 +45,10 @@ public class OrgBranchEntity {
private String memo; private String memo;
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
public OrgBranchEntity() {} public OrgBranchEntity() {}
} }
...@@ -37,10 +37,10 @@ public class OrgClusterEntity { ...@@ -37,10 +37,10 @@ public class OrgClusterEntity {
private String updateUser; private String updateUser;
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
public OrgClusterEntity() { public OrgClusterEntity() {
} }
......
...@@ -81,12 +81,12 @@ public class OrgGroupEntity { ...@@ -81,12 +81,12 @@ public class OrgGroupEntity {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
public OrgGroupEntity() {} public OrgGroupEntity() {}
} }
...@@ -45,12 +45,12 @@ public class OrgTeamEngineerEntity { ...@@ -45,12 +45,12 @@ public class OrgTeamEngineerEntity {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
public OrgTeamEngineerEntity() { public OrgTeamEngineerEntity() {
} }
......
...@@ -90,11 +90,11 @@ public class OrgWarehouseInfoEntity { ...@@ -90,11 +90,11 @@ public class OrgWarehouseInfoEntity {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
} }
...@@ -50,10 +50,10 @@ public class PubParamsEntity { ...@@ -50,10 +50,10 @@ public class PubParamsEntity {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
} }
...@@ -30,10 +30,10 @@ public class SkillGroupEntity { ...@@ -30,10 +30,10 @@ public class SkillGroupEntity {
private String memo; private String memo;
@Column(name = "create_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP") @Column(name = "create_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP")
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
@Column(name = "update_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") @Column(name = "update_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
// Getters and Setters // Getters and Setters
// ... // ...
......
...@@ -58,10 +58,10 @@ public class SkillInfoEntity { ...@@ -58,10 +58,10 @@ public class SkillInfoEntity {
private String memo; private String memo;
@Column(name = "create_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP") @Column(name = "create_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP")
private LocalDateTime createTime; private LocalDateTime createTime = LocalDateTime.now();
@Column(name = "update_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") @Column(name = "update_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
private LocalDateTime updateTime; private LocalDateTime updateTime = LocalDateTime.now();
// Getters and Setters // Getters and Setters
// ... // ...
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!