package com.palmnest.dao.wechat;

import com.palmnest.application.core.util.Pages;
import com.palmnest.model.estateserve.DepositItemInformationForm;
import com.palmnest.model.estateserve.SignBasics;
import com.palmnest.model.estateserve.SignContract;
import com.palmnest.model.estateserve.SignServiceInvoice;
import com.palmnest.model.property.VirtualArchitecture;

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

/**
 * 签约管理微信端数据接口
 *
 * @author xiemin
 */
public interface SignContractDao {

	/**
	 * 根据项目id,类型查询公司
	 *
	 * @param organizationId
	 * @param type
	 * @return
	 */
	public List<VirtualArchitecture> findVirtualArchitectureList(String virtualName, Integer organizationId, String type);

	/**
	 * 查询公司
	 *
	 * @param name
	 * @param organizationId
	 * @param type
	 * @return
	 */
	public VirtualArchitecture findVirtualArchitecture(String name, Integer organizationId, String type);

	/**
	 * 添加签约企业信息
	 *
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int addVirtualArchitecture(Map<String, String> map) throws Exception;

	/**
	 * 添加签约信息
	 *
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int addSignContract(Map<String, String> map) throws Exception;

	/**
	 * 添加押金子项信息
	 *
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int addSignBasics(Map<String, String> map) throws Exception;

	/**
	 * 根据押金查询
	 *
	 * @param dtId
	 * @return
	 */
	public DepositItemInformationForm queryDepositItem(String dtId);

	/**
	 * 添加商品签约中心信息
	 *
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int addProductSign(Map<String, String> map) throws Exception;

	/**
	 * 添加签名信息
	 *
	 * @param id
	 * @param imageUrl
	 * @return
	 * @throws Exception
	 */
	public int updateSignContract(String id, String imageUrl) throws Exception;

	/**
	 * 更新是否过期
	 *
	 * @param id
	 * @param imageUrl
	 * @return
	 * @throws Exception
	 */
	public int updateSignContractStatus(String id, String status) throws Exception;

	/**
	 * 添加发票信息
	 *
	 * @param map
	 * @return
	 */
	public int addSignServiceInvoice(Map<String, String> map) throws Exception;

	/**
	 * 根据企业Id查询签约协议记录信息集合
	 *
	 * @return
	 */
	public List<Map<String, Object>> getSignContractListByVirId(int virtualId);


	/**
	 * 根据签约ID查询押金信息明细表
	 *
	 * @param signid
	 * @return
	 */
	public List<Map<String, Object>> getSignContractListBySignid(String signid) throws Exception;

	/**
	 * 根据签约ID查询押金信息明细表
	 *
	 * @param id
	 * @return
	 */
	public List<Map<String, Object>> getSignBasicsList(String id) throws Exception;

	/**
	 * 查询服务押金项信息
	 *
	 * @param id
	 * @return
	 */
	public SignBasics getSignBasicsObj(Integer id);

	/**
	 * 根据押金项ID和签约ID和主键ID查询该押金项是否已经存在
	 *
	 * @param signId
	 * @param basicsId
	 * @param id
	 * @return
	 */
	public Map<String, Object> getIsSignBasics(String signId, String basicsId, Integer id);

	/**
	 * 根据企业ID和发票类型查询该发票信息是否存在
	 *
	 * @param virtualId
	 * @param type
	 * @return
	 */
	public SignServiceInvoice getSignServiceInvoiceObj(Integer virtualId, String type);

	/**
	 * 根据签约ID查询意向商品
	 *
	 * @param id
	 * @return
	 */
	public List<Map<String, Object>> getIntentionalGoods(Integer id);

	/**
	 * 根据用户id查询签约信息
	 *
	 * @param userId
	 * @return
	 */
	public Pages<Map<String, String>> findContract(Map<String, String> map);

	/**
	 * 根据项目organizationId查询最大id的企业编号
	 *
	 * @return
	 */
	public String findCustomerNumberMaxId(String organizationId);


	/**
	 * 根据物业员工ID查询管理的项目列表
	 *
	 * @param userId
	 * @return
	 */
	public List<Map<String, Object>> getStaffByOrganztion(Integer userId);

	/**
	 * 根据企业ID查询发票信息
	 *
	 * @param type
	 * @return
	 */
	public List<SignServiceInvoice> getSignServiceInvoiceList(Integer virtualId);

	/**
	 * 根据企业ID查询企业签约服务信息
	 *
	 * @param virtualId
	 * @return
	 */
	public List<Map<String, Object>> getSignContractList(Integer virtualId);

	/**
	 * 根据id查询发票信息
	 *
	 * @param id
	 * @return
	 */
	public SignServiceInvoice findSignServiceInvoice(Integer id);

	/**
	 * 删除意向商品信息
	 *
	 * @param result
	 * @return
	 * @throws Exception
	 */
	public int deleteProductSign(int signContractId, String servicePackDetailsId) throws Exception;

	/**
	 * 删除押金子项
	 *
	 * @param basicsId
	 * @param signId
	 * @return
	 * @throws Exception
	 */
	public int deleteSignBasics(String basicsId, int signId) throws Exception;

	/**
	 * 查询签约商品列表
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, Object>> findProductSign(String id) throws Exception;

	/**
	 * 查询签约押金列表
	 *
	 * @param signContractId
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, Object>> findSignBasics(String signContractId) throws Exception;

	/**
	 * 根据id查询签约信息
	 *
	 * @param signContractId
	 * @return
	 */
	public SignContract findSignContract(String signContractId) throws Exception;

	/**
	 * 查询过期的签约信息
	 *
	 * @return
	 */
	public List<SignContract> findSignContractList() throws Exception;

	/**
	 * 根据原始id更新原始续约状态
	 *
	 * @param renewalContractId
	 * @param yesorno1
	 * @throws Exception
	 */
	public int updateRenewalContract(String renewalContractId, String yesorno1) throws Exception;

	/**
	 * 查询签约信息
	 *
	 * @param map
	 * @return
	 */
	public SignContract findSignContract(Map<String, String> map);

}
