package com.fs.doc.mapper;

import java.util.List;
import com.fs.doc.domain.DocOrderReply;
import com.fs.doc.param.DocOrderReplyQueryParam;
import com.fs.doc.vo.DocOrderReplyListQueryVO;
import org.apache.ibatis.annotations.Select;

/**
 * 订单回复Mapper接口
 * 
 * @author fs
 * @date 2023-01-09
 */
public interface DocOrderReplyMapper 
{
    /**
     * 查询订单回复
     * 
     * @param replyId 订单回复ID
     * @return 订单回复
     */
    public DocOrderReply selectDocOrderReplyById(Long replyId);

    /**
     * 查询订单回复列表
     * 
     * @param docOrderReply 订单回复
     * @return 订单回复集合
     */
    public List<DocOrderReply> selectDocOrderReplyList(DocOrderReply docOrderReply);

    /**
     * 新增订单回复
     * 
     * @param docOrderReply 订单回复
     * @return 结果
     */
    public int insertDocOrderReply(DocOrderReply docOrderReply);

    /**
     * 修改订单回复
     * 
     * @param docOrderReply 订单回复
     * @return 结果
     */
    public int updateDocOrderReply(DocOrderReply docOrderReply);

    /**
     * 删除订单回复
     * 
     * @param replyId 订单回复ID
     * @return 结果
     */
    public int deleteDocOrderReplyById(Long replyId);

    /**
     * 批量删除订单回复
     * 
     * @param replyIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteDocOrderReplyByIds(Long[] replyIds);
    @Select({"<script> " +
            "select r.*,c.user_name from doc_record_reply r left join doc_order o on o.doc_id=r.doc_id  " +
            "where 1=1 " +
            "<if test = 'maps.orderId != null     '> " +
            "and r.order_id =#{maps.orderId} " +
            "</if>" +
            " order by r.reply_id desc "+
            "</script>"})
    List<DocOrderReplyListQueryVO> selectDocOrderReplyListVOQuery(DocOrderReplyQueryParam param);
}
