package com.kcim.dao.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient;

import java.io.Serializable;
import java.util.List;

/**
 * 责任中心表
 * 
 * @author huangrui
 * @email 
 * @date 2021-07-27 10:41:59
 */
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("cost_responsibility")
public class Responsibility implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@TableId
	private Long id;
	/**
	 * 名称
	 */
	private String responsibilityName;
	/**
	 * 责任中心代码
	 */
	private String responsibilityCode;
	/**
	 * 上级id
	 */
	private Long parentId;
	/**
	 * 医院id
	 */
	private Long hospId;
	/**
	 * 是否汇总中心1.是，2.不是
	 */
	private Integer isGatherCenter;
	/**
	 * 责任类型 1. 收费中心，2.成本(费用)中心
	 */
	private Integer responsibilityType;

	/**
	 * 是否默认 0.不是，1.是
	 */
	private Integer isDefault;
	/**
	 * 分摊级别的Id
	 */
	private Long shareId;
	/**
	 * 分摊级别 如果是顶层默认为0
	 */
	private Integer shareLevel;

	/**
	 * 分摊级别名称
	 */
	private String shareName;
	/**
	 * 创建时间13位时间戳
	 */
	private Long createTime;
	/**
	 * 删除时间，如果存在表示已删除13位时间戳
	 */
	@TableLogic(value = "0",delval = "UNIX_TIMESTAMP(NOW()) * 1000")
	private Long deleteTime;

	@TableField(exist = false)
	@Transient
	private List<Responsibility> children;

	public Responsibility(String responsibilityCode, String responsibilityName,Long parentId) {
		this.responsibilityCode = responsibilityCode;
		this.responsibilityName = responsibilityName;
		this.parentId = parentId;
	}

	/**
	 * 标准分摊层级 标准分摊层级代码 1.行政后勤类,2.医疗辅助类,3.医疗技术类,4.临床服务类
	 */
	private String standardShareLevel;
	@TableField(exist = false)
	private String standardShareLevelName;

	/**
	 * 责任中心类型
	 */
	private String type;
	@TableField(exist = false)
	private String typeName;
	/**
	 * 排序
	 */
	private Integer sort;
	/**
	 * 启用标志 0未启用 1启用
	 */
	private Integer status;

}
