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

/**
 * 模板实例 Mapper
 *
 * @author 系统生成
 */
@Mapper
public interface DocTemplateInstanceMapper extends BaseMapperX<DocTemplateInstanceDO> {

    default PageResult<DocTemplateInstanceDO> selectPage(DocTemplateInstancePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DocTemplateInstanceDO>()
                .likeIfPresent(DocTemplateInstanceDO::getInstanceName, reqVO.getInstanceName())
                .eqIfPresent(DocTemplateInstanceDO::getTemplateId, reqVO.getTemplateId())
                .eqIfPresent(DocTemplateInstanceDO::getBusinessType, reqVO.getBusinessType())
                .eqIfPresent(DocTemplateInstanceDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(DocTemplateInstanceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DocTemplateInstanceDO::getId));
    }

}
