package cn.iocoder.yudao.module.pms.dal.mysql.iotprojecttasktemplate;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pms.controller.admin.iotprojecttasktemplate.vo.IotProjectTaskTemplatePageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttasktemplate.IotProjectTaskTemplateDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 项目任务属性模板 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotProjectTaskTemplateMapper extends BaseMapperX<IotProjectTaskTemplateDO> {

    default PageResult<IotProjectTaskTemplateDO> selectPage(IotProjectTaskTemplatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotProjectTaskTemplateDO>()
                .eqIfPresent(IotProjectTaskTemplateDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotProjectTaskTemplateDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(IotProjectTaskTemplateDO::getProjectClassification, reqVO.getProjectClassification())
                .eqIfPresent(IotProjectTaskTemplateDO::getWellType, reqVO.getWellType())
                .eqIfPresent(IotProjectTaskTemplateDO::getWellCategory, reqVO.getWellCategory())
                .eqIfPresent(IotProjectTaskTemplateDO::getTechnique, reqVO.getTechnique())
                .likeIfPresent(IotProjectTaskTemplateDO::getName, reqVO.getName())
                .eqIfPresent(IotProjectTaskTemplateDO::getIdentifier, reqVO.getIdentifier())
                .eqIfPresent(IotProjectTaskTemplateDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotProjectTaskTemplateDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(IotProjectTaskTemplateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotProjectTaskTemplateDO::getId));
    }

}