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.DocTemplatePageReqVO;
import com.zt.plat.module.base.dal.dataobject.doctemplate.DocTemplateDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 模板 Mapper
 *
 * @author 系统生成
 */
@Mapper
public interface DocTemplateMapper extends BaseMapperX<DocTemplateDO> {

    default PageResult<DocTemplateDO> selectPage(DocTemplatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DocTemplateDO>()
                .likeIfPresent(DocTemplateDO::getTmplName, reqVO.getTmplName())
                .likeIfPresent(DocTemplateDO::getTmplCode, reqVO.getTmplCode())
                .eqIfPresent(DocTemplateDO::getCategoryId, reqVO.getCategoryId())
                .eqIfPresent(DocTemplateDO::getEnabled, reqVO.getEnabled())
                .betweenIfPresent(DocTemplateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DocTemplateDO::getId));
    }

}
