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

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pms.controller.admin.oa.IotOaDepartPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.oa.IotOaDepartDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * oa部门 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotOaDepartMapper extends BaseMapperX<IotOaDepartDO> {

    default PageResult<IotOaDepartDO> selectPage(IotOaDepartPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotOaDepartDO>()
                .eqIfPresent(IotOaDepartDO::getSupdepid, reqVO.getSupdepid())
                .eqIfPresent(IotOaDepartDO::getDepartmentmark, reqVO.getDepartmentmark())
                .likeIfPresent(IotOaDepartDO::getDepartmentname, reqVO.getDepartmentname())
                .eqIfPresent(IotOaDepartDO::getDepartmentcode, reqVO.getDepartmentcode())
                .eqIfPresent(IotOaDepartDO::getOaId, reqVO.getOaId())
                .eqIfPresent(IotOaDepartDO::getSubcompanyid1, reqVO.getSubcompanyid1())
                .eqIfPresent(IotOaDepartDO::getShoworder, reqVO.getShoworder())
                .betweenIfPresent(IotOaDepartDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotOaDepartDO::getId));
    }

}
