package com.crunii.micro.domain.entitysql.main;

import com.crunii.micro.domain.common.jdbc.dto.AbsSetProps;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

@Entity
@Table(name = "t_oper_log")
@DynamicInsert
@DynamicUpdate
@Getter
@ToString
@EqualsAndHashCode(of = { "id" })
@ApiModel(description = "数据库操作日志表")
public class TOperLogS extends AbsSetProps {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@ApiModelProperty(value = "主键")
	private long id;

	@Column(name = "call_serial")
	@ApiModelProperty(value = "调用批次")
	private String callSerial;

	@Column(name = "call_url")
	@ApiModelProperty(value = "调用url")
	private String callUrl;

	@Column(name = "login_id")
	@ApiModelProperty(value = "登录id")
	private int loginId;

	@Column(name = "login_code")
	@ApiModelProperty(value = "登录工号")
	private String loginCode;

	@Column(name = "worker_name")
	@ApiModelProperty(value = "员工姓名")
	private String workerName;

	@Column(name = "table_name")
	@ApiModelProperty(value = "表名")
	private String tableName;

	@Column(name = "id_name")
	@ApiModelProperty(value = "主键列名")
	private String idName;

	@Column(name = "id_value")
	@ApiModelProperty(value = "主键值")
	private String idValue;

	@Column(name = "oper_action")
	@ApiModelProperty(value = "操作动作 1：插入 2：更新 3：删除【字典ID：7000010】")
	private int operAction;

	@Column(name = "action_name")
	@ApiModelProperty(value = "动作名称")
	private String actionName;

	@Column(name = "column_name")
	@ApiModelProperty(value = "列名")
	private String columnName;

	@Column(name = "column_value")
	@ApiModelProperty(value = "列值")
	private String columnValue;

	@Column(name = "before_value")
	@ApiModelProperty(value = "改前值")
	private String beforeValue;

	@Column(name = "after_value")
	@ApiModelProperty(value = "改后值")
	private String afterValue;

	@Column(name = "create_time")
	@ApiModelProperty(value = "创建时间")
	private java.util.Date createTime;

	public void setId(long id) {
		this.id = id;
	}

	public void setCallSerial(String callSerial) {
		this.callSerial = callSerial;
		fireSet("callSerial", callSerial);
	}

	public void setCallUrl(String callUrl) {
		this.callUrl = callUrl;
		fireSet("callUrl", callUrl);
	}

	public void setLoginId(int loginId) {
		this.loginId = loginId;
		fireSet("loginId", loginId);
	}

	public void setLoginCode(String loginCode) {
		this.loginCode = loginCode;
		fireSet("loginCode", loginCode);
	}

	public void setWorkerName(String workerName) {
		this.workerName = workerName;
		fireSet("workerName", workerName);
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
		fireSet("tableName", tableName);
	}

	public void setIdName(String idName) {
		this.idName = idName;
		fireSet("idName", idName);
	}

	public void setIdValue(String idValue) {
		this.idValue = idValue;
		fireSet("idValue", idValue);
	}

	public void setOperAction(int operAction) {
		this.operAction = operAction;
		fireSet("operAction", operAction);
	}

	public void setActionName(String actionName) {
		this.actionName = actionName;
		fireSet("actionName", actionName);
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
		fireSet("columnName", columnName);
	}

	public void setColumnValue(String columnValue) {
		this.columnValue = columnValue;
		fireSet("columnValue", columnValue);
	}

	public void setBeforeValue(String beforeValue) {
		this.beforeValue = beforeValue;
		fireSet("beforeValue", beforeValue);
	}

	public void setAfterValue(String afterValue) {
		this.afterValue = afterValue;
		fireSet("afterValue", afterValue);
	}

	public void setCreateTime(java.util.Date createTime) {
		this.createTime = createTime;
		fireSet("createTime", createTime);
	}

}
