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

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

/**
 * yf协议 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotYfProtocolMapper extends BaseMapperX<IotYfProtocolDO> {

    default PageResult<IotYfProtocolDO> selectPage(IotYfProtocolPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotYfProtocolDO>()
                .eqIfPresent(IotYfProtocolDO::getProtocolCode, reqVO.getProtocolCode())
                .likeIfPresent(IotYfProtocolDO::getProtocolName, reqVO.getProtocolName())
                .eqIfPresent(IotYfProtocolDO::getProtocolFileUrl, reqVO.getProtocolFileUrl())
                .eqIfPresent(IotYfProtocolDO::getProtocolType, reqVO.getProtocolType())
                .eqIfPresent(IotYfProtocolDO::getJarSign, reqVO.getJarSign())
                .betweenIfPresent(IotYfProtocolDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(IotYfProtocolDO::getProtocolStatus, reqVO.getProtocolStatus())
                .eqIfPresent(IotYfProtocolDO::getDelFlag, reqVO.getDelFlag())
                .eqIfPresent(IotYfProtocolDO::getDeptId, reqVO.getDeptId())
                .orderByDesc(IotYfProtocolDO::getId));
    }

}
