package com.fs.hisStore.mapper;

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

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

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

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

    /**
     * 修改评论
     * 
     * @param fsStoreProductReply 评论
     * @return 结果
     */
    public int updateFsStoreProductReply(FsStoreProductReplyScrm 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_scrm r left join fs_store_product_scrm 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") FsStoreProductReplyScrm fsStoreProductReply);
}
