k94314517
2024-04-12 e63e56a1b45bc2025147f7f91d248f93a43deb7a
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -370,12 +370,13 @@
        if(solutions.getDataType() == null){
            solutions.setDataType(Constants.TWO);
        }
        QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);
        if(Constants.equalsObject(user.getType(),Constants.TWO)){
            //如果是删除
            solutions.setShopId(user.getCompanyId());
//                wrapper.lambda().exists("select c.id from company_solution c left join solutions d on c.solution_id=d.id where c.isdeleted=0 and d.base_id=solutions.base_id and c.shop_id="+user.getCompanyId());//设置无效访问
                wrapper.apply("((solutions.type=0 and exists(select cs.id from company_solution cs left join solutions s on cs.solution_id=s.id where cs.isdeleted=0 and s.base_id=solutions.base_id and cs.shop_id="+user.getCompanyId()+")) or (" +
                        "solutions.type=1 and solutions.shop_id="+user.getCompanyId()+"))") ;
        }
        QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);
        return solutionsMapper.selectList(wrapper);
    }