瀏覽代碼

fix: 课程管理查询新增所属机构查询条件

caozixuan 3 年之前
父節點
當前提交
a1f0983668

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/BasicCourseController.java

@@ -95,7 +95,7 @@ public class BasicCourseController {
                                       @ApiParam(value = "状态") @RequestParam(required = false) Boolean enable,
                                       @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                       @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        return ResultUtil.ok(basicCourseService.basicCoursePage(courseName, SystemConstant.convertIdToLong(startCreateTime), SystemConstant.convertIdToLong(endCreateTime), enable, pageNumber, pageSize));
+        return ResultUtil.ok(basicCourseService.basicCoursePage(SystemConstant.convertIdToLong(belongOrgId), courseName, SystemConstant.convertIdToLong(startCreateTime), SystemConstant.convertIdToLong(endCreateTime), enable, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "课程管理-新增/编辑")

+ 2 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/mapper/BasicCourseMapper.java

@@ -32,6 +32,7 @@ public interface BasicCourseMapper extends BaseMapper<BasicCourse> {
      * 查询课程字典
      *
      * @param iPage           分页参数
+     * @param belongOrgId     所属机构id
      * @param courseName      课程名称(模糊查询)
      * @param startCreateTime 课程创建时间(起始值)
      * @param endCreateTime   课程创建时间(终止值)
@@ -41,6 +42,7 @@ public interface BasicCourseMapper extends BaseMapper<BasicCourse> {
      * @return 结果
      */
     IPage<BasicCourseResult> findBasicCoursePage(@Param("iPage") Page<BasicCourseResult> iPage,
+                                                 @Param("belongOrgId") Long belongOrgId,
                                                  @Param("courseName") String courseName,
                                                  @Param("startCreateTime") Long startCreateTime,
                                                  @Param("endCreateTime") Long endCreateTime,

+ 2 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/BasicCourseService.java

@@ -59,6 +59,7 @@ public interface BasicCourseService extends IService<BasicCourse> {
     /**
      * 查询课程信息-分页查询
      *
+     * @param belongOrgId      所属机构id
      * @param courseName      课程名称(模糊查询)
      * @param startCreateTime 课程创建时间(起始)
      * @param endCreateTime   课程创建时间(终止)
@@ -67,7 +68,7 @@ public interface BasicCourseService extends IService<BasicCourse> {
      * @param pageSize        分页容量
      * @return 查询结果
      */
-    IPage<BasicCourseResult> basicCoursePage(String courseName, Long startCreateTime, Long endCreateTime, Boolean enable, int pageNumber, int pageSize);
+    IPage<BasicCourseResult> basicCoursePage(Long belongOrgId,String courseName, Long startCreateTime, Long endCreateTime, Boolean enable, int pageNumber, int pageSize);
 
     /**
      * 新增/编辑 课程基础信息

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java

@@ -118,11 +118,11 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
     }
 
     @Override
-    public IPage<BasicCourseResult> basicCoursePage(String courseName, Long startCreateTime, Long endCreateTime, Boolean enable, int pageNumber, int pageSize) {
+    public IPage<BasicCourseResult> basicCoursePage(Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime, Boolean enable, int pageNumber, int pageSize) {
         Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         courseName = SystemConstant.translateSpecificSign(courseName);
-        IPage<BasicCourseResult> iPage = basicCourseMapper.findBasicCoursePage(new Page<>(pageNumber, pageSize), courseName, startCreateTime, endCreateTime, enable, schoolId, orgIds);
+        IPage<BasicCourseResult> iPage = basicCourseMapper.findBasicCoursePage(new Page<>(pageNumber, pageSize),belongOrgId, courseName, startCreateTime, endCreateTime, enable, schoolId, orgIds);
         List<BasicCourseResult> list = iPage.getRecords();
         for (BasicCourseResult basicCourseResult : list) {
             Long courseId = basicCourseResult.getId();

+ 3 - 0
teachcloud-common/src/main/resources/mapper/BasicCourseMapper.xml

@@ -74,6 +74,9 @@
                 AND org.type = 'TEACHING_ROOM'
                 AND org.enable = TRUE
         <where>
+            <if test="belongOrgId != null and belongOrgId != ''">
+                AND bc.teaching_room_id = #{belongOrgId}
+            </if>
             <if test="courseName != null and courseName != ''">
                 AND bc.name LIKE CONCAT('%',#{courseName},'%')
             </if>