|
@@ -154,18 +154,23 @@ public class CourseController extends ControllerSupport {
|
|
|
*/
|
|
|
@ApiOperation(value = "查询课程")
|
|
|
@GetMapping("query")
|
|
|
- public List<CourseEntity> query(@RequestParam(required = false) String name,
|
|
|
+ public List<CourseEntity> query(@RequestParam(required = false) Long rootOrgId,
|
|
|
+ @RequestParam(required = false) String name,
|
|
|
@RequestParam(required = false) String level,
|
|
|
@RequestParam(required = false) Boolean enable,
|
|
|
@RequestParam(required = false) Long specialtyId) {
|
|
|
|
|
|
User accessUser = getAccessUser();
|
|
|
- Long rootOrgId = accessUser.getRootOrgId();
|
|
|
+ if (null == rootOrgId) {
|
|
|
+ rootOrgId = accessUser.getRootOrgId();
|
|
|
+ }
|
|
|
+
|
|
|
+ final Long finalRootOrgId = rootOrgId;
|
|
|
|
|
|
Specification<CourseEntity> specification = (root, query, cb) -> {
|
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
|
|
|
|
- predicates.add(cb.equal(root.get("rootOrgId"), rootOrgId));
|
|
|
+ predicates.add(cb.equal(root.get("rootOrgId"), finalRootOrgId));
|
|
|
|
|
|
Predicate pr1 = cb.like(root.get("name"), toSqlSearchPattern(name));
|
|
|
Predicate pr2 = cb.like(root.get("code"), toSqlSearchPattern(name));
|