package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.PcMenuFactory;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 企业档案菜单与企业关联中间对象 pc_menu_factory
 *
 * @author szhpt
 * @date 2023-02-02*/
@ApiModel(value = "企业档案菜单与企业关联中间")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcMenuFactoryQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "菜单表id")
    private String menuId;
    @ApiModelProperty(value = "是否启用(移除功能)")
    private String menuIfUse;
    @ApiModelProperty(value = "是否重点关注")
    private String menuFocus;
    @ApiModelProperty(value = "是否重点排序")
    private String menuFocusIndex;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcMenuFactory> createLambdaQueryWrapper(PcMenuFactoryQuery query) {
        QueryWrapper<PcMenuFactory> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(ObjectUtil.isNotNull(query.getMenuId()), "menu_id", query.getMenuId());
        wrapper.eq(ObjectUtil.isNotNull(query.getMenuIfUse()), "menu_if_use", query.getMenuIfUse());
        wrapper.eq(ObjectUtil.isNotNull(query.getMenuFocus()), "menu_focus", query.getMenuFocus());
        wrapper.eq(ObjectUtil.isNotNull(query.getMenuFocusIndex()), "menu_focus_index", query.getMenuFocusIndex());
        return wrapper;
        }
}
