package com.fs.store.mapper;

import java.util.List;
import com.fs.store.domain.FsStoreProductCategory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 商品分类Mapper接口
 *
 * @author fs
 * @date 2022-03-15
 */
public interface FsStoreProductCategoryMapper
{
    /**
     * 查询商品分类
     *
     * @param cateId 商品分类ID
     * @return 商品分类
     */
    public FsStoreProductCategory selectFsStoreProductCategoryById(Long cateId);

    /**
     * 查询商品分类列表
     *
     * @param fsStoreProductCategory 商品分类
     * @return 商品分类集合
     */
    public List<FsStoreProductCategory> selectFsStoreProductCategoryList(FsStoreProductCategory fsStoreProductCategory);

    /**
     * 新增商品分类
     *
     * @param fsStoreProductCategory 商品分类
     * @return 结果
     */
    public int insertFsStoreProductCategory(FsStoreProductCategory fsStoreProductCategory);

    /**
     * 修改商品分类
     *
     * @param fsStoreProductCategory 商品分类
     * @return 结果
     */
    public int updateFsStoreProductCategory(FsStoreProductCategory fsStoreProductCategory);

    /**
     * 删除商品分类
     *
     * @param cateId 商品分类ID
     * @return 结果
     */
    public int deleteFsStoreProductCategoryById(Long cateId);

    /**
     * 批量删除商品分类
     *
     * @param cateIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteFsStoreProductCategoryByIds(Long[] cateIds);
    @Select({"<script> " +
            "select c.* from fs_store_product_category c " +
            "where 1=1 " +
            "<if test = 'maps.isDel != null    '> " +
            "and c.is_del=#{maps.isDel} " +
            "</if>" +
            "<if test = 'maps.isShow != null    '> " +
            "and c.is_show =#{maps.isShow} " +
            "</if>" +
            "<if test = 'maps.pid != null    '> " +
            "and c.pid =#{maps.pid} " +
            "</if>" +
            " order by c.sort asc "+
            "</script>"})
    List<FsStoreProductCategory> selectFsStoreProductCategoryListQuery(@Param("maps")FsStoreProductCategory param);
}
