package com.huiju.estateagents.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huiju.estateagents.entity.TaShareRecord;
import com.huiju.estateagents.excel.ShareChildRecordExport;
import com.huiju.estateagents.excel.ShareRecordFailExport;
import com.huiju.estateagents.excel.ShareRecordSuccessExport;
import com.huiju.estateagents.po.TaShareRecordPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 拼团记录  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2019-10-18
 */
@Mapper
public interface TaShareRecordMapper extends BaseMapper<TaShareRecord> {
    IPage<TaShareRecord> recordSuccessList(IPage<TaShareRecord> page, @Param("phone") String phone, @Param("status") Integer status, @Param("groupActivityId") Integer groupActivityId, @Param("orgId") Integer orgId);
    IPage<TaShareRecordPO> recordFailAndProcessingList(IPage<TaShareRecord> page, @Param("phone") String phone, @Param("status") Integer status, @Param("groupActivityId") Integer groupActivityId, @Param("orgId") Integer orgId);
    List<ShareRecordSuccessExport> getShareRecordSuccessExportList(@Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("recordId") Integer recordId , @Param("status")Integer status, @Param("groupActivityId") Integer groupActivityId);
    List<ShareRecordFailExport> getShareRecordFailExportList(@Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("recordId") Integer recordId , @Param("status")Integer status, @Param("groupActivityId") Integer groupActivityId);
	List<TaShareRecord> getShareRecordList(Page<TaShareRecord> pg,@Param("orgId") Integer orgId,@Param("personId") String personId);
    void updateEndGroupActivity();
    void updateEndGroupActivityByGroupActivityId(@Param("groupActivityId")Integer groupActivityId);
    /**
     * 计算成团数
     * @param groupActivityId
     * @return
     */
    Integer countGroupBuyPeople(@Param("groupActivityId") Integer groupActivityId);
}
