package com.fzm.mall.server.front.goods.mapper;

import com.fzm.mall.server.front.goods.model.Comment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;

/**
 * <p>
 * 商品评论表（用于对商品的评论） Mapper 接口
 * </p>
 *
 * @author fzm
 * @since 2021-04-27
 */
public interface CommentMapper extends BaseMapper<Comment> {

    @Select("select avg(business_evaluate)  from goods_comment where merchant_id = #{merchantId}")
    BigDecimal getEvaluate(@Param("merchantId") String merchantId);
}
