package cn.novalon.manage.db.entity.query;

import cn.novalon.manage.sys.core.query.SysMenuQuery;
import cn.novalon.manage.db.dao.QueryField;

/**
 * 菜单查询条件对象
 * 
 * @author 张翔
 * @date 2026-03-13
 */
public class SysMenuQueryCriteria {

    @QueryField(type = QueryField.Type.INNER_LIKE)
    private String menuName;

    @QueryField(type = QueryField.Type.EQUAL)
    private String menuType;

    @QueryField(type = QueryField.Type.EQUAL)
    private Integer status;

    @QueryField(type = QueryField.Type.EQUAL)
    private Long parentId;

    @QueryField(blurry = "menuName,perms,component", type = QueryField.Type.INNER_LIKE)
    private String keyword;

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getMenuType() {
        return menuType;
    }

    public void setMenuType(String menuType) {
        this.menuType = menuType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    /**
     * 从领域查询对象转换
     * 
     * @param query 领域查询对象
     */
    public void convert(SysMenuQuery query) {
        if (query == null) {
            return;
        }
        this.menuName = query.getMenuName();
        this.menuType = query.getMenuType();
        this.status = query.getStatus();
        this.parentId = query.getParentId();
        this.keyword = query.getKeyword();
    }
}
