Selaa lähdekoodia

Merge branch 'music_detail'

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
#	mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
yonge 4 vuotta sitten
vanhempi
commit
c70ceb9952

+ 20 - 23
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -64,9 +64,6 @@ import com.ym.mec.biz.dal.dto.PageInfoReg;
 import com.ym.mec.biz.dal.dto.RegisterDto;
 import com.ym.mec.biz.dal.dto.StudentAddDto;
 import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
-import com.ym.mec.biz.dal.dto.StudentInfo;
-import com.ym.mec.biz.dal.dto.StudentMusicDetailDto;
-import com.ym.mec.biz.dal.dto.StudentMusicGroupDto;
 import com.ym.mec.biz.dal.dto.StudentRegisterInstrumentsDetailDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
@@ -2012,6 +2009,26 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     }
 
 	@Override
+	public PageInfo<StudentRegisterInstrumentsDetailDto> queryStudentRegisterInstrumentsDetailList(MusicGroupRecordStudentQueryInfo queryInfo) {
+		PageInfo<StudentRegisterInstrumentsDetailDto> pageInfo = new PageInfo<StudentRegisterInstrumentsDetailDto>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<StudentRegisterInstrumentsDetailDto> dataList = null;
+		int count = studentRegistrationDao.queryStudentRegisterInstrumentsDetailCount(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = studentRegistrationDao.queryStudentRegisterInstrumentsDetailList(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<StudentRegisterInstrumentsDetailDto>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
     @Transactional(rollbackFor = Exception.class)
 	public Boolean setCloudTeacherToFailed(StudentRegistration studentRegistration) {
         
@@ -2045,24 +2062,4 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 		
 		return true;
 	}
-
-	@Override
-	public PageInfo<StudentRegisterInstrumentsDetailDto> queryStudentRegisterInstrumentsDetailList(MusicGroupRecordStudentQueryInfo queryInfo) {
-		PageInfo<StudentRegisterInstrumentsDetailDto> pageInfo = new PageInfo<StudentRegisterInstrumentsDetailDto>(queryInfo.getPage(), queryInfo.getRows());
-		Map<String, Object> params = new HashMap<String, Object>();
-		MapUtil.populateMap(params, queryInfo);
-
-		List<StudentRegisterInstrumentsDetailDto> dataList = null;
-		int count = studentRegistrationDao.queryStudentRegisterInstrumentsDetailCount(params);
-		if (count > 0) {
-			pageInfo.setTotal(count);
-			params.put("offset", pageInfo.getOffset());
-			dataList = studentRegistrationDao.queryStudentRegisterInstrumentsDetailList(params);
-		}
-		if (count == 0) {
-			dataList = new ArrayList<StudentRegisterInstrumentsDetailDto>();
-		}
-		pageInfo.setRows(dataList);
-		return pageInfo;
-	}
 }

+ 1 - 2
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1622,7 +1622,7 @@
         SELECT count(sr.id_)
 		from student_registration sr LEFT JOIN sys_user u on sr.user_id_ = u.id_ 
 		LEFT JOIN student s on s.user_id_ = sr.user_id_ LEFT JOIN `subject` sub on sub.id_ = sr.actual_subject_id_
-		LEFT JOIN student_instrument si on si.student_id_ = sr.user_id_
+		LEFT JOIN (select * from student_instrument where id_ in ((select max(id_) from student_instrument group by student_id_))) si on si.student_id_ = sr.user_id_
 		WHERE sr.music_group_status_ = 'NORMAL' 
 		<if test="musicGroupId != null">
 			AND sr.music_group_id_ = #{musicGroupId}
@@ -1645,7 +1645,6 @@
         ORDER BY sr.create_time_ desc
         <include refid="global.limit"/>
     </select>
-
     <select id="queryStudentApplyDetail" resultType="com.ym.mec.biz.dal.dto.SubjectApplyDetailDto">
         SELECT music_group_id_ musicGroupId,actual_subject_id_ subjectId, COUNT(*) applyStudentNum,SUM(IF(payment_status_ = '2',1,0)) payNum,
         SUM(IF(paying_status_='2',1,0)) checkNum,SUM(IF((payment_status_= '2' and has_cloud_teacher_=1),1,0)) buyCloudTeacherNum,