package com.zksy.WaterSupply.WaterPlantInfo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 水厂信息实体
 */
@Data
@TableName(value = "water_plant_info", schema = "app_user")
@ApiModel(
        value = "WaterPlantInfo",
        description = "水厂信息对象，包含供水水厂的所有基础属性"
)
public class WaterPlantInfo {

    @ApiModelProperty(
            value = "主键ID",
            example = "0",
            position = 1,
            notes = "数据库自增主键，新增时不需要传入"
    )
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(
            value = "水厂编号",
            example = "WP001",
            required = true,
            position = 2,
            notes = "水厂唯一标识，系统内唯一"
    )
    private String plantCode;

    @ApiModelProperty(
            value = "水厂名称",
            example = "XX自来水厂",
            required = true,
            position = 3,
            notes = "水厂的中文名称，用于显示"
    )
    private String plantName;

    @ApiModelProperty(
            value = "水厂地址",
            example = "XX大道88号",
            position = 4,
            notes = "水厂的详细地理位置"
    )
    private String location;

    @ApiModelProperty(value = "WGS84经度", example = "113.12345678", position = 5)
    private BigDecimal longitude;

    @ApiModelProperty(value = "WGS84纬度", example = "23.12345678", position = 6)
    private BigDecimal latitude;

    @ApiModelProperty(
            value = "水源类型",
            example = "地表水",
            position = 5,
            notes = "水源类型"
    )
    private String waterSourceType;

    @ApiModelProperty(
            value = "设计日供水能力",
            example = "10.00",
            position = 6,
            notes = "水厂设计日供水能力，单位：万立方米/天(万m³/d)"
    )
    private BigDecimal designCapacity;

    @ApiModelProperty(
            value = "实际日供水能力",
            example = "8.50",
            position = 7,
            notes = "水厂实际日供水能力，单位：万立方米/天(万m³/d)"
    )
    private BigDecimal currentCapacity;

    @ApiModelProperty(
            value = "处理工艺",
            example = "混凝-沉淀-过滤-消毒",
            position = 8,
            notes = "水厂采用的水处理工艺流程"
    )
    private String treatmentProcess;

    @ApiModelProperty(
            value = "投运日期",
            example = "2026-06-20",
            position = 9,
            notes = "水厂正式投入运行的日期"
    )
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate commissionDate;

    @ApiModelProperty(
            value = "水质执行标准",
            example = "GB5749-2022",
            position = 10,
            notes = "水厂出水水质执行的国家标准"
    )
    private String waterQualityStandard;

    @ApiModelProperty(
            value = "运行状态",
            example = "0",
            allowableValues = "0,1",
            position = 11,
            notes = "0-正常运行，1-停产"
    )
    private String status;

    @ApiModelProperty(
            value = "负责人",
            example = "李四",
            position = 12,
            notes = "水厂日常运维负责人姓名"
    )
    private String principal;

    @ApiModelProperty(
            value = "联系电话",
            example = "13800000000",
            position = 13,
            notes = "负责人联系电话"
    )
    private String contactPhone;

    @ApiModelProperty(
            value = "备注",
            example = "主要供水水厂",
            position = 14,
            notes = "其他补充说明信息"
    )
    private String remark;

    @ApiModelProperty(
            value = "删除标志",
            example = "0",
            allowableValues = "0,2",
            hidden = true,
            position = 15,
            notes = "0-正常存在，2-已删除（逻辑删除）"
    )
    @TableLogic
    private String delFlag;

    @ApiModelProperty(
            value = "创建者",
            example = "admin",
            hidden = true,
            position = 16,
            notes = "创建该记录的用户账号"
    )
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(
            value = "创建时间",
            example = "2026-05-25 09:00:00",
            hidden = true,
            position = 17,
            notes = "记录创建的时间"
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(
            value = "更新者",
            example = "admin",
            hidden = true,
            position = 18,
            notes = "最后修改该记录的用户账号"
    )
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.UPDATE)
    private String updateBy;

    @ApiModelProperty(
            value = "更新时间",
            example = "2026-05-25 10:00:00",
            hidden = true,
            position = 19,
            notes = "记录最后修改的时间"
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.UPDATE)
    private LocalDateTime updateTime;
}
