| | |
| | | |
| | | Brand brand1 = brandMapper.selectOne(new QueryWrapper<Brand>() |
| | | .eq("ISDELETED", Constants.ZERO) |
| | | .eq(user.getType().equals(Constants.UserType.SYSTEM.getKey()), "name", brand.getName()) |
| | | .and(user.getType().equals(Constants.UserType.SYSTEM.getKey()), wapper->wapper.lambda().eq(Brand::getType,Constants.ONE).eq(Brand::getName,brand.getName())) |
| | | // .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 ") |
| | |
| | | if (Constants.equalsInteger(user.getType(), Constants.UserType.SYSTEM.getKey())) { |
| | | wrapper.lambda().eq(Brand::getType,Constants.ONE); |
| | | }else { |
| | | wrapper.lambda().exists(!Objects.isNull(brand.getCategoryId())," select 1 from goods g where g.brand_id = brand.id and g.category_id = "+brand.getCategoryId()+" and g.COMPANY_ID = "+user.getCompanyId()+" " + |
| | | " and g.STATUS = 0 and g.ISDELETED = 0 "); |
| | | wrapper.lambda().and(i->i.eq(Brand::getCompanyId,user.getCompanyId()) |
| | | .or().eq(Brand::getType,Constants.ONE) |
| | | ); |