package com.csnf.mapper;

import com.csnf.entity.Product;
import com.csnf.util.PageUtil;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductMapper {
    int deleteByPrimaryKey(Integer product_id);

    int insert(Product row);

    Product selectByPrimaryKey(Integer product_id);

    List<Product> selectAll();

    int updateByPrimaryKey(Product row);

    /**
     * 根据多条件动态查询商品信息
     *
     * @param productName
     * @param categoryId
     * @param isEnabled
     * @return
     */
    List<Product> selectByConditional(@Param("productName") String productName,
                                      @Param("categoryId") Integer categoryId,
                                      @Param("isEnabled") Short isEnabled,
                                      @Param("minPrice") Float minPrice,
                                      @Param("maxPrice") Float maxPrice,
                                      @Param("pageUtil") PageUtil pageUtil);
}