package com.persagy.dye.pojo.dto;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.persagy.common.utils.StringUtil;
import com.persagy.db.model.BaseEntity;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 默认染色规则
 *
 * @author yangwanyi
 * @version v1.0.0
 * @company persagy
 * @date 2021-10-27 11:39:52
 */
@Getter
@Setter
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName("dye_rule_default")
public class DyeRuleDefault extends BaseEntity<DyeRuleDefault> {
	private static final long serialVersionUID = 1L;

	@TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String basicId;            // 染色基础表ID

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private Integer upperLimit;            // 上限

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String upperSymbol;            // 上限符号

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private Integer lowerLimit;            // 下限

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String lowerSymbol;            // 下限符号

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String name;            // 名称

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String colorValue;            // 色值

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String createTime;            // 创建时间

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String updateTime;            // 更新时间

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String updateUserId;            // 最后更新人ID

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String isDelete;            // 是否删除（0：否  1：是）

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private Integer orderNum;            // 排序

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String numSymbol;            // 数值单位符号

    /**
     * 与WEB交互时正无穷符号
     */
    @TableField(exist = false)
    private String tempUpperLimit;

    /**
     * 与WEB交互时负无穷符号
     */
    @TableField(exist = false)
    private String tempLowerLimit;


    public static Builder builder() {
        return new Builder();
    }

    public static class BuilderQueryWrapper {

        private LambdaQueryWrapper<DyeRuleDefault> queryWrapper = new LambdaQueryWrapper<DyeRuleDefault>();

        public BuilderQueryWrapper idEq(String id) {
            if (StringUtil.isNotBlank(id)) {
                queryWrapper.eq(DyeRuleDefault::getId, id);
            }
            return this;
        }

        public BuilderQueryWrapper basicIdEq(String basicId) {
            if (StringUtil.isNotBlank(basicId)) {
                queryWrapper.eq(DyeRuleDefault::getBasicId, basicId);
            }
            return this;
        }

        public BuilderQueryWrapper upperLimitEq(Integer upperLimit) {
            if (null != upperLimit) {
                queryWrapper.eq(DyeRuleDefault::getUpperLimit, upperLimit);
            }
            return this;
        }

        public BuilderQueryWrapper upperSymbolEq(String upperSymbol) {
            if (StringUtil.isNotBlank(upperSymbol)) {
                queryWrapper.eq(DyeRuleDefault::getUpperSymbol, upperSymbol);
            }
            return this;
        }

        public BuilderQueryWrapper lowerLimitEq(Integer lowerLimit) {
            if (null != lowerLimit) {
                queryWrapper.eq(DyeRuleDefault::getLowerLimit, lowerLimit);
            }
            return this;
        }

        public BuilderQueryWrapper lowerSymbolEq(String lowerSymbol) {
            if (StringUtil.isNotBlank(lowerSymbol)) {
                queryWrapper.eq(DyeRuleDefault::getLowerSymbol, lowerSymbol);
            }
            return this;
        }

        public BuilderQueryWrapper nameEq(String name) {
            if (StringUtil.isNotBlank(name)) {
                queryWrapper.eq(DyeRuleDefault::getName, name);
            }
            return this;
        }

        public BuilderQueryWrapper colorValueEq(String colorValue) {
            if (StringUtil.isNotBlank(colorValue)) {
                queryWrapper.eq(DyeRuleDefault::getColorValue, colorValue);
            }
            return this;
        }

        public BuilderQueryWrapper createTimeEq(String createTime) {
            if (StringUtil.isNotBlank(createTime)) {
                queryWrapper.eq(DyeRuleDefault::getCreateTime, createTime);
            }
            return this;
        }

        public BuilderQueryWrapper updateTimeEq(String updateTime) {
            if (StringUtil.isNotBlank(updateTime)) {
                queryWrapper.eq(DyeRuleDefault::getUpdateTime, updateTime);
            }
            return this;
        }

        public BuilderQueryWrapper updateUserIdEq(String updateUserId) {
            if (StringUtil.isNotBlank(updateUserId)) {
                queryWrapper.eq(DyeRuleDefault::getUpdateUserId, updateUserId);
            }
            return this;
        }

        public BuilderQueryWrapper isDeleteEq(String isDelete) {
            if (StringUtil.isNotBlank(isDelete)) {
                queryWrapper.eq(DyeRuleDefault::getIsDelete, isDelete);
            }
            return this;
        }

        public BuilderQueryWrapper orderNumEq(Integer orderNum) {
            if (null != orderNum) {
                queryWrapper.eq(DyeRuleDefault::getOrderNum, orderNum);
            }
            return this;
        }

        public BuilderQueryWrapper numSymbolEq(String numSymbol) {
            if (StringUtil.isNotBlank(numSymbol)) {
                queryWrapper.eq(DyeRuleDefault::getNumSymbol, numSymbol);
            }
            return this;
        }

        public LambdaQueryWrapper<DyeRuleDefault> builder() {
            return queryWrapper;
        }

    }

    public static class BuilderUpdateWrapper {

        private LambdaUpdateWrapper<DyeRuleDefault> updateWrapper = new LambdaUpdateWrapper<DyeRuleDefault>();

        public BuilderUpdateWrapper idEq(String id) {
            if (StringUtil.isNotBlank(id)) {
                updateWrapper.eq(DyeRuleDefault::getId, id);
            }
            return this;
        }

        public BuilderUpdateWrapper basicIdEq(String basicId) {
            if (StringUtil.isNotBlank(basicId)) {
                updateWrapper.eq(DyeRuleDefault::getBasicId, basicId);
            }
            return this;
        }

        public BuilderUpdateWrapper upperLimitEq(Integer upperLimit) {
            if (null != upperLimit) {
                updateWrapper.eq(DyeRuleDefault::getUpperLimit, upperLimit);
            }
            return this;
        }

        public BuilderUpdateWrapper upperSymbolEq(String upperSymbol) {
            if (StringUtil.isNotBlank(upperSymbol)) {
                updateWrapper.eq(DyeRuleDefault::getUpperSymbol, upperSymbol);
            }
            return this;
        }

        public BuilderUpdateWrapper lowerLimitEq(Integer lowerLimit) {
            if (null != lowerLimit) {
                updateWrapper.eq(DyeRuleDefault::getLowerLimit, lowerLimit);
            }
            return this;
        }

        public BuilderUpdateWrapper lowerSymbolEq(String lowerSymbol) {
            if (StringUtil.isNotBlank(lowerSymbol)) {
                updateWrapper.eq(DyeRuleDefault::getLowerSymbol, lowerSymbol);
            }
            return this;
        }

        public BuilderUpdateWrapper nameEq(String name) {
            if (StringUtil.isNotBlank(name)) {
                updateWrapper.eq(DyeRuleDefault::getName, name);
            }
            return this;
        }

        public BuilderUpdateWrapper colorValueEq(String colorValue) {
            if (StringUtil.isNotBlank(colorValue)) {
                updateWrapper.eq(DyeRuleDefault::getColorValue, colorValue);
            }
            return this;
        }

        public BuilderUpdateWrapper createTimeEq(String createTime) {
            if (StringUtil.isNotBlank(createTime)) {
                updateWrapper.eq(DyeRuleDefault::getCreateTime, createTime);
            }
            return this;
        }

        public BuilderUpdateWrapper updateTimeEq(String updateTime) {
            if (StringUtil.isNotBlank(updateTime)) {
                updateWrapper.eq(DyeRuleDefault::getUpdateTime, updateTime);
            }
            return this;
        }

        public BuilderUpdateWrapper updateUserIdEq(String updateUserId) {
            if (StringUtil.isNotBlank(updateUserId)) {
                updateWrapper.eq(DyeRuleDefault::getUpdateUserId, updateUserId);
            }
            return this;
        }

        public BuilderUpdateWrapper isDeleteEq(String isDelete) {
            if (StringUtil.isNotBlank(isDelete)) {
                updateWrapper.eq(DyeRuleDefault::getIsDelete, isDelete);
            }
            return this;
        }

        public BuilderUpdateWrapper orderNumEq(Integer orderNum) {
            if (null != orderNum) {
                updateWrapper.eq(DyeRuleDefault::getOrderNum, orderNum);
            }
            return this;
        }

        public BuilderUpdateWrapper numSymbolEq(String numSymbol) {
            if (StringUtil.isNotBlank(numSymbol)) {
                updateWrapper.eq(DyeRuleDefault::getNumSymbol, numSymbol);
            }
            return this;
        }

        public LambdaUpdateWrapper<DyeRuleDefault> builder() {
            return updateWrapper;
        }

    }

    public static class Builder {

        private DyeRuleDefault dyeRuleDefault = new DyeRuleDefault();

        public Builder id(String id) {
            dyeRuleDefault.setId(id);
            return this;
        }

        public Builder basicId(String basicId) {
            dyeRuleDefault.setBasicId(basicId);
            return this;
        }

        public Builder upperLimit(Integer upperLimit) {
            dyeRuleDefault.setUpperLimit(upperLimit);
            return this;
        }

        public Builder upperSymbol(String upperSymbol) {
            dyeRuleDefault.setUpperSymbol(upperSymbol);
            return this;
        }

        public Builder lowerLimit(Integer lowerLimit) {
            dyeRuleDefault.setLowerLimit(lowerLimit);
            return this;
        }

        public Builder lowerSymbol(String lowerSymbol) {
            dyeRuleDefault.setLowerSymbol(lowerSymbol);
            return this;
        }

        public Builder name(String name) {
            dyeRuleDefault.setName(name);
            return this;
        }

        public Builder colorValue(String colorValue) {
            dyeRuleDefault.setColorValue(colorValue);
            return this;
        }

        public Builder createTime(String createTime) {
            dyeRuleDefault.setCreateTime(createTime);
            return this;
        }

        public Builder updateTime(String updateTime) {
            dyeRuleDefault.setUpdateTime(updateTime);
            return this;
        }

        public Builder updateUserId(String updateUserId) {
            dyeRuleDefault.setUpdateUserId(updateUserId);
            return this;
        }

        public Builder isDelete(String isDelete) {
            dyeRuleDefault.setIsDelete(isDelete);
            return this;
        }

        public Builder orderNum(Integer orderNum) {
            dyeRuleDefault.setOrderNum(orderNum);
            return this;
        }

        public Builder numSymbol(String numSymbol) {
            dyeRuleDefault.setNumSymbol(numSymbol);
            return this;
        }

        public DyeRuleDefault build() {
            return dyeRuleDefault;
        }

    }
}
