package com.yunzhi.marketing.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yunzhi.marketing.base.ResponseBean;
import com.yunzhi.marketing.entity.TaBuilding;
import com.yunzhi.marketing.entity.TaPerson;
import com.yunzhi.marketing.entity.TaPersonBuilding;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 项目表 服务类
 * </p>
 *
 * @author jobob
 * @since 2019-05-10
 */
public interface ITaBuildingService extends IService<TaBuilding> {

    /**
     * 楼盘列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain, Integer orgId, List<TaPersonBuilding> taPersonBuildingList);

    /**
     * 楼盘列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    ResponseBean buildingListSelect(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain,Integer orgId,List<TaPersonBuilding> taPersonBuildingList);

    /**
     * 楼盘详情
     * @param id
     * @return
     */
    ResponseBean buildingSelectId(String id);

    /**
     * 楼盘详情
     * @param id
     * @return
     */
    ResponseBean buildingAllSelectId(String id, TaPerson person, Integer orgId);


    /**
     * 修改楼盘
     * @param parameter
     * @return
     */
    ResponseBean buildingUpdate(String parameter, Integer orgId);

    /**
     *
     * @param
     * @return
     */
    ResponseBean appointmentList(Integer pageNum, Integer pageSize,String buildingId,String username,String phone,String status);

    /**
     * 添加楼盘
     * @param parameter
     * @return
     */
    ResponseBean buildingAdd(String parameter, Integer orgId, Integer userId);

    /**
     * 修改成已发布
     * @return
     */
    ResponseBean buildingUpdateStatus(String parameter, Integer orgId);

    /**
     * 楼盘删除
     * @return
     */
    ResponseBean buildingdelete(String id, Integer orgId);


    /**
     * 楼盘户型添加
     * @param parameter
     * @return
     */
    ResponseBean buildingApartmentAdd(String parameter);

    /**
     * 户型修改
     * @param parameter
     * @return
     */
    ResponseBean buildingApartmentUpdate(String parameter);

    /**
     * 户型详情
     * @param id
     * @return
     */
    ResponseBean buildingApartmentSelectId(String id);

    /**
     * 修改核销备注
     * @return
     */
    ResponseBean appointmentUpdate(String id,String writeoffRemark);

    /**
     * 微信小程序 楼盘列表
     * @return
     * @param pageNum
     * @param pageSize
     * @param name
     * @param type
     */
    ResponseBean getWxBuildingList(
            Integer pageNum,
            Integer pageSize,
            String name,
            List<String> targets,
            Integer cityId, boolean mine,
            String[] houseTypeList,
            String[] buildingTypeList,
            List<String[]> priceList,
            List<String[]> areaList,
            Integer orgId,
            String priceType,
            String buildingArea,
            String brandId,
            Boolean isRecentOpening,
            Boolean isCommerce,
            String marketStatus,
            String orderBy);

    /**
     * 微信小程序 楼盘列表
     * @return
     */
    ResponseBean getWxMainBuildingList(String cityId, Integer orgId);

    ResponseBean getWxBuildingById(String buildingId);

    /**
     * 户型列表根据楼盘ID查询
     * @param id
     * @return
     */
    ResponseBean buildingApartmentBuildingId(String id, String apartmentType);

    /**
     * 户型删除
     * @param id
     * @return
     */
    ResponseBean apartmentDel(String id);

    /**
     * 查询所有项目
     * @return
     */
    ResponseBean buildingAll(Integer orgId);

    Integer getCityById(String buildingId);

    ResponseBean getBuildingListById(Integer orgId,Integer cityId);

    /**
     * 根据权重判断是否存在
     * @param heavy
     * @return
     */
    int countNumByHeavy(Integer heavy, String dynamicId);

    /**
     * 获取当前楼盘的驻场信息
     * @param buildingId
     * @return
     */
    ResponseBean getMarketingList(Integer pageNum, Integer pageSize, String buildingId);

    /**
     * 拥有权限的楼盘
     * @param userId
     * @return
     */
    List<TaBuilding> selectByUserId(Integer userId);

    List<TaBuilding> getBuilidngsOfPerson(Integer orgId, String personId);

    IPage<TaBuilding> getListOfSpecial(IPage<TaBuilding> page, Integer orgId, String cityId);
}
