package com.seer.teach.mp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seer.teach.mp.entity.MpActivityInfoCollectionEntity;
import com.seer.teach.mp.mapper.MpActivityInfoCollectionMapper;
import com.seer.teach.mp.service.IMpActivityInfoCollectionService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 活动信息收集表 服务实现类
 * </p>
 *
 * @author Lingma
 * @since 2025-12-30
 */
@Service
@AllArgsConstructor
public class MpActivityInfoCollectionServiceImpl extends ServiceImpl<MpActivityInfoCollectionMapper, MpActivityInfoCollectionEntity> implements IMpActivityInfoCollectionService {

    @Override
    public MpActivityInfoCollectionEntity getByActivityIdAndParentId(Integer agentId, Integer activityId, Integer parentId) {
        LambdaQueryWrapper<MpActivityInfoCollectionEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(MpActivityInfoCollectionEntity::getAgentId, agentId)
                .eq(MpActivityInfoCollectionEntity::getActivityId, activityId)
                .eq(MpActivityInfoCollectionEntity::getParentId, parentId);
        return getOne(queryWrapper, false);
    }
}