package com.xunhong.erp.turbo.biz.infrastructure.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author shenyifei
 */
@Data
@TableName(value = "product", autoResultMap = true)
@EqualsAndHashCode(callSuper = true)
public class ProductDO extends BaseDO<ProductDO> {

	/**
	 * 产品ID
	 */
	@TableId(value = "product_id", type = IdType.ASSIGN_ID)
	private Long productId;

	/**
	 * 产品名称
	 */
	@TableField(value = "name")
	private String name;

	/**
	 * 关联费用id
	 */
	@TableField(value = "cost_ids", typeHandler = JacksonTypeHandler.class)
	private List<Long> costIds;

	/**
	 * 备注
	 */
	@TableField(value = "remark")
	private String remark;

	/**
	 * 排序号
	 */
	@TableField(value = "sort")
	private BigDecimal sort;

	/**
	 * 状态：1_启用；0_禁用
	 */
	@TableField(value = "status")
	private Boolean status;

	@TableField(value = "cost_template")
	private String costTemplate;

	@TableField(exist = false)
	private List<CostDO> costDOList;

}

