package com.community.huiju.dao;

import com.community.huiju.model.TpTransaction;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface TpTransactionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TpTransaction record);

    int insertSelective(TpTransaction record);

    TpTransaction selectByPrimaryKey(@Param("id") Integer id,@Param("communityId")  Integer communityId);

    int updateByPrimaryKeySelective(TpTransaction record);

    int updateByPrimaryKey(TpTransaction record);

    List<TpTransaction> findAllTransaction(@Param("communityId") Integer communityId, @Param("transactionTitle") String transactionTitle, @Param("type") String type);

    List<TpTransaction> selectTransaction(@Param("id")Integer userId, @Param("communityId")Integer communityId,@Param("type") Integer type);

    void updateTransaction(@Param("id")Integer id, @Param("transactionTitle")String transactionTitle, @Param("transactionContent")String transactionContent, @Param("userId")Integer userId);

    TpTransaction getById(@Param("id")Integer id);
	
	List<Map<String, Object>> getReportReasons();
    
    int saveReportReason(@Param("userId") Integer userId, @Param("communityId") Integer communityId, @Param("transactionId") Integer transactionId, @Param("reportReasonId") String reportReasonId, @Param("createDate") Date createDate);

    /**
     * 查询的当前用户自己的所有帖子
     * @param id
     * @param communityId
     * @return
     */
    List<TpTransaction> getUserTransactionList(@Param("id") Integer id, @Param("communityId")Integer communityId);
}