package com.zt.plat.module.base.dal.dao.materialhasproperties;

import java.util.*;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.base.dal.dataobject.materialhasproperties.MaterialHasPropertiesDO;
import org.apache.ibatis.annotations.Mapper;
import com.zt.plat.module.base.controller.admin.materialhasproperties.vo.*;

/**
 * 物料持有属性 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface MaterialHasPropertiesMapper extends BaseMapperX<MaterialHasPropertiesDO> {

    default PageResult<MaterialHasPropertiesDO> selectPage(MaterialHasPropertiesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MaterialHasPropertiesDO>()
                .eqIfPresent(MaterialHasPropertiesDO::getInfomationId, reqVO.getInfomationId())
                .eqIfPresent(MaterialHasPropertiesDO::getPropertiesId, reqVO.getPropertiesId())
                .eqIfPresent(MaterialHasPropertiesDO::getUnitId, reqVO.getUnitId())
                .eqIfPresent(MaterialHasPropertiesDO::getValue, reqVO.getValue())
                .eqIfPresent(MaterialHasPropertiesDO::getIsKey, reqVO.getIsKey())
                .eqIfPresent(MaterialHasPropertiesDO::getIsMetering, reqVO.getIsMetering())
                .eqIfPresent(MaterialHasPropertiesDO::getSort, reqVO.getSort())
                .betweenIfPresent(MaterialHasPropertiesDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MaterialHasPropertiesDO::getId));
    }

}