package com.chushang.system.entity.po;

import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.chushang.common.mybatis.annotation.Condition;
import com.chushang.common.mybatis.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 字典类型表 sys_dict_type
 *
 * @author ruoyi
 */
@Setter
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_dict_type")
public class SysDictType extends BaseEntity
{
    @Serial
    private static final long serialVersionUID = 1L;

    /** 字典主键 */
    @TableId(value = "dict_id", type = IdType.ASSIGN_ID)
    @ExcelProperty(value = "字典主键", index = 0)
    private Long dictId;

    /** 字典名称 */
    @ExcelProperty(value = "字典名称", index = 1)
    @Condition(name = "dict_name", type = Condition.ConditionType.like)
    private String dictName;

    /** 字典类型 */
    @ExcelProperty(value = "字典类型", index = 2)
    @Condition(name = "dict_type", type = Condition.ConditionType.eq)
    private String dictType;

    /** 状态（1正常 0停用） */
    @ExcelProperty(value = "状态", index = 3)
    @Condition(name = "status", type = Condition.ConditionType.eq)
    private Boolean status;
    /**
     * 查询区间
     */
    @Condition(name = "create_time", type = Condition.ConditionType.between)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DatePattern.NORM_DATETIME_PATTERN)
    @TableField(exist = false)
    private List<LocalDateTime> createTimes;

}
