package com.yh.saas.plugin.clouddisk.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.yh.saas.common.support.entity.BaseModel;
import com.yh.saas.common.support.util.query.SearchField;
import com.yh.saas.common.support.util.query.SearchMode;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sysmgr_data_manager_file_info")
public class DataManagerFileInfo extends BaseModel<DataManagerFileInfo> {

    /**
     * 主键id
     */
    @TableId(type = IdType.INPUT)
    private String fileId;

    /**
     * 附件id
     */
    private String appendixId;

    /**
     * 文件名称
     */
    @SearchField(value = "file_name")
    private String fileName;

    /**
     * 文件大小
     */
    private String fileSize;

    /**
     * 文件路径
     */
    private String filePath;

    /**
     * 公司id
     */
    @SearchField(value = "comp_id", mode = SearchMode.EQ)
    private String compId;

    /**
     * 文件类型
     */
    @SearchField(value = "file_info_type", mode = SearchMode.IN)
    private String fileInfoType;

    /**
     * 文件夹id
     */
    @SearchField(value = "folder_id", mode = SearchMode.EQ)
    private String folderId;

    /**
     * 是否同步标识
     */
    private String synchronizationFlag;

    /**
     * 修改时间(前端vo)
     */
    @SearchField(value = "update_date", mode = SearchMode.GE)
    @TableField(exist = false)
    private String updateTimeStart;

    @SearchField(value = "update_date", mode = SearchMode.LE)
    @TableField(exist = false)
    private String updateTimeEnd;

    /**
     * 附件id集合
     */
    @TableField(exist = false)
    private List<String> appendixIds;

    @Override
    protected Serializable pkVal() {
        return this.fileId;
    }

    public static class QueryFields {

        public static final String COMP_ID = "comp_id";

        public static final String FILE_ID = "file_id";

        public static final String FOLDER_ID = "folder_id";

        public static final String FILE_INFO_TYPE = "file_info_type";

        public static final String FILE_SIZE = "file_size";

        public static final String FILE_NAME = "file_name";

    }
}
