package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 商家经营数据统计历史表
 *
 * @author auto-generated
 * @since 2025-01-05
 */
@Data
@JsonInclude
@TableName("store_operational_statistics_history")
@ApiModel(value = "StoreOperationalStatisticsHistory对象", description = "商家经营数据统计历史表")
public class StoreOperationalStatisticsHistory {

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "商铺ID")
    @TableField("store_id")
    private Integer storeId;

    @ApiModelProperty(value = "统计开始时间")
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty(value = "统计结束时间")
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

    @ApiModelProperty(value = "上期开始时间")
    @TableField("previous_start_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date previousStartTime;

    @ApiModelProperty(value = "上期结束时间")
    @TableField("previous_end_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date previousEndTime;

    @ApiModelProperty(value = "统计数据（JSON格式，包含所有统计字段）")
    @TableField("statistics_data")
    private String statisticsData;

    @ApiModelProperty(value = "查询时间（统计数据的时间）")
    @TableField("query_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date queryTime;

    @ApiModelProperty(value = "PDF文件URL（前端生成的PDF文件地址）")
    @TableField("pdf_url")
    private String pdfUrl;

    @ApiModelProperty(value = "AI分析是否完成, 0:未完成, 1:已完成")
    @TableField("ai_analysis_completed")
    private Integer aiAnalysisCompleted;

    @ApiModelProperty(value = "总结")
    @TableField("summary")
    private String summary;

    @ApiModelProperty(value = "优化建议")
    @TableField("optimization_suggestions")
    private String optimizationSuggestions;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;
}
