package com.cf.imes.module.system.dal.mysql.funds.products;

import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.module.system.controller.admin.funds.products.vo.product.ProductPageReqVO;
import com.cf.imes.module.system.dal.dataobject.funds.products.ProductsDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 产品表 product Mapper
 *
 * @author 晨丰科技
 */
@Mapper
public interface ProductsMapper extends BaseMapperX<ProductsDO> {

    default PageResult<ProductsDO> selectPage(ProductPageReqVO reqVO, boolean deleted) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProductsDO>()
                .eqIfPresent(ProductsDO::getId, reqVO.getId())
                .likeIfPresent(ProductsDO::getProductName, reqVO.getProductName())
                .eqIfPresent(ProductsDO::getStatus, reqVO.getStatus())
                .eq(ProductsDO::getDeleted, deleted));
    }

}
