1
zj
2026-01-14 716f77637e6e324fd5865e82039c2c2ee3f94bfa
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
package com.nq.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nq.common.ServerResponse;
import com.nq.dao.PayChnnelMapper;
import com.nq.pojo.PayChnnel;
import com.nq.service.IPayChnnelServices;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
@Service
public class PayChnnelServices  implements IPayChnnelServices {
    @Resource
    PayChnnelMapper mapper;
    @Override
    public ServerResponse addPayChnnel(PayChnnel payChnnel) {
        if(mapper.insert(payChnnel)>0){
            return ServerResponse.createBySuccess();
        }else{
            return  ServerResponse.createByError();
        }
    }
 
    @Override
    public ServerResponse deletePayChnnel(Integer id) {
        if(mapper.deleteById(id)>0){
            return ServerResponse.createBySuccess();
        }else{
            return  ServerResponse.createByError();
        }
    }
 
    @Override
    public ServerResponse queryPayChnnel(Integer chnnelType) {
        QueryWrapper<PayChnnel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("channel_type",chnnelType);
        queryWrapper.eq("is_show",1);
       return ServerResponse.createBySuccess(mapper.selectList(queryWrapper));
    }
 
 
    @Override
    public ServerResponse queryAdminPayChnnel(Integer chnnelType) {
        QueryWrapper<PayChnnel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("channel_type",chnnelType);
        return ServerResponse.createBySuccess(mapper.selectList(queryWrapper));
    }
 
    @Override
    public ServerResponse updatePayChnnel(PayChnnel payChnnel) {
        if(mapper.updateById(payChnnel)>0){
            return ServerResponse.createBySuccess();
        }else{
            return  ServerResponse.createByError();
        }
    }
}