package com.jeesite.modules.admin.wenjuan.entity;

import javax.validation.Valid;
import javax.validation.constraints.Size;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 问卷调查表Entity
 * @author wlc
 * @version 2022-06-18
 */
@Table(name="admin_questionnaire_survey", alias="a", label="问卷调查表信息", columns={
		@Column(name="id", attrName="id", label="主键ID", isPK=true),
		@Column(name="user_code", attrName="userCode", label="问卷创建人编码"),
		@Column(name="question_name", attrName="questionName", label="问卷标题"),
		@Column(name="description", attrName="description", label="描述"),
		@Column(name="begin_date", attrName="beginDate", label="开始时间", isUpdateForce=true),
		@Column(name="end_date", attrName="endDate", label="结束时间", isUpdateForce=true),
		@Column(name="total", attrName="total", label="总票数", isUpdateForce=true),
		@Column(name="mode", attrName="mode", label="模式", comment="模式(1：独立访客  2：独立IP  3：独立用户)", isUpdateForce=true),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false, isUpdateForce=true),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false, isUpdateForce=true),
		@Column(name="remarks", attrName="remarks", label="备注"),
		@Column(name="site_id", attrName="siteId", label="站点ID", isUpdateForce=true),
		@Column(name="state", attrName="state", label="状态", comment="状态(0：启用  1：禁用)", isUpdateForce=true),
	}, orderBy="a.update_date DESC"
)
public class AdminQuestionnaireSurvey extends DataEntity<AdminQuestionnaireSurvey> {
	
	private static final long serialVersionUID = 1L;
	private String userCode;		// 问卷创建人编码
	private String questionName;		// 问卷标题
	private String description;		// 描述
	private Date beginDate;		// 开始时间
	private Date endDate;		// 结束时间
	private Integer total;		// 总票数
	private Integer mode;		// 模式(1：独立访客  2：独立IP  3：独立用户)
	private Integer siteId;		// 站点ID
	private Long state;		// 状态(0：启用  1：禁用)
	private List<AdminQuestionItem> adminQuestionItemList = ListUtils.newArrayList();		// 子表列表
	
	public AdminQuestionnaireSurvey() {
		this(null);
	}
	
	public AdminQuestionnaireSurvey(String id){
		super(id);
	}
	
	@Size(min=0, max=255, message="问卷创建人编码长度不能超过 255 个字符")
	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	
	@Size(min=0, max=255, message="问卷标题长度不能超过 255 个字符")
	public String getQuestionName() {
		return questionName;
	}

	public void setQuestionName(String questionName) {
		this.questionName = questionName;
	}
	
	@Size(min=0, max=255, message="描述长度不能超过 255 个字符")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}
	
	public Integer getMode() {
		return mode;
	}

	public void setMode(Integer mode) {
		this.mode = mode;
	}
	
	public Integer getSiteId() {
		return siteId;
	}

	public void setSiteId(Integer siteId) {
		this.siteId = siteId;
	}
	
	public Long getState() {
		return state;
	}

	public void setState(Long state) {
		this.state = state;
	}
	
	@Valid
	public List<AdminQuestionItem> getAdminQuestionItemList() {
		return adminQuestionItemList;
	}

	public void setAdminQuestionItemList(List<AdminQuestionItem> adminQuestionItemList) {
		this.adminQuestionItemList = adminQuestionItemList;
	}
	
}