puzhibing
2023-06-30 f58cca364b731eac2d60a440ffaa804be3cd43fd
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
package com.stylefeng.guns.modular.system.service.impl;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.TSystemBulletinUserMapper;
import com.stylefeng.guns.modular.system.enums.StatusEnum;
import com.stylefeng.guns.modular.system.model.TSystemBulletinUser;
import com.stylefeng.guns.modular.system.service.ITSystemBulletinUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * <p>
 * 系统公告-用户关系 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-16
 */
@Service
public class TSystemBulletinUserServiceImpl extends ServiceImpl<TSystemBulletinUserMapper, TSystemBulletinUser> implements ITSystemBulletinUserService {
 
    @Autowired
    private TSystemBulletinUserMapper tSystemBulletinUserMapper;
 
    @Override
    public void deleteBulletinUser(Integer bulletinId) {
        List<TSystemBulletinUser> tSystemBulletinUsers = tSystemBulletinUserMapper.selectList(new EntityWrapper<TSystemBulletinUser>().eq("systemBulletinId", bulletinId));
        tSystemBulletinUsers.forEach(bulletin->bulletin.setStatus(StatusEnum.DELETE.getCode()));
        this.updateBatchById(tSystemBulletinUsers);
    }
}