package com.heyu.api.data.dao.vv;
/**
* <p>
* 评论表 服务类
* </p>
*
* @author quyixiao
* @since 2025-08-25
*/

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.data.entity.vv.VvCommentEntity;
import com.lz.mybatis.plugin.annotations.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface VvCommentDao extends BaseMapper<VvCommentEntity> {


	VvCommentEntity selectVvCommentById(@Param("id")Long id);


	Long insertVvComment(VvCommentEntity vvComment);


	Long insertOrUpdateVvComment(VvCommentEntity vvComment);


	int updateVvCommentById(VvCommentEntity vvComment);


	int updateCoverVvCommentById(VvCommentEntity vvComment);


	int deleteVvCommentById(@Param("id") Long id);


	@OrderBy(VvCommentEntity.id_)
	List<VvCommentEntity> selectVvCommentByCondition(IPage page,
													 @IF Long buyerId,
													 @IF @LIKE String buyerName,
													 @IF @LIKE String buyerPhone,
													 @IF Long productId,
													 @IF @LIKE Long productName,
													 @IF Long skuId,
													 @IF Long tradeOrderId,
													 @IF String status,
													 @IF @LIKE String productComment,
													 @IF @LIKE String serviceComment,

													 @IF @GE @Column(VvCommentEntity.desc_match) Integer minDescMatch,
													 @IF @LE @Column(VvCommentEntity.desc_match)Integer maxDescMatch,

													 @IF @GE @Column(VvCommentEntity.seller_service)Integer minSellerService,
													 @IF @LE @Column(VvCommentEntity.seller_service)Integer maxSellerService,

													 @IF @GE @Column(VvCommentEntity.logistics_service)Integer minLogisticsService,
													 @IF @LE @Column(VvCommentEntity.logistics_service)Integer maxLogisticsService,

													 @IF @GE @Column(VvCommentEntity.useful_count)Integer minUsefulCount,
													 @IF @LE @Column(VvCommentEntity.useful_count)Integer maxUsefulCount,

													 @IF @OrderBy(VvCommentEntity.create_timestamp) String createTimestampSort);




	@OrderBy(VvCommentEntity.id_)
	List<VvCommentEntity> selectNotLogin(IPage page,
										 @IF Long productId,
										 @IF String status,
                                         @IF String level,
										 @IF @OrderBy(VvCommentEntity.create_timestamp) String createTimestampSort
    );



    @OrderBy(VvCommentEntity.id_)
    List<VvCommentEntity> selectLogin(IPage page,
                                      @IF String level,
                                      @IF Long productId,
                                      @LBracket Long buyerId,
                                      @OR @RBracket String status,
										 @IF @OrderBy(VvCommentEntity.create_timestamp) String createTimestampSort);


	int updateVvCommentUserfulByCommidId(@Plus Integer usefulCount,@By Long id);



}