Administrator
2023-06-19 49588f5a462ae7425e7eb030438a35fd80c246fa
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
package com.gk.firework.Service.ServiceImpl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gk.firework.Domain.AuthorizationInfo;
import com.gk.firework.Mapper.AuthorizationInfoMapper;
import com.gk.firework.Service.AuthorizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * @author : jingjy
 * @date : 2021/7/2 9:41
 */
@Service("AuthorizationService")
public class AuthorizationServiceImpl extends ServiceImpl<AuthorizationInfoMapper, AuthorizationInfo> implements AuthorizationService {
    @Autowired
    AuthorizationInfoMapper authorizationInfoMapper;
 
    @Override
    public AuthorizationInfo selectByUser(String enterprisenumber, String authcode) {
        return authorizationInfoMapper.selectByUser(enterprisenumber, authcode);
    }
 
    @Override
    public List<AuthorizationInfo> getAuthByEnterprise(String enterpriseNumber) {
        LambdaQueryWrapper<AuthorizationInfo>wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(AuthorizationInfo::getEnterprisenumber,enterpriseNumber);
        return authorizationInfoMapper.selectList(wrapper);
    }
 
    @Override
    public boolean checkPrefixExist(String prefix) {
        LambdaQueryWrapper<AuthorizationInfo>wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(AuthorizationInfo::getAuthcodeprefix,prefix);
        AuthorizationInfo authorizationInfo = authorizationInfoMapper.selectOne(wrapper);
        return authorizationInfo != null;
    }
 
    @Override
    public boolean checkCodeExist(String code) {
        LambdaQueryWrapper<AuthorizationInfo>wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(AuthorizationInfo::getAuthcode,code);
        AuthorizationInfo authorizationInfo = authorizationInfoMapper.selectOne(wrapper);
        return authorizationInfo != null;
    }
}