package com.palmnest.dao.estateserve;

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

import org.springframework.ui.ModelMap;

import com.palmnest.application.bean.Page;
import com.palmnest.application.bean.Pagenation;
import com.palmnest.application.core.util.Pages;
import com.palmnest.dao.GenericDao;
import com.palmnest.model.estateserve.ProductCategories;

/**
 * 服务项管理DAO
 *
 * @author xiemin
 */
public interface ServicePackDao extends GenericDao<Object, Integer> {

	/**
	 * 查询服务项列表
	 *
	 * @param modelMap
	 * @return
	 * @throws Exception
	 */
	public Pagenation<Map<String, String>> queryServicePackList(ModelMap modelMap) throws Exception;

	/**
	 * 根据用户名查询用户是否存在
	 *
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public String findByName(String name) throws Exception;

	/**
	 * 删除图片
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deletePicture(String id) throws Exception;

	/**
	 * 查询服务项详情列表
	 *
	 * @param modelMap
	 * @return
	 * @throws Exception
	 */
	public Pages<Map<String, String>> queryServicePackDetailsList(ModelMap modelMap) throws Exception;

	/**
	 * 查询服务项列表
	 *
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, String>> queryServiceList() throws Exception;

	/**
	 * 根据服务id查询服务项列表
	 *
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, String>> queryServiceList(String serviceId) throws Exception;

	/**
	 * 查询服务项详情信息
	 *
	 * @param id
	 * @return
	 */
	public Map<String, String> queryServicePackDetails(String id) throws Exception;

	/**
	 * 根据物品名称、所属id查询
	 *
	 * @param string
	 * @return
	 * @throws Exception
	 */
	public String findByDetailsName(String name, String belongId) throws Exception;

	/**
	 * 添加商品
	 *
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int addServicePackDetails(Map<String, String> map) throws Exception;

	/**
	 * 删除物品
	 *
	 * @param id
	 * @param isEnabled
	 * @return
	 * @throws Exception
	 */
	public int deleteServicePackDetails(String id, String isEnabled) throws Exception;

	/**
	 * 根据所属id查询
	 *
	 * @param belongId
	 * @return
	 * @throws Exception
	 */
	public int findServicePackDetailsId(int belongId) throws Exception;

	/**
	 * 删除服务项
	 *
	 * @param id
	 * @param isEnabled
	 * @return
	 * @throws Exception
	 */
	public int updateServicePack(int id, String isEnabled) throws Exception;

	/**
	 * 查询商品分类类型列表
	 *
	 * @param modelMap
	 * @return
	 * @throws Exception
	 */
	public Pages<Map<String, String>> queryProductCategoriesList(
			ModelMap modelMap) throws Exception;

	/**
	 * 查询分类类型名称
	 *
	 * @param string
	 * @return
	 * @throws Exception
	 */
	public String findProductByName(String name, String belongId) throws Exception;

	/**
	 * 添加商品分类信息
	 *
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int addProductCategories(Map<String, String> map) throws Exception;

	/**
	 * 查询商品分类信息
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Map<String, String> queryProductCategories(String id) throws Exception;

	/**
	 * 更新分类类型
	 *
	 * @param id
	 * @param isEnabled
	 * @return
	 * @throws Exception
	 */
	public int updateProductCategories(Integer id, String isEnabled) throws Exception;

	/**
	 * 根据服务项id查询商品分类列表
	 *
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, String>> queryCategoriesList(String serviceId) throws Exception;

	/**
	 * 根据分类id查询商品信息
	 *
	 * @param categoriesId
	 * @return
	 */
	public List<Map<String, String>> queryServicePackDetailsList(String categoriesId) throws Exception;

	/**
	 * 根据商品id查询商品列表信息
	 *
	 * @param dataIdarr
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, String>> queryServiceDetailsList(String dataIdarr) throws Exception;

	/**
	 * 根据id查询服务项详情
	 *
	 * @param serviceId
	 * @return
	 * @throws Exception
	 */
	public Map<String, String> queryServiceDetails(String serviceId) throws Exception;

	/**
	 * 根据业务编码查询分类信息
	 *
	 * @param serviceCode 业务编码
	 * @return
	 */
	public ProductCategories getProductCategoriesByServiceCode(String serviceCode);

	/**
	 * 查询分类子项目集合信息
	 *
	 * @return
	 */
	public List<ProductCategories> queryChildrenCategoriesList(String parentCode);

	/**
	 * 查询分类详情信息
	 *
	 * @param itemCode 唯一编码
	 * @return
	 */
	public ProductCategories querProductCategoriesByServiceCode(String serviceCode);

	/**
	 * 查询分类列表
	 *
	 * @param whereSql
	 * @param pageSize
	 * @param pageNo
	 * @return
	 */
	public Page getProductCategoriesPage(String whereSql, Integer pageSize, Integer pageNo) throws Exception;

	/**
	 * 根据父级节点查询子级列表
	 *
	 * @param parentCode
	 * @return
	 */
	public List<Map<String, Object>> getProductCategoriesNodes(String parentCode) throws Exception;

	/**
	 * 获取分类最大的code
	 *
	 * @return
	 * @throws Exception
	 */
	public Integer queryProductCategoriesMaxCode() throws Exception;

	/**
	 * 同步子级服务分类
	 *
	 * @param serviceId
	 * @param parentCode
	 * @throws Exception
	 */
	public void updateProductCategoriesServiceId(Integer serviceId, String parentCode) throws Exception;

	/**
	 * 查询分类对象
	 *
	 * @param code 唯一编码
	 * @return
	 */
	public ProductCategories querProductCategoriesByCode(String code);

	/**
	 * 查询分类对象
	 *
	 * @param id 唯一编码
	 * @return
	 */
	public ProductCategories querProductCategoriesById(Integer id);

	/**
	 * 查询对象是否存在
	 *
	 * @param id
	 * @param serviceCode
	 * @return
	 */
	public boolean querProductCateoriesIsFlag(Integer id, String serviceCode);

	/**
	 * 同步子级服务分类
	 *
	 * @param serviceId
	 * @param parentCode
	 * @throws Exception
	 */
	public void deleteProductCategories(String parentCode, String isEnabled) throws Exception;

}
