package com.wzj.soopin.content.domain.bo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wzj.soopin.content.domain.po.ArticleCategory;
import jakarta.validation.Valid;
import lombok.Data;
import org.dromara.common.core.domain.BaseBO;
import org.dromara.common.core.domain.model.BaseAudit;

/**
 * 文章分类
 *
 * @author pikachu
 * @author Bulbasaur
 * @since 2020/12/10 17:42
 */
@Data
@TableName("cont_article_category")
public class ArticleCategoryBO extends BaseBO<ArticleCategory> {

    @TableId
    private  Long id;
    private String name;

    private String parentId;

    private Integer sort;

    private Integer level;

    private String type;

    @Override
    public LambdaQueryWrapper<ArticleCategory> toWrapper() {
        return super.toWrapper().eq(id!=null, ArticleCategory::getId, id)
            .eq(name!=null, ArticleCategory::getName, name)
            .eq(parentId!=null, ArticleCategory::getParentId, parentId)
            .eq(sort!=null, ArticleCategory::getSort, sort)
            .eq(level!=null, ArticleCategory::getLevel, level)
            .eq(type!=null, ArticleCategory::getType, type);
    }
}
