package com.cf.imes.module.system.dal.mysql.labeltemplate;

import java.util.*;

import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelTemplateDO;
import org.apache.ibatis.annotations.Mapper;
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.*;

/**
 * 标签模板 Mapper
 *
 * @author 晨丰科技
 */
@Mapper
public interface LabelTemplateMapper extends BaseMapperX<LabelTemplateDO> {

    default PageResult<LabelTemplateDO> selectPage(LabelTemplatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LabelTemplateDO>()
                .eqIfPresent(LabelTemplateDO::getType, reqVO.getType())
                .likeIfPresent(LabelTemplateDO::getName, reqVO.getName())
                .eqIfPresent(LabelTemplateDO::getRemark, reqVO.getRemark())
                .eqIfPresent(LabelTemplateDO::getWidth, reqVO.getWidth())
                .eqIfPresent(LabelTemplateDO::getHeight, reqVO.getHeight())
                .betweenIfPresent(LabelTemplateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LabelTemplateDO::getId));
    }

}