package com.ssj.bean.weixin.zyb.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.ssj.bean.common.framework.core.domain.BaseEntity;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/** 
 * @author  ZhangCaibao 
 * @version 2018年5月6日 上午11:01:14 
 * 类说明 
 */
@Entity
@Table(name = "zyb_day")
public class ZuoybDay extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 6385562926417114058L;
	
	private String vipId;
	/**
	 * 创建时间
	 */
	
	private Date  createTime;
	/**
	 * 那天日期
	 */
	private Date thatDay;
	/**
	 * 1作业2难题3一对一4小课
	 */
	private String type;
	
	private Integer num;//该类别某天总数
	
	/**
	 * 作业
	 */
	private Integer hasHomeWork;
	/**
	 * 难题
	 */
	private Integer hasProblem;
	/**
	 * 一对一
	 */
	private Integer hasOneTwoOne;

	/**
	 * 小课
	 */
	private Integer hasLessonGroup;

	public String getVipId() {
		return vipId;
	}

	public void setVipId(String vipId) {
		this.vipId = vipId;
	}
	@JSONField(serialize=false)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@JSONField(format = "yyyy-MM-dd")
	public Date getThatDay() {
		return thatDay;
	}

	public void setThatDay(Date thatDay) {
		this.thatDay = thatDay;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
    @Transient
	public Integer getHasHomeWork() {
		if (hasHomeWork != null) {
			return hasHomeWork;
		}
		hasHomeWork = 0;
		if (StringUtils.isNotBlank(type) && type.contains("1")) {
			hasHomeWork = 1;
		}
		return hasHomeWork;
	}

	public void setHasHomeWork(Integer hasHomeWork) {
		this.hasHomeWork = hasHomeWork;
	}
	@Transient
	public Integer getHasProblem() {
		if (hasProblem != null) {
			return hasProblem;
		}
		hasProblem = 0;
		if (StringUtils.isNotBlank(type) && type.contains("2")) {
			hasProblem = 1;
		}
		return hasProblem;
	}

	public void setHasProblem(Integer hasProblem) {
		this.hasProblem = hasProblem;
	}
	@Transient
	public Integer getHasOneTwoOne() {
		return this.hasOneTwoOne;
	}

	public void setHasOneTwoOne(Integer hasOneTwoOne) {
		this.hasOneTwoOne = hasOneTwoOne;
	}

	@Transient
	public Integer getHasLessonGroup() {
		return this.hasLessonGroup;
	}

	public void setHasLessonGroup(Integer hasLessonGroup) {
		this.hasLessonGroup = hasLessonGroup;
	}

	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

}
