package com.community.huiju.dao;

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

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

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

    int insert(TpBillInvoice record);

    int insertSelective(TpBillInvoice record);

    TpBillInvoice selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TpBillInvoice record);

    int updateByPrimaryKey(TpBillInvoice record);
    
    /**
     * 分页获取缴费和未缴费的数据
     * @param communityId
     * @param buildingOwnerInfoId
     * @param payType
     * @return
     */
    List<Map<String, Object>> getBillsList(@Param("communityId") Integer communityId,@Param("buildingOwnerInfoId") Integer buildingOwnerInfoId,@Param("payType") Integer payType);
    
    /**
     * 获取账单的详细信息
     * @param billInvoiceId
     * @return
     */
    Map<String, Object> getBillInvoiceDetail(@Param("communityId") Integer communityId,@Param("billInvoiceId") Integer billInvoiceId);
    
    /**
     * 获取需要支付的金额
     * @param billInvoiceId
     * @param buildingOwnerInfoId
     * @param communityId
     * @return
     */
	TpBillInvoice selectByIdAndBuildingOwnerInfoId(@Param("id") Integer billInvoiceId,@Param("buildingOwnerInfoId") Integer buildingOwnerInfoId,@Param("communityId") Integer communityId);
    
    TpBillInvoice selectByOutTradeNo(@Param("outTradeNo") String outTradeNo);

    List<TpBillInvoice> selectByBuildingOwnerInfoId(@Param("buildingOwnerInfoId") Integer buildingOwnerInfoId);

    int updateBeach(Map<String, Object> map);
}