package com.huiju.estateagents.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.huiju.estateagents.entity.HelpActivity;
import com.huiju.estateagents.entity.TaPersonBuilding;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.xml.crypto.Data;
import java.util.List;

/**
 * <p>
 * 助力活动  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2019-10-17
 */
@Mapper
public interface HelpActivityMapper extends BaseMapper<HelpActivity> {
    /**
     * 活动助力列表
     * @param pg
     * @param cityId
     * @param buildingId
     * @param title
     * @param startDate
     * @param endDate
     * @param activityStatus
     * @param orgId
     * @return
     */
    IPage<HelpActivity> helpActivityListPage(IPage<HelpActivity> pg, @Param("cityId")Integer cityId, @Param("buildingId")String buildingId, @Param("title")String title, @Param("startDate")String startDate, @Param("endDate") String endDate, @Param("activityStatus")Integer activityStatus, @Param("orgId")Integer orgId,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);

    void updateActivityToUnStart();

    void updateUnStartHelpActivity();

    void updateProcessingHelpActivity();

    /**
     * 微信端查询拼团和助力推首页的活动的
     * @param orgId
     * @param buildingId
     * @return
     */
    List<HelpActivity> selectWxhelpActivityAndGroup(@Param("orgId")Integer orgId,@Param("buildingId") String buildingId,@Param("cityID") String cityID);

    /**
     * 列表 已开始 和 未开始
     * @param pg
     * @param cityId
     * @param orgId
     * @return
     */
    IPage<HelpActivity> helpActivityListEffectivePage(IPage<HelpActivity> pg, Integer cityId, Integer orgId, String buildingId,Integer status,String name,List<TaPersonBuilding> personBuildingList);
}
