package com.palmnest.dao.estateserve;

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

import com.palmnest.application.bean.Page;
import com.palmnest.dao.GenericDao;
import com.palmnest.model.estateserve.WxPublicno;
import com.palmnest.model.estateserve.WxPublicnoOrgRelation;

/**
 * 微信公众号dao层接口
 *
 * @author yubing
 * @since 2017-1-13
 */
public interface PublicNoDao extends GenericDao<Object, Integer> {

	/**
	 * 查询公众号信息
	 *
	 * @param developId 公众号原始ID
	 * @return
	 */
	public WxPublicno getByDevelopId(String developId);

	/**
	 * 查询公众号信息
	 *
	 * @param id 主键
	 * @return
	 */
	public WxPublicno getWxPublicnoById(int id);

	/**
	 * 分页查询公众号信息
	 *
	 * @param pageNo
	 * @param whereSQL
	 * @return
	 */
	public Page queryPublicNoPage(int pageNo, String whereSQL);

	/**
	 * 查询微信公众号-项目组织关联
	 *
	 * @param publicnoId
	 * @return
	 */
	public List<WxPublicnoOrgRelation> getWxPublicnoOrgRelations(int publicnoId);

	public List<Map<String, Object>> getWxPubOrgRelations(int publicnoId);

	/**
	 * 删除微信公众号-项目组织关联
	 *
	 * @param publicnoId
	 */
	public void deleteWxPublicnoOrgRelation(int publicnoId);

	/**
	 * 查询所有公众号
	 *
	 * @return
	 */
	public List<WxPublicno> getAllWxPublicno();

	/**
	 * 查询对应项目权限的微信公众号
	 *
	 * @param organizationList
	 */
	public List<Map<String, Object>> getAllWxPublicno(String organizationList);

	/**
	 * 查询微信公众号-项目组织关联
	 *
	 * @param developId
	 * @return ID, organizationName
	 */
	public List<Map<String, Object>> getWxPublicnoOrgRelations(String developId);

	public WxPublicno getByApp(String appId, String appSecret);

	public List<WxPublicno> getAllWxPublicnoWithOuterUrl();

	public WxPublicno getByOrgClientCode(String clientCode);
}
