package com.huiju.estateagents.mapper;

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

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2020-02-20
 */
@Mapper
@Component
public interface TaLiveActivityMapper extends BaseMapper<TaLiveActivity> {

    /**
     * 访问人数自增
     *
     * @param id
     * @return
     */
    Boolean addVisitNum(@Param("id") String id);

    IPage<TaLiveActivity> selectLiveListByCondition(IPage<TaLiveActivity> pg, @Param("liveActivityTitle") String liveActivityTitle, @Param("cityId") String cityId, @Param("buildingId") String buildingId, @Param("status") Integer status, @Param("orgId") Integer orgId,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList, @Param("userId") Integer userId);
    /**
     * 批量更新直播活动状态
     *
     * @param orgId
     * @param taLiveActivityList
     */
    void updateLiveActivityStatus(@Param("orgId") Integer orgId, @Param("taLiveActivityList") List<TaLiveActivity> taLiveActivityList);

    TaLiveActivity getDetailById(@Param("id")Integer id);
}
