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
49
50
51
52
53
54
55
56
57
package com.panzhihua.service_community.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.acid.ComActAcidMemberDTO;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.acid.ComActAcidMemberVO;
import com.panzhihua.service_community.entity.ComActAcidMember;
import com.panzhihua.service_community.dao.ComActAcidMemberDao;
import com.panzhihua.service_community.service.ComActAcidMemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * 防疫工作人员表(ComActAcidMember)表服务实现类
 * projectName 成都呐喊信息技术有限公司-智慧社区项目
 * description: 防疫工作人员表相关功能
 *
 * @author zzj
 * @since 2022-04-24 16:12:08
 */
@Slf4j
@Service
public class ComActAcidMemberServiceImpl extends ServiceImpl<ComActAcidMemberDao, ComActAcidMember> implements ComActAcidMemberService {
 
    @Override
    public R pageList(ComActAcidMemberDTO commonPage) {
        return R.ok(this.baseMapper.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage));
    }
 
    @Override
    public R insert(ComActAcidMemberVO comActAcidMemberVO) {
        Integer count= this.baseMapper.selectCount(new QueryWrapper<ComActAcidMember>().lambda().eq(ComActAcidMember::getPhone,comActAcidMemberVO.getPhone()));
        if(count>0){
            return R.fail("手机号码已占用");
        }
        ComActAcidMember comActAcidMember=new ComActAcidMember();
        BeanUtils.copyProperties(comActAcidMemberVO,comActAcidMember);
        return R.ok(this.baseMapper.insert(comActAcidMember));
    }
 
    /**
     * 根据relationName查询推送人员列表
     * @param relationName
     * @return
     */
    @Override
    public R selectPushList(String relationName) {
        return R.ok(this.baseMapper.selectPushList(relationName));
    }
}