package com.yunzhi.marketing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yunzhi.marketing.entity.TaPersonBuilding;
import com.yunzhi.marketing.entity.TaPreselection;
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-26
 */
@Mapper
@Component
public interface TaPreselectionMapper extends BaseMapper<TaPreselection> {

    /**
     * 条件查询预选
     *
     * @param page
     * @param salesBatchName
     * @param buildingId
     * @param orgId
     * @param status
     * @param personBuildingList
     * @return
     */
    IPage<TaPreselection> listPresecretByCondition(IPage<TaPreselection> page,
                                                   @Param("salesBatchName") String salesBatchName,
                                                   @Param("buildingId") String buildingId,
                                                   @Param("orgId") Integer orgId,
                                                   @Param("status") Integer status,
                                                   @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);

    /**
     * @param id
     * @param orgId
     * @return
     */
    TaPreselection getPresecretById(@Param("id") Integer id, @Param("orgId") Integer orgId);
}
