package com.hai.service.impl;

import com.hai.dao.HighActivityAwardSerialNumMapper;
import com.hai.entity.HighActivityAwardSerialNum;
import com.hai.entity.HighActivityAwardSerialNumExample;
import com.hai.service.HighActivityAwardSerialNumService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("highActivityAwardSerialNumService")
public class HighActivityAwardSerialNumServiceImpl implements HighActivityAwardSerialNumService {

    @Resource
    private HighActivityAwardSerialNumMapper highActivityAwardSerialNumMapper;

    @Override
    public void update(HighActivityAwardSerialNum serialNum) {
        highActivityAwardSerialNumMapper.updateByPrimaryKey(serialNum);
    }

    @Override
    public HighActivityAwardSerialNum getDetail(Long id) {
        return highActivityAwardSerialNumMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<HighActivityAwardSerialNum> getNoGainListByActivity(Long activityId) {
        HighActivityAwardSerialNumExample example = new HighActivityAwardSerialNumExample();
        example.createCriteria().andActivityInfoIdEqualTo(activityId).andStatusEqualTo(1);
        return highActivityAwardSerialNumMapper.selectByExample(example);
    }
}
