puzhibing
2023-11-25 53e7558400dcacecdce70e39ebfe1727740f9296
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.dsh.other.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsh.other.entity.Banner;
import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO;
import com.dsh.other.feignclient.model.AdvertisementQuery;
import com.dsh.other.entity.CreateHistoryDto;
import com.dsh.other.entity.GetHistoryDto;
import com.dsh.other.mapper.BannerMapper;
import com.dsh.other.model.BannerVo;
import com.dsh.other.service.IBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * @author zhibing.pu
 * @date 2023/7/11 17:47
 */
@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements IBannerService {
    @Override
    public void createHistory(CreateHistoryDto createHistoryDto) {
        this.baseMapper.createHistory(createHistoryDto);
    }
 
    @Override
    public List<GetHistoryDto> gethistory(Integer studentId) {
        return baseMapper.getHistory(studentId);
    }
 
    @Override
    public String getFirst() {
        return baseMapper.getFirst();
    }
 
    @Override
    public List<BannerVo> list1(Integer position) {
        return this.bannerMapper.list1(position);
    }
 
    @Autowired
    private BannerMapper bannerMapper;
 
    @Override
    public int changeState(AdvertisementChangeStateDTO dto) {
        List<Integer> ids = dto.getIds();
        Integer state = dto.getState();
        return bannerMapper.changeState(ids, state);
    }
 
    @Override
    public List<Banner> listAll(AdvertisementQuery query) {
        return bannerMapper.listAll(query);
    }
 
 
}