package com.palmnest.dao.estateserve;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.palmnest.application.bean.Page;
import com.palmnest.dao.GenericDao;
import com.palmnest.model.bill.GeneralBillOrders;
import com.palmnest.model.bill.GeneralBills;
import com.palmnest.model.bill.GeneralbillService;

/**
 * 账单DAO层
 *
 * @author 金牙
 */
public interface GeneralBillsDao extends GenericDao<Object, Integer> {

	/**
	 * 根据企业ID和月份查询账单信息
	 *
	 * @param pageSzie
	 * @param pageNo
	 * @param virtualId
	 * @param dateTime
	 * @return
	 * @throws Exception
	 */
	public Page generalBillsPage(Integer pageSzie, Integer pageNo, Integer virtualId, String dateTime) throws Exception;

	/**
	 * 根据企业ID查询预存充值和扣减的记录
	 *
	 * @param pageSzie
	 * @param pageNo
	 * @param virtualId
	 * @return
	 * @throws Exception
	 */
	public Page getDepositRecordPage(Integer pageSzie, Integer pageNo, Integer virtualId) throws Exception;

	/**
	 * 根据企业ID和账单日期查询历史欠费
	 *
	 * @param mothTime
	 * @param virtualId
	 * @return
	 */
	public BigDecimal getArrearsRecord(String mothTime, Integer virtualId) throws Exception;

	/**
	 * 根据账单ID查询账单信息
	 *
	 * @param id
	 * @return
	 */
	public GeneralBills getGeneralBillsById(Integer id) throws Exception;

	/**
	 * 根据账单ID查询所有服务大类
	 *
	 * @param billId
	 * @return
	 */
	public List<GeneralbillService> getGeneralbillServiceList(Integer billId) throws Exception;

	/**
	 * 根据账单ID和服务编码查询订单信息
	 *
	 * @param billId
	 * @param serviceCode
	 * @return
	 */
	public List<GeneralBillOrders> geteneralBillOrdersList(Integer billId, String serviceCode) throws Exception;

	/**
	 * 根据ID查询服务信息
	 *
	 * @param id
	 * @return
	 */
	public GeneralbillService getGeneralbillServiceById(Integer id) throws Exception;

	/**
	 * 根据主键ID
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public GeneralBillOrders geteneralBillOrdersById(Integer id) throws Exception;

	/**
	 * 删除账单服务信息
	 *
	 * @param id
	 * @throws Exception
	 */
	public void deleteGeneralbillService(Integer id) throws Exception;

	/**
	 * 删除账单服务订单信息
	 *
	 * @param id
	 * @throws Exception
	 */
	public void deleteGeneralBillOrders(Integer id) throws Exception;


	/**
	 * 根据企业查询不同支付状态的账单集合
	 * 未支付的账单--支付状态（1-已支付、0-未支付）
	 *
	 * @param virtualId 企业ID
	 * @param payStatus 支付状态
	 */
	public List<GeneralBills> getGeneralBillsList(int virtualId, String payStatus) throws Exception;

	/**
	 * 查询当前账单近6个月的消费账单
	 *
	 * @param starTime
	 * @param endTime
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, Object>> getHistoryBill(Integer generalBillsId, String starTime, String endTime, String organizationId, String virtualId) throws Exception;
}
