package cn.iocoder.yudao.module.smartfactory.dal.mysql.accessoriescollar;

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.smartfactory.controller.admin.accessoriescollar.vo.AccessoriesCollarPageReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.accessoriescollar.AccessoriesCollarDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 厂区配件领用 Mapper
 *
 * @author 符溶馨
 */
@Mapper
public interface AccessoriesCollarMapper extends BaseMapperX<AccessoriesCollarDO> {

    default PageResult<AccessoriesCollarDO> selectPage(AccessoriesCollarPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AccessoriesCollarDO>()
                .eqIfPresent(AccessoriesCollarDO::getFactoryId, reqVO.getFactoryId())
                .eqIfPresent(AccessoriesCollarDO::getMonth, reqVO.getMonth())
                .eqIfPresent(AccessoriesCollarDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(AccessoriesCollarDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AccessoriesCollarDO::getId));
    }

}