|  |  |  | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | if(brandMapper.selectCount(new QueryWrapper<Brand>() | 
|---|
|  |  |  | .eq("ISDELETED",Constants.ZERO) | 
|---|
|  |  |  | .eq(user.getType().equals(Constants.UserType.SYSTEM),"name",brand.getName()) | 
|---|
|  |  |  | .and(user.getType().equals(Constants.UserType.COMPANY), | 
|---|
|  |  |  | .eq(user.getType().equals(Constants.UserType.SYSTEM.getKey()),"name",brand.getName()) | 
|---|
|  |  |  | .and(user.getType().equals(Constants.UserType.COMPANY.getKey()), | 
|---|
|  |  |  | i->i.apply(" name = '"+brand.getName()+"' and type = 1 ") | 
|---|
|  |  |  | .or().apply( "  name = '"+brand.getName()+"' and COMPANY_ID = '"+user.getCompanyId()+"' and type = 0 ") | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | if(brandMapper.selectCount(new QueryWrapper<Brand>() | 
|---|
|  |  |  | .eq("ISDELETED",Constants.ZERO) | 
|---|
|  |  |  | .eq(user.getType().equals(Constants.UserType.SYSTEM),"name",brand.getName()) | 
|---|
|  |  |  | .and(user.getType().equals(Constants.UserType.COMPANY), | 
|---|
|  |  |  | .eq(user.getType().equals(Constants.UserType.SYSTEM.getKey()),"name",brand.getName()) | 
|---|
|  |  |  | .and(user.getType().equals(Constants.UserType.COMPANY.getKey()), | 
|---|
|  |  |  | i->i.apply(" name = '"+brand.getName()+"' and type = 1 ") | 
|---|
|  |  |  | .or().apply( "  name = '"+brand.getName()+"' and COMPANY_ID = '"+user.getCompanyId()+"' and type = 0 ") | 
|---|
|  |  |  | ) | 
|---|