package com.gk.hotwork.Service.ServiceImpl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.gk.hotwork.Domain.AuthorizationInfo;
|
import com.gk.hotwork.Mapper.AuthorizationInfoMapper;
|
import com.gk.hotwork.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;
|
}
|
}
|