mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
package com.panzhihua.service_community.service.impl;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.entity.ComActSocialProjectPublicity;
import com.panzhihua.service_community.dao.ComActSocialProjectPublicityDao;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.service.ComActSocialProjectPublicityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
import static java.util.Objects.nonNull;
 
/**
 * 项目宣传表(ComActSocialProjectPublicity)表服务实现类
 *
 * @author makejava
 * @since 2021-12-23 14:30:55
 */
@Slf4j
@Service
public class ComActSocialProjectPublicityServiceImpl extends ServiceImpl<ComActSocialProjectPublicityDao, ComActSocialProjectPublicity> implements ComActSocialProjectPublicityService {
 
    @Resource
    private ComActSocialProjectPublicityDao comActSocialProjectPublicityDao;
    @Resource
    private ComActDAO comActDAO;
    @Override
    public R pageList(CommonPage commonPage) {
        if (nonNull(commonPage.getCommunityId())) {
            ComActDO comActDO = comActDAO.selectById(commonPage.getCommunityId());
            if (nonNull(comActDO)) {
                commonPage.setStreetId(comActDO.getStreetId());
            }
        }
        return R.ok(comActSocialProjectPublicityDao.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage));
    }
 
    @Override
    public R selectOne(Long id) {
        return R.ok(comActSocialProjectPublicityDao.selectOne(id));
    }
}