package com.mcwl.resource.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.ResponseModelPurchaseRecord;
import com.mcwl.resource.domain.response.ResponseModelProduct;
import com.mcwl.resource.domain.vo.ModelLikeVo;
import com.mcwl.resource.domain.vo.PageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author：ChenYan
 * @Project：McWl
 * @Package：com.mcwl.resource.mapper
 * @Filename：MallProductMapper
 * @Description TODO
 * @Date：2024/12/30 18:23
 */
@Mapper
public interface ModelMapper extends BaseMapper<ModelProduct> {


    Long sumNumber(@Param("userId") Long userId);


    void updateModel(ModelProduct modelProduct);

    Long sumLikeNumber(@Param("userId") Long userId);

    Long sumRunNumber(Long userId);

    void updateTopStatus(@Param("id") Long id, @Param("isTop") int i);

    List<ModelProduct> selectAllModelsSortedByTopStatus();


    List<ResponseModelProduct> modelSquare(PageVo pageVo);

    Long sumModelNumber(Long userId);

    List<ModelLikeVo> selectLikedModelsByUser(@Param("page") Page<ModelLikeVo> page,
                                              @Param("userId") Long userId,
                                              @Param("orderByColumn") String orderByColumn);

    ResponseModelPurchaseRecord selectIsBuy(@Param("id") Long id, @Param("userId") Long userId);

}
