package com.muyu.system.domain.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.model.QueryModel;
import com.muyu.system.domain.rep.SysDeptListReq;
import com.muyu.system.domain.rep.SysDictTypeListReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.Date;

/**
 * 参数配置 分页 模型
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class SysDictTypePageQueryModel extends QueryModel<SysDictTypePageQueryModel> {

    /**
     * 字典名称
     */
    private String dictName;

    /**
     * 字典类型
     */
    private String dictType;

    /**
     * 状态（0正常 1停用）
     */
    private String status;

    /**
     * 开始时间
     */
    private Date beginTime;

    /**
     * 结束时间
     */
    private Date endTime;

    public static SysDictTypePageQueryModel reqBuild(SysDictTypeListReq sysDictTypeListReq) {
        SysDictTypePageQueryModel sysDictTypePageQueryModel = SysDictTypePageQueryModel.builder()
                .dictName(sysDictTypeListReq.getDictName())
                .dictType(sysDictTypeListReq.getDictType())
                .status(sysDictTypeListReq.getStatus())
                .beginTime(sysDictTypeListReq.getBeginTime())
                .endTime(sysDictTypeListReq.getEndTime())
                .build();
        sysDictTypePageQueryModel.domainBuild(sysDictTypeListReq);
        return sysDictTypePageQueryModel;
    }
}
