package cn.iocoder.yudao.module.pms.dal.mysql.yanfan.group;

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.yanfan.group.vo.IotYfGroupPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.yanfan.group.IotYfGroupDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * yf设备分组 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotYfGroupMapper extends BaseMapperX<IotYfGroupDO> {

    default PageResult<IotYfGroupDO> selectPage(IotYfGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotYfGroupDO>()
                .likeIfPresent(IotYfGroupDO::getGroupName, reqVO.getGroupName())
                .eqIfPresent(IotYfGroupDO::getGroupOrder, reqVO.getGroupOrder())
                .eqIfPresent(IotYfGroupDO::getUserId, reqVO.getUserId())
                .likeIfPresent(IotYfGroupDO::getUserName, reqVO.getUserName())
                .eqIfPresent(IotYfGroupDO::getDelFlag, reqVO.getDelFlag())
                .eqIfPresent(IotYfGroupDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(IotYfGroupDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(IotYfGroupDO::getDeptId, reqVO.getDeptId())
                .orderByDesc(IotYfGroupDO::getGroupId));
    }

}
