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

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.unitConversion.UnitConversionDO;
import org.apache.ibatis.annotations.Mapper;
import com.zt.plat.module.base.controller.admin.unitConversion.vo.*;

/**
 * 单位转换 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface UnitConversionMapper extends BaseMapperX<UnitConversionDO> {

    default PageResult<UnitConversionDO> selectPage(UnitConversionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UnitConversionDO>()
                .eqIfPresent(UnitConversionDO::getUntQtyId, reqVO.getUntQtyId())
                .eqIfPresent(UnitConversionDO::getSrcUntId, reqVO.getSrcUntId())
                .eqIfPresent(UnitConversionDO::getTgtUntId, reqVO.getTgtUntId())
                .eqIfPresent(UnitConversionDO::getFctr, reqVO.getFctr())
                .eqIfPresent(UnitConversionDO::getFmu, reqVO.getFmu())
                .betweenIfPresent(UnitConversionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UnitConversionDO::getId));
    }

}