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

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

/**
 * 计量单位量 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface UnitQuantityMapper extends BaseMapperX<UnitQuantityDO> {

    default PageResult<UnitQuantityDO> selectPage(UnitQuantityPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UnitQuantityDO>()
                .likeIfPresent(UnitQuantityDO::getName, reqVO.getName())
                .eqIfPresent(UnitQuantityDO::getSymbol, reqVO.getSymbol())
                .eqIfPresent(UnitQuantityDO::getDsp, reqVO.getDsp())
                .betweenIfPresent(UnitQuantityDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UnitQuantityDO::getId));
    }

}