Ver código fonte

Merge remote-tracking branch 'origin/master'

周箭河 4 anos atrás
pai
commit
74b03352d1

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -248,5 +248,5 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @param musicGroupId:
      * @return java.util.Map<java.lang.String,java.lang.String>
      */
-    Map<String, String> queryUserPaymentStatus(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
+    List<Map<String, String>> queryUserPaymentStatus(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
 }

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

@@ -1124,7 +1124,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         List<MusicCardDto> musicCardDtos = musicGroupDao.queryUserMusicGroups(userId);
         Set<String> musicGroupIds = musicCardDtos.stream().map(MusicCardDto::getMusicGroupId).collect(Collectors.toSet());
 //        Map<String, String> paymentStatus = MapUtil.convertMybatisMap(musicGroupStudentFeeDao.queryUserPaymentStatus(userId, StringUtils.join(musicGroupIds, ",")));
-        Map<String, String> paymentStatus = musicGroupPaymentCalenderDao.queryUserPaymentStatus(userId, StringUtils.join(musicGroupIds, ","));
+        Map<String, String> paymentStatus = MapUtil.convertMybatisMap(musicGroupPaymentCalenderDao.queryUserPaymentStatus(userId, StringUtils.join(musicGroupIds, ",")));
         // 获取学员在该乐团续费状态
         musicCardDtos.forEach(e -> {
             e.setPaymentStatus(paymentStatus.get(e.getMusicGroupId()));

+ 6 - 4
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -477,10 +477,12 @@
         AND status_='OPEN'
     </select>
     <select id="queryUserPaymentStatus" resultType="java.util.Map">
-        SELECT mgpc.music_group_id_ 'key',CASE WHEN COUNT(DISTINCT mgpcd.id_) > 0 THEN 'NON_PAYMENT' ELSE 'PAID_COMPLETED' END 'value'
-        FROM music_group_payment_calender mgpc
+        SELECT mg.id_ 'key',CASE WHEN COUNT(mgpc.id_) = 0 OR COUNT(DISTINCT mgpcd.id_) > 0 THEN 'NON_PAYMENT' ELSE 'PAID_COMPLETED' END 'value'
+        FROM music_group mg
+		LEFT JOIN music_group_payment_calender mgpc ON mgpc.music_group_id_ = mg.id_
         LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
-        WHERE FIND_IN_SET(mgpc.music_group_id_,#{musicGroupId}) AND mgpcd.user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT'
-        GROUP BY mgpc.music_group_id_
+        AND mgpcd.user_id_ = #{userId} AND mgpcd.payment_status_ = 'NON_PAYMENT'
+        WHERE FIND_IN_SET(mg.id_,#{musicGroupId})
+        GROUP BY mg.id_
     </select>
 </mapper>