浏览代码

Merge branch 'online_music_library' of http://git.dayaedu.com/yonge/mec

zouxuan 4 年之前
父节点
当前提交
cbdc0a2674

+ 19 - 4
mec-biz/src/main/resources/config/mybatis/SysExamSongMapper.xml

@@ -77,12 +77,27 @@
 			<if test="search != null and search != ''">
 				AND (ses.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
 			</if>
-			<if test="createUserId != null">
-				AND ses.create_user_id_ = #{createUserId}
-			</if>
-			<if test="type != null and type != ''">
+			<if test="type != null and type == 'COMMON'">
 				AND ses.type_ = #{type}
 			</if>
+			<if test="type != null and type == 'ALL'">
+				<if test="createUserId != null">
+					AND (ses.type_ = 'COMMON' OR (ses.create_user_id_ = #{createUserId} AND ses.type_ = 'PERSON'))
+				</if>
+			</if>
+			<if test="type != null and type == 'PERSON'">
+				<if test="createUserId != null">
+					AND ses.type_ = #{type} AND ses.create_user_id_ = #{createUserId}
+				</if>
+				<if test="createUserId == null">
+					AND ses.type_ = #{type}
+				</if>
+			</if>
+			<if test="type == null or type == ''">
+				<if test="createUserId != null">
+					AND ses.create_user_id_ = #{createUserId}
+				</if>
+			</if>
 			<if test="subjectId != null">
 				AND FIND_IN_SET(#{subjectId},ses.subject_ids_)
 			</if>

+ 5 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysExamSongController.java

@@ -10,6 +10,7 @@ import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -53,6 +54,10 @@ public class SysExamSongController extends BaseController {
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
     public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        String type = queryInfo.getType();
+        if(StringUtils.isEmpty(type)){
+            queryInfo.setType("ALL");
+        }
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if(sysUser == null){
             throw new BizException("请登录");