package com.zksy.WaterSupply.WaterSourceInfo.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_source_info", schema = "app_user")
@ApiModel(
        value = "WaterSourceInfo",
        description = "水源地信息对象，包含水源地基础属性"
)
public class WaterSourceInfo {

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

    @ApiModelProperty(
            value = "水源地ID",
            example = "SOURCE_XX",
            required = true,
            position = 2
    )
    private String sourceId;

    @ApiModelProperty(
            value = "水源地名称",
            example = "XX水源地",
            required = true,
            position = 3
    )
    private String sourceName;

    @ApiModelProperty(
            value = "水源地类型",
            example = "系统辨识",
            position = 4,
            notes = "系统辨识/企业上报/政府检查"
    )
    private String sourceType;

    @ApiModelProperty(
            value = "所属单位",
            example = "XX供水公司",
            position = 5
    )
    private String unit;

    @ApiModelProperty(
            value = "详细地址",
            example = "XX大道XX号",
            position = 6
    )
    private String address;

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

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

    @ApiModelProperty(
            value = "水源类型",
            example = "地表水",
            position = 7,
            notes = "地表水/地下水"
    )
    private String waterType;

    @ApiModelProperty(
            value = "保护等级",
            example = "一级",
            position = 8,
            notes = "一级/二级/准保护区"
    )
    private String protectionLevel;

    @ApiModelProperty(
            value = "水质等级",
            example = "Ⅱ类",
            position = 9,
            notes = "Ⅰ-Ⅴ类"
    )
    private String waterQualityLevel;

    @ApiModelProperty(
            value = "保护范围描述",
            example = "XX区域范围内水源保护区",
            position = 10
    )
    private String protectionScope;

    @ApiModelProperty(
            value = "上报时间",
            example = "2025-01-01",
            position = 11
    )
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate reportTime;

    @ApiModelProperty(
            value = "状态",
            example = "0",
            allowableValues = "0,1",
            position = 12,
            notes = "0正常 1异常"
    )
    private String status;

    @ApiModelProperty(
            value = "备注",
            example = "XX区域重要水源地",
            position = 13
    )
    private String remark;

    @ApiModelProperty(
            value = "删除标志",
            example = "0",
            allowableValues = "0,2",
            hidden = true,
            position = 14
    )
    @TableLogic
    private String delFlag;

    @ApiModelProperty(
            value = "创建者",
            example = "admin",
            hidden = true,
            position = 15
    )
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(
            value = "创建时间",
            example = "2025-01-01 00:00:00",
            hidden = true,
            position = 16
    )
    @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 = 17
    )
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.UPDATE)
    private String updateBy;

    @ApiModelProperty(
            value = "更新时间",
            example = "2025-01-01 00:00:00",
            hidden = true,
            position = 18
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.UPDATE)
    private LocalDateTime updateTime;
}
