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 implements AuthorizationService { @Autowired AuthorizationInfoMapper authorizationInfoMapper; @Override public AuthorizationInfo selectByUser(String enterprisenumber, String authcode) { return authorizationInfoMapper.selectByUser(enterprisenumber, authcode); } @Override public List getAuthByEnterprise(String enterpriseNumber) { LambdaQueryWrapperwrapper = new LambdaQueryWrapper<>(); wrapper.eq(AuthorizationInfo::getEnterprisenumber,enterpriseNumber); return authorizationInfoMapper.selectList(wrapper); } @Override public boolean checkPrefixExist(String prefix) { LambdaQueryWrapperwrapper = new LambdaQueryWrapper<>(); wrapper.eq(AuthorizationInfo::getAuthcodeprefix,prefix); AuthorizationInfo authorizationInfo = authorizationInfoMapper.selectOne(wrapper); return authorizationInfo != null; } @Override public boolean checkCodeExist(String code) { LambdaQueryWrapperwrapper = new LambdaQueryWrapper<>(); wrapper.eq(AuthorizationInfo::getAuthcode,code); AuthorizationInfo authorizationInfo = authorizationInfoMapper.selectOne(wrapper); return authorizationInfo != null; } }