Browse Source

智能陪练后台接口

zouxuan 4 năm trước cách đây
mục cha
commit
0d5fb017ae

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/SysExamSongAccompanimentService.java

@@ -14,5 +14,5 @@ public interface SysExamSongAccompanimentService extends BaseService<Integer, Sy
 
     List<SysExamSongAccompaniment> queryAll(SysExamSongQueryInfo queryInfo);
 
-    PageInfo<SysExamSongAccompaniment> queryAccPage(SysExamSongQueryInfo queryInfo);
+    List<SysExamSongAccompaniment> queryAccPage(SysExamSongQueryInfo queryInfo);
 }

+ 2 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysExamSongAccompanimentServiceImpl.java

@@ -55,22 +55,9 @@ public class SysExamSongAccompanimentServiceImpl extends BaseServiceImpl<Integer
 	}
 
 	@Override
-	public PageInfo<SysExamSongAccompaniment> queryAccPage(SysExamSongQueryInfo queryInfo) {
-		PageInfo<SysExamSongAccompaniment> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+	public List<SysExamSongAccompaniment> queryAccPage(SysExamSongQueryInfo queryInfo) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
-
-		List<SysExamSongAccompaniment> dataList = null;
-		int count = sysExamSongAccompanimentDao.findAccCount(params);
-		if (count > 0) {
-			pageInfo.setTotal(count);
-			params.put("offset", pageInfo.getOffset());
-			dataList = sysExamSongAccompanimentDao.queryAccPage(params);
-		}
-		if (count == 0) {
-			dataList = new ArrayList<>();
-		}
-		pageInfo.setRows(dataList);
-		return pageInfo;
+		return sysExamSongAccompanimentDao.queryAccPage(params);
 	}
 }

+ 5 - 2
mec-biz/src/main/resources/config/mybatis/SysExamSongAccompanimentMapper.xml

@@ -149,11 +149,11 @@
 		</where>
 	</select>
 	<select id="queryAccPage" resultMap="SysExamSongAccompaniment">
-		SELECT sesa.*,ses.name_,ses.type_,ses.url_
+		SELECT sesa.*,ses.name_,ses.type_,ses.url_,s.name_ subject_name_
 		FROM sys_exam_song_accompaniment sesa
 		LEFT JOIN sys_exam_song ses ON ses.id_ = sesa.exam_song_id_
+		LEFT JOIN subject s ON s.id_ = sesa.subject_id_
 		<include refid="queryPageSql"/>
-		<include refid="global.limit"/>
 	</select>
 	<select id="findAccCount" resultType="java.lang.Integer">
 		SELECT COUNT(DISTINCT sesa.id_) FROM sys_exam_song_accompaniment sesa
@@ -166,6 +166,9 @@
 			<if test="search != null and search != ''">
 				AND (sesa.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
 			</if>
+			<if test="sysExamSongId != null">
+				AND sesa.exam_song_id_ = #{sysExamSongId}
+			</if>
 			<if test="subjectId != null">
 				AND sesa.subject_id_ = #{subjectId}
 			</if>

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/SysExamSongAccompanimentController.java

@@ -21,7 +21,7 @@ public class SysExamSongAccompanimentController extends BaseController {
     @GetMapping("/queryPage")
     public Object queryPage(SysExamSongQueryInfo queryInfo) {
         queryInfo.setType("COMMON");
-        return succeed(sysExamSongAccompanimentService.queryPage(queryInfo));
+        return succeed(sysExamSongAccompanimentService.queryAccPage(queryInfo));
     }
 
     @ApiOperation(value = "详情")

+ 1 - 1
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysExamSongAccompanimentController.java

@@ -51,7 +51,7 @@ public class SysExamSongAccompanimentController extends BaseController {
             throw new BizException("请登录");
         }
         queryInfo.setCreateUserId(sysUser.getId());
-        return succeed(sysExamSongAccompanimentService.queryPage(queryInfo));
+        return succeed(sysExamSongAccompanimentService.queryAccPage(queryInfo));
     }
 
     @ApiOperation(value = "详情")