package com.fs.store.mapper;

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

/**
 * 评论Mapper接口
 * 
 * @author fs
 * @date 2022-03-15
 */
public interface FsStoreProductReplyMapper 
{
    /**
     * 查询评论
     * 
     * @param id 评论ID
     * @return 评论
     */
    public FsStoreProductReply selectFsStoreProductReplyById(Long id);

    /**
     * 查询评论列表
     * 
     * @param fsStoreProductReply 评论
     * @return 评论集合
     */
    public List<FsStoreProductReply> selectFsStoreProductReplyList(FsStoreProductReply fsStoreProductReply);

    /**
     * 新增评论
     * 
     * @param fsStoreProductReply 评论
     * @return 结果
     */
    public int insertFsStoreProductReply(FsStoreProductReply fsStoreProductReply);

    /**
     * 修改评论
     * 
     * @param fsStoreProductReply 评论
     * @return 结果
     */
    public int updateFsStoreProductReply(FsStoreProductReply fsStoreProductReply);

    /**
     * 删除评论
     * 
     * @param id 评论ID
     * @return 结果
     */
    public int deleteFsStoreProductReplyById(Long id);

    /**
     * 批量删除评论
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteFsStoreProductReplyByIds(Long[] ids);
    @Select({"<script> " +
            "select r.*,p.product_name,u.username  from fs_store_product_reply r left join fs_store_product p on p.product_id=r.product_id left join fs_user u on u.user_id=r.user_id  " +
            "where 1=1 " +
            "<if test = 'maps.isDel != null    '> " +
            "and r.is_del =#{maps.isDel} " +
            "</if>" +
            " order by r.id desc "+
            "</script>"})
    List<FsStoreProductReplyVO> selectFsStoreProductReplyListVO(@Param("maps")FsStoreProductReply fsStoreProductReply);
}
