package com.huiju.estateagents.mapper;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.HelpInitiateRecord;
import com.huiju.estateagents.excel.HelpInitiateRecordSucceed;
import com.huiju.estateagents.excel.HelpProceedAndFinish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 助力活动发起人员记录  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2019-10-17
 */
@Mapper
public interface HelpInitiateRecordMapper extends BaseMapper<HelpInitiateRecord> {

    /**
     * 助力记录（成功，进行中，失败）
     * @param pg
     * @param helpActivityId
     * @param status
     * @return
     */
    IPage<HelpInitiateRecord> selectPageList(IPage<HelpInitiateRecord> pg, @Param("helpActivityId") Integer helpActivityId, @Param("status") String status,@Param("tel")String tel);

    /**
     * 助力成功记录导出
     * @param i
     * @param pageSize
     * @param tel
     * @param helpActivityId
     */

    List<HelpInitiateRecordSucceed> getHelpInitiateRecordSucceedExportList(@Param("pageCode") int i, @Param("pageSize") Integer pageSize, @Param("tel") String tel, @Param("helpActivityId") Integer helpActivityId);

	/***
	 * 助力 进行中/失败导出
	 * @param i
	 * @param pageSize
	 * @param tel
	 * @param helpActivityId
	 * @param condition
	 * @return
	 */
    List<HelpProceedAndFinish> getHelpProceedAndFinishExportList(@Param("pageCode") int i, @Param("pageSize")Integer pageSize, @Param("tel")String tel, @Param("helpActivityId")Integer helpActivityId,@Param("condition")String condition);

    List<HelpInitiateRecordSucceed> getHelpInitiateRecordSucceedExportList(@Param("pageCode") int i, @Param("pageSize") Integer pageSize, @Param("tel") Integer tel, @Param("helpActivityId") Integer helpActivityId);

    void updateHelpActivityProcessToEnd();
	/**
	 * 获取我的助力列表
	 * @param pg
	 * @param orgId
	 * @param personId
	 * @return
	 */
	List<HelpInitiateRecord> getInitiateRecordList(Page<HelpInitiateRecord> pg,@Param("orgId") Integer orgId,@Param("personId") String personId);
}
