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

	@TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String typeCode;            // 染色类型编码，对应rwd_def_funcid的type字段

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String typeName;            // 染色类型名称

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String seasonCode;            // 季节编码

    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
    private String seasonName;            // 季节名称

    @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：是）


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

    public static class BuilderQueryWrapper {

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

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

        public BuilderQueryWrapper typeCodeEq(String typeCode) {
            if (StringUtil.isNotBlank(typeCode)) {
                queryWrapper.eq(DyeBasic::getTypeCode, typeCode);
            }
            return this;
        }

        public BuilderQueryWrapper typeNameEq(String typeName) {
            if (StringUtil.isNotBlank(typeName)) {
                queryWrapper.eq(DyeBasic::getTypeName, typeName);
            }
            return this;
        }

        public BuilderQueryWrapper seasonCodeEq(String seasonCode) {
            if (StringUtil.isNotBlank(seasonCode)) {
                queryWrapper.eq(DyeBasic::getSeasonCode, seasonCode);
            }
            return this;
        }

        public BuilderQueryWrapper seasonNameEq(String seasonName) {
            if (StringUtil.isNotBlank(seasonName)) {
                queryWrapper.eq(DyeBasic::getSeasonName, seasonName);
            }
            return this;
        }

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

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

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

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

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

    }

    public static class BuilderUpdateWrapper {

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

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

        public BuilderUpdateWrapper typeCodeEq(String typeCode) {
            if (StringUtil.isNotBlank(typeCode)) {
                updateWrapper.eq(DyeBasic::getTypeCode, typeCode);
            }
            return this;
        }

        public BuilderUpdateWrapper typeNameEq(String typeName) {
            if (StringUtil.isNotBlank(typeName)) {
                updateWrapper.eq(DyeBasic::getTypeName, typeName);
            }
            return this;
        }

        public BuilderUpdateWrapper seasonCodeEq(String seasonCode) {
            if (StringUtil.isNotBlank(seasonCode)) {
                updateWrapper.eq(DyeBasic::getSeasonCode, seasonCode);
            }
            return this;
        }

        public BuilderUpdateWrapper seasonNameEq(String seasonName) {
            if (StringUtil.isNotBlank(seasonName)) {
                updateWrapper.eq(DyeBasic::getSeasonName, seasonName);
            }
            return this;
        }

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

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

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

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

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

    }

    public static class Builder {

        private DyeBasic dyeBasic = new DyeBasic();

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

        public Builder typeCode(String typeCode) {
            dyeBasic.setTypeCode(typeCode);
            return this;
        }

        public Builder typeName(String typeName) {
            dyeBasic.setTypeName(typeName);
            return this;
        }

        public Builder seasonCode(String seasonCode) {
            dyeBasic.setSeasonCode(seasonCode);
            return this;
        }

        public Builder seasonName(String seasonName) {
            dyeBasic.setSeasonName(seasonName);
            return this;
        }

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

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

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

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

        public DyeBasic build() {
            return dyeBasic;
        }

    }
}
