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_custom")
public class DyeRuleCustom extends BaseEntity<DyeRuleCustom> {
	private static final long serialVersionUID = 1L;

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

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String groupCode;            // 集团编码

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String projectId;            // 项目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<DyeRuleCustom> queryWrapper = new LambdaQueryWrapper<DyeRuleCustom>();

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

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

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

        public BuilderQueryWrapper groupCodeEq(String groupCode) {
            if (StringUtil.isNotBlank(groupCode)) {
                queryWrapper.eq(DyeRuleCustom::getGroupCode, groupCode);
            }
            return this;
        }

        public BuilderQueryWrapper projectIdEq(String projectId) {
            if (StringUtil.isNotBlank(projectId)) {
                queryWrapper.eq(DyeRuleCustom::getProjectId, projectId);
            }
            return this;
        }

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

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

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

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

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

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

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

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

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

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

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

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

    }

    public static class BuilderUpdateWrapper {

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

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

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


        public BuilderUpdateWrapper groupCodeEq(String groupCode) {
            if (StringUtil.isNotBlank(groupCode)) {
                updateWrapper.eq(DyeRuleCustom::getGroupCode, groupCode);
            }
            return this;
        }

        public BuilderUpdateWrapper projectIdEq(String projectId) {
            if (StringUtil.isNotBlank(projectId)) {
                updateWrapper.eq(DyeRuleCustom::getProjectId, projectId);
            }
            return this;
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

    }

    public static class Builder {

        private DyeRuleCustom dyeRuleCustom = new DyeRuleCustom();

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

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

        public Builder groupCode(String groupCode) {
            dyeRuleCustom.setGroupCode(groupCode);
            return this;
        }

        public Builder projectId(String projectId) {
            dyeRuleCustom.setProjectId(projectId);
            return this;
        }

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

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

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

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

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

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

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

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

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

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

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

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

        public DyeRuleCustom build() {
            return dyeRuleCustom;
        }

    }
}
