package com.zt.plat.module.base.dal.dao.doctemplate;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateTagPageReqVO;
import com.zt.plat.module.base.dal.dataobject.doctemplate.DocTemplateTagDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 标签库 Mapper
 *
 * @author 系统生成
 */
@Mapper
public interface DocTemplateTagMapper extends BaseMapperX<DocTemplateTagDO> {

    default PageResult<DocTemplateTagDO> selectPage(DocTemplateTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DocTemplateTagDO>()
                .likeIfPresent(DocTemplateTagDO::getTagName, reqVO.getTagName())
                .likeIfPresent(DocTemplateTagDO::getTagCode, reqVO.getTagCode())
                .eqIfPresent(DocTemplateTagDO::getCategoryId, reqVO.getCategoryId())
                .eqIfPresent(DocTemplateTagDO::getEnabled, reqVO.getEnabled())
                .orderByAsc(DocTemplateTagDO::getSort)
                .orderByDesc(DocTemplateTagDO::getId));
    }

}
