yonge 2 tahun lalu
induk
melakukan
a9fe83f4d1

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

@@ -175,5 +175,5 @@ public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPayme
 
     List<StudentPaymentOrderDetail> findByCalenderId(Long calenderId);
     
-    List<StudentPaymentOrderDetail> queryByMusicGroupIdAndOrderType(@Param("musicGroupId") String musicGroupId, @Param("orderType") OrderTypeEnum orderType);
+    List<StudentPaymentOrderDetail> querySubjectChangeByMusicGroupId(@Param("musicGroupId") String musicGroupId);
 }

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

@@ -3860,7 +3860,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         String deliveryBatchNo = idGeneratorService.generatorId("delivery") + "";
         
         //更新订单的发货状态(包括声部更换)
-        List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailDao.queryByMusicGroupIdAndOrderType(musicGroupId, OrderTypeEnum.SUBJECT_CHANGE);
+        List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailDao.querySubjectChangeByMusicGroupId(musicGroupId);
         if(studentPaymentOrderDetailList == null){
         	studentPaymentOrderDetailList = new ArrayList<StudentPaymentOrderDetail>();
         }

+ 4 - 3
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml

@@ -421,10 +421,11 @@
         SELECT id_ FROM student_payment_order WHERE calender_id_ = #{calenderId} AND status_ = 'SUCCESS')c) AND spod.id_ IS NOT NULL
     </select>
     
-    <select id="queryByMusicGroupIdAndOrderType" resultMap="StudentPaymentOrderDetail">
+    <select id="querySubjectChangeByMusicGroupId" resultMap="StudentPaymentOrderDetail">
         SELECT spod.*,spo.user_id_ FROM student_payment_order_detail spod
         LEFT JOIN  student_payment_order spo ON spo.id_ = spod.payment_order_id_
-        WHERE spo.music_group_id_ = #{musicGroupId}
-        AND spo.type_ = #{orderType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} and spo.status_ = 'SUCCESS'
+        left join subject_change sc on sc.order_id_ = spo.id_
+        WHERE sc.music_group_id_ = #{musicGroupId}
+        AND spo.type_ = 'SUBJECT_CHANGE' and spo.status_ = 'SUCCESS'
     </select>
 </mapper>