浏览代码

Merge remote-tracking branch 'origin/saas' into saas

hgw 3 年之前
父节点
当前提交
79b98c59fb
共有 100 个文件被更改,包括 651 次插入631 次删除
  1. 3 1
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/dto/MenuQueryInfo.java
  2. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MemberPrivilegesItemDao.java
  3. 7 16
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupDao.java
  4. 3 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  5. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupSchoolTermCourseDetailDao.java
  6. 0 7
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupStudentFeeDao.java
  7. 2 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationDao.java
  8. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java
  9. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/QuestionnaireQuestionDao.java
  10. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ReplacementInstrumentCooperationDao.java
  11. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ResourceRespositoryDao.java
  12. 14 14
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SellOrderDao.java
  13. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SporadicChargeInfoDao.java
  14. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCompetitionDao.java
  15. 4 15
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  16. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentExtracurricularExercisesSituationDao.java
  17. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentGoodsSellDao.java
  18. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentInstrumentDao.java
  19. 1 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  20. 3 15
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  21. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SubjectGoodsMapperDao.java
  22. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupTrainPlanSaveDto.java
  23. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java
  24. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentCompetitionService.java
  25. 0 7
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java
  26. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentServeService.java
  27. 0 5
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentService.java
  28. 4 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java
  29. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsCategoryServiceImpl.java
  30. 6 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java
  31. 7 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  32. 5 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberPrivilegesItemServiceImpl.java
  33. 51 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  34. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSchoolTermCourseDetailServiceImpl.java
  35. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  36. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupTrainPlanServiceImpl.java
  37. 14 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OperatingReportServiceImpl.java
  38. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ReplacementInstrumentCooperationServiceImpl.java
  39. 5 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ResourceRespositoryServiceImpl.java
  40. 6 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCompetitionServiceImpl.java
  41. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentGoodsSellServiceImpl.java
  42. 0 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  43. 8 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java
  44. 2 20
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java
  45. 2 2
      mec-biz/src/main/resources/config/mybatis/MemberRankOrganizationFeeMapperMapper.xml
  46. 7 6
      mec-biz/src/main/resources/config/mybatis/MusicGroupBuildLogMapper.xml
  47. 12 25
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  48. 7 4
      mec-biz/src/main/resources/config/mybatis/MusicGroupNewsMapper.xml
  49. 9 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsDetailMapper.xml
  50. 6 4
      mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsMapper.xml
  51. 7 10
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderActivityDao.xml
  52. 9 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml
  53. 11 10
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  54. 10 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  55. 7 6
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMemberMapper.xml
  56. 7 6
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderRepairMapper.xml
  57. 10 9
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderStudentDetailMapper.xml
  58. 9 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentEntitiesMapper.xml
  59. 10 9
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml
  60. 9 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupPerformanceMapper.xml
  61. 11 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupPurchaseListMapper.xml
  62. 5 3
      mec-biz/src/main/resources/config/mybatis/MusicGroupQuestionnaireMapper.xml
  63. 6 4
      mec-biz/src/main/resources/config/mybatis/MusicGroupQuitMapper.xml
  64. 8 7
      mec-biz/src/main/resources/config/mybatis/MusicGroupSchoolTermCourseDetailMapper.xml
  65. 9 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupSchoolTermStudentCourseDetailMapper.xml
  66. 7 6
      mec-biz/src/main/resources/config/mybatis/MusicGroupStudentClassAdjustMapper.xml
  67. 7 12
      mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml
  68. 9 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectGoodsGroupMapper.xml
  69. 9 8
      mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectPlanMapper.xml
  70. 11 7
      mec-biz/src/main/resources/config/mybatis/MusicGroupTrainPlanMapper.xml
  71. 7 7
      mec-biz/src/main/resources/config/mybatis/OperatingReportMapper.xml
  72. 6 4
      mec-biz/src/main/resources/config/mybatis/OrganizationCloudTeacherFeeMapper.xml
  73. 7 4
      mec-biz/src/main/resources/config/mybatis/OrganizationCourseDurationSettingsMapper.xml
  74. 9 6
      mec-biz/src/main/resources/config/mybatis/OrganizationCourseUnitPriceSettingsMapper.xml
  75. 4 3
      mec-biz/src/main/resources/config/mybatis/OrganizationDegreeCourseFeeMapper.xml
  76. 5 10
      mec-biz/src/main/resources/config/mybatis/OrganizationMapper.xml
  77. 5 4
      mec-biz/src/main/resources/config/mybatis/PageMonitorMapper.xml
  78. 7 5
      mec-biz/src/main/resources/config/mybatis/PhotoAlbumMapper.xml
  79. 9 7
      mec-biz/src/main/resources/config/mybatis/PhotoMapper.xml
  80. 11 13
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml
  81. 7 6
      mec-biz/src/main/resources/config/mybatis/PracticeGroupSellPriceMapper.xml
  82. 5 4
      mec-biz/src/main/resources/config/mybatis/PracticeLessonApplyMapper.xml
  83. 9 7
      mec-biz/src/main/resources/config/mybatis/QuestionnaireQuestionItemMapper.xml
  84. 7 4
      mec-biz/src/main/resources/config/mybatis/QuestionnaireQuestionMapper.xml
  85. 3 4
      mec-biz/src/main/resources/config/mybatis/QuestionnaireTopicMapper.xml
  86. 11 7
      mec-biz/src/main/resources/config/mybatis/QuestionnaireUserResultMapper.xml
  87. 8 6
      mec-biz/src/main/resources/config/mybatis/ReplacementInstrumentActivityMapper.xml
  88. 6 4
      mec-biz/src/main/resources/config/mybatis/ReplacementInstrumentCooperationMapper.xml
  89. 6 4
      mec-biz/src/main/resources/config/mybatis/ReplacementInstrumentMapper.xml
  90. 7 5
      mec-biz/src/main/resources/config/mybatis/ResourceRespositoryMapper.xml
  91. 6 8
      mec-biz/src/main/resources/config/mybatis/SchoolMapper.xml
  92. 23 21
      mec-biz/src/main/resources/config/mybatis/SellOrderMapper.xml
  93. 9 8
      mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml
  94. 7 6
      mec-biz/src/main/resources/config/mybatis/StudentApplyRefundsMapper.xml
  95. 10 9
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  96. 10 8
      mec-biz/src/main/resources/config/mybatis/StudentCompetitionMapper.xml
  97. 8 7
      mec-biz/src/main/resources/config/mybatis/StudentCourseFeeDetailMapper.xml
  98. 11 12
      mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml
  99. 6 4
      mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkReplyMapper.xml
  100. 22 18
      mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

+ 3 - 1
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/dto/MenuQueryInfo.java

@@ -2,7 +2,9 @@ package com.ym.mec.auth.api.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 
-public class MenuQueryInfo{
+import com.ym.mec.common.page.QueryInfo;
+
+public class MenuQueryInfo extends QueryInfo{
     @ApiModelProperty(value = "父节点编号,默认0",required = false)
     private Integer parentId = 0;
 

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

@@ -14,7 +14,7 @@ public interface MemberPrivilegesItemDao extends BaseDAO<Integer, MemberPrivileg
      * @param parentId
      * @return
      */
-    List<MemberPrivilegesItem> findList(@Param("parentId") Integer parentId,@Param("tenantId") Integer tenantId);
+    List<MemberPrivilegesItem> findList(@Param("parentId") Integer parentId);
 
     void batchDel(@Param("collect") List<Integer> collect);
     

+ 7 - 16
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupDao.java

@@ -118,21 +118,12 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
     List<MusicGroup> queryListByIds(@Param("musicGroupIds") String musicGroupIds);
 
     /**
-     * @param musicGroupIds: 乐团编号列表
-     * @return java.util.List<java.util.Map < java.lang.String, java.lang.String>>
-     * @describe 根据乐团获取对应的结算方式
-     * @author Joburgess
-     * @date 2019/11/3
-     */
-    List<Map<String, String>> findSettlementTypeByMusicGroups(@Param("musicGroupIds") List<String> musicGroupIds);
-
-    /**
      * 查询首页的乐团数量
      *
      * @param ogranId
      * @return
      */
-    Map<String, Integer> queryOrganMusicGroupNum(@Param("organId") String ogranId);
+    Map<String, Integer> queryOrganMusicGroupNum(@Param("organId") String ogranId, @Param("tenantId") Integer tenantId);
 
     /**
      * 查询本月乐团课程数
@@ -140,7 +131,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
      * @param organId
      * @return
      */
-    Integer queryCurrentMonthCoursesNum(@Param("organId") String organId);
+    Integer queryCurrentMonthCoursesNum(@Param("organId") String organId, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取乐团下的教师map
@@ -250,7 +241,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
      */
     List<Map<Integer, String>> queryUserMusicStatus(@Param("userIds") Set<Integer> userIds);
 
-    List<MusicGroupRegisterDto> getMusicGroupRegister(@Param("musicGroupStatusList") List<MusicGroupStatusEnum> musicGroupStatusList, @Param("organIds") String organIds);
+    List<MusicGroupRegisterDto> getMusicGroupRegister(@Param("musicGroupStatusList") List<MusicGroupStatusEnum> musicGroupStatusList, @Param("organIds") String organIds, @Param("tenantId") Integer tenantId);
 
     List<RegisterSubjectDto> getRegisterSubjectNum(@Param("musicGroupIds") List<String> musicGroupIds,
                                                    @Param("studentMusicGroupStatus") StudentMusicGroupStatusEnum studentMusicGroupStatus,
@@ -288,7 +279,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
      * @date 2020/9/7
      * @time 14:31
      */
-    List<MusicCardDto> queryOrganMusicInfos(@Param("organId") Integer organId);
+    List<MusicCardDto> queryOrganMusicInfos(@Param("organId") Integer organId, @Param("tenantId") Integer tenantId);
 
     /**
      * @param userId:
@@ -340,7 +331,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
      * @param organIds
      * @return
      */
-    List<String> queryIdsByEduIdAndOrganIds(@Param("educationId") Integer educationId, @Param("organIds") String organIds);
+    List<String> queryIdsByEduIdAndOrganIds(@Param("educationId") Integer educationId, @Param("organIds") String organIds, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取乐团的教学点
@@ -382,7 +373,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
      */
     List<MusicGroup> getMusicGroupByIds(@Param("ids") List<String> ids);
 
-    List<String> getNoClassStudentMusicGroupIds(@Param("organIds") List<Integer> organIds);
+    List<String> getNoClassStudentMusicGroupIds(@Param("organIds") List<Integer> organIds, @Param("tenantId") Integer tenantId);
 
     CooperationOrgan findCooperationOrganEduTeacher(@Param("id") Integer id);
 
@@ -443,7 +434,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
      * @param cooperationOrganIds
      * @return
      */
-    List<MusicGroupRegAndMoneyDto> getMusicGroupByStatus(@Param("organId") String organId, @Param("cooperationOrganIds") List<Integer> cooperationOrganIds, @Param("musicGroupName") String musicGroupName);
+    List<MusicGroupRegAndMoneyDto> getMusicGroupByStatus(@Param("organId") String organId, @Param("cooperationOrganIds") List<Integer> cooperationOrganIds, @Param("musicGroupName") String musicGroupName, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取乐团已经过期或者即将过期的学员列表

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

@@ -7,7 +7,9 @@ import java.util.Set;
 
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
+
 import org.apache.ibatis.annotations.Param;
+import org.junit.runners.Parameterized.Parameters;
 
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
@@ -264,7 +266,7 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 * @param organIds:
 	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroup>
 	 */
-	List<MusicGroup> getNoPaymentStudentMusicGroups(@Param("organIds") Set<Integer> organIds);
+	List<MusicGroup> getNoPaymentStudentMusicGroups(@Param("organIds") Set<Integer> organIds, @Param("tenantId") Integer tenantId);
 
 	/**
 	 * 获取可以缴费,并且未缴费,不是0元的学员

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

@@ -39,5 +39,5 @@ public interface MusicGroupSchoolTermCourseDetailDao extends BaseDAO<Integer, Mu
      * @param remindCourseTime
      * @return
      */
-    List<String> queryPushCourseTermMusicIds(String remindCourseTime);
+    List<String> queryPushCourseTermMusicIds(@Param("remindCourseTime") String remindCourseTime, @Param("tenantId") Integer tenantId);
 }

+ 0 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupStudentFeeDao.java

@@ -57,13 +57,6 @@ public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudent
 	int updateNextPaymentDate(@Param("musicGroupId") String musicGroupId, @Param("nextPaymentDate") Date nextPaymentDate);
 
 	/**
-	 * 根据可提前缴费的天数查询即将续费的列表
-	 * @param days 可提前缴费天数
-	 * @return
-	 */
-	List<MusicGroupStudentFee> queryWillRenewList(int days);
-
-	/**
 	 * 批量更新对象
 	 * @param updateList
 	 * @return

+ 2 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationDao.java

@@ -18,7 +18,7 @@ public interface OrganizationDao extends BaseDAO<Integer, Organization> {
 
     List<Organization> findOrgans(@Param("organIds") List<Integer> organIds);
 
-    List<Organization> getOrgans(@Param("organIds") List<Integer> organIds);
+    List<Organization> getOrgans(@Param("organIds") List<Integer> organIds, @Param("tenantId") Integer tenantId);
 
     /**
      * 根据分部id字符串查询
@@ -55,8 +55,6 @@ public interface OrganizationDao extends BaseDAO<Integer, Organization> {
      */
 	String getOrganName(String organId);
 	
-	List<Organization> findAllOrgans();
-
-	List<Organization> getActivityOrgans();
+	List<Organization> findAllOrgans(Integer tenantId);
 
 }

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

@@ -248,7 +248,7 @@ public interface PracticeGroupDao extends com.ym.mec.common.dal.BaseDAO<Long, Pr
      * @param organIds
      * @return
      */
-    List<CourseGroupExportDto> getPracticeGroupExport(@Param("organIds") String organIds);
+    List<CourseGroupExportDto> getPracticeGroupExport(@Param("organIds") String organIds,@Param("tenantId") Integer tenantId);
 
     /**
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>

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

@@ -20,5 +20,5 @@ public interface QuestionnaireQuestionDao extends BaseDAO<Long, QuestionnaireQue
      * @param activeType
      * @return
      */
-    List<QuestionnaireQuestion> findByActiveType(String activeType);
+    List<QuestionnaireQuestion> findByActiveType(@Param("activeType") String activeType, @Param("tenantId") Integer tenantId);
 }

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

@@ -12,7 +12,7 @@ public interface ReplacementInstrumentCooperationDao extends com.ym.mec.common.d
      * 统计个合作单位的转化率
      * @return
      */
-    List<ReplacementInstrumentCooperation> countAllReplacementsInfo();
+    List<ReplacementInstrumentCooperation> countAllReplacementsInfo(Integer tenantId);
 
     ReplacementInstrumentCooperation findByCooperationOrganIdAndTopicId(@Param("cooperationOrganId") Integer cooperationOrganId, @Param("topicId") Integer topicId);
 }

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

@@ -8,5 +8,5 @@ import java.util.List;
 public interface ResourceRespositoryDao extends com.ym.mec.common.dal.BaseDAO<Integer, ResourceRespository> {
 
 
-    List<ResourceRespository> findList(@Param("parentId") Integer parentId, @Param("delFlag") String delFlag, @Param("subjectId") Integer subjectId);
+    List<ResourceRespository> findList(@Param("parentId") Integer parentId, @Param("delFlag") String delFlag, @Param("subjectId") Integer subjectId, @Param("tenantId") Integer tenantId);
 }

+ 14 - 14
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SellOrderDao.java

@@ -34,7 +34,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getMusicGroupMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getMusicGroupMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取分部学校的收入支出(VIP 网管课订单)
@@ -43,7 +43,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getMusicVipPracticeMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getMusicVipPracticeMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取分部学校的收入支出(外部订单)
@@ -52,7 +52,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getOutOrderMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getOutOrderMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取分部学校的收入支出(充值)
@@ -61,7 +61,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getRechargeMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getRechargeMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取分部学校的收入支出(零星支付)
@@ -70,7 +70,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getSporadicMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getSporadicMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 维修单
@@ -79,7 +79,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getRepairGoodsSellGroupMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getRepairGoodsSellGroupMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 维修单,总收入
@@ -88,7 +88,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getRepairGoodsSellGroupIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getRepairGoodsSellGroupIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
 
     /**
@@ -98,7 +98,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getGoodsSellGroupMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getGoodsSellGroupMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
 
     /**
@@ -116,7 +116,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getMusicGroupIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getMusicGroupIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 外部订单总收入
@@ -125,7 +125,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getOutOrderIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getOutOrderIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取订单的销售成本
@@ -142,21 +142,21 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @param endTime
      * @return
      */
-    List<OperatingReport> getSubjectChangeMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getSubjectChangeMonthReport(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取声部更换的总收入
      *
      * @return
      */
-    List<OperatingReport> getSubjectChangeGroupIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getSubjectChangeGroupIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 统计退货的商品费用
      *
      * @return
      */
-    List<OperatingReport> getRefundIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<OperatingReport> getRefundIncome(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("tenantId") Integer tenantId);
 
 
     /**
@@ -174,7 +174,7 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
      * @author Joburgess
      * @date 2020.10.13
      */
-    List<Integer> getNoneBatchNoSellOrderIds();
+    List<Integer> getNoneBatchNoSellOrderIds(Integer tenantId);
 
 
     /**

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SporadicChargeInfoDao.java

@@ -31,12 +31,12 @@ public interface SporadicChargeInfoDao extends BaseDAO<Integer, SporadicChargeIn
      * @param type
      * @return
      */
-    List<Organization> getActiveOrgans(@Param("type") Integer type);
+    List<Organization> getActiveOrgans(@Param("type") Integer type,@Param("tenantId") Integer tenantId);
 
     /**
      * 获取活动分部的最大缴费金额
      * @param type
      * @return
      */
-    List<OrganMaxAmountDto> getActiveOrgansMaxAmount(@Param("type") Integer type);
+    List<OrganMaxAmountDto> getActiveOrgansMaxAmount(@Param("type") Integer type,@Param("tenantId") Integer tenantId);
 }

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCompetitionDao.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.StudentCompetition;
 import com.ym.mec.common.dal.BaseDAO;
+
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -29,7 +30,7 @@ public interface StudentCompetitionDao extends BaseDAO<Long, StudentCompetition>
      * @date 2020.11.10
      * @return java.util.List<com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto>
      */
-    List<StudentCompetition> getWinnerList();
+    List<StudentCompetition> getWinnerList(Integer tenantId);
 
     /**
      * @describe 获取指定奖项级别的作品编号列表
@@ -38,6 +39,6 @@ public interface StudentCompetitionDao extends BaseDAO<Long, StudentCompetition>
      * @param prizeLevel:
      * @return java.util.Set<java.lang.Long>
      */
-    Set<Long> getCompetitionsWithPrizeLevel(@Param("prizeLevel") Integer prizeLevel);
+    Set<Long> getCompetitionsWithPrizeLevel(@Param("prizeLevel") Integer prizeLevel, @Param("tenantId") Integer tenantId);
 
 }

+ 4 - 15
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -89,7 +89,7 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * @date 2020.04.29
      */
 
-    List<Student> getServiceStudents();
+    List<Student> getServiceStudents(Integer tenantId);
 
     /**
      * @return java.util.List<java.lang.Integer>
@@ -97,9 +97,9 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * @author Joburgess
      * @date 2020.06.04
      */
-    List<Integer> getServeStudentIds();
+    List<Integer> getServeStudentIds(Integer tenantId);
 
-    List<StudentServeCourseDto> getServeStudentCourseStartTimes(@Param("monday") String monday);
+    List<StudentServeCourseDto> getServeStudentCourseStartTimes(@Param("monday") String monday, @Param("tenantId") Integer tenantId);
 
     List<StudentServeCourseDto> getStudentFutureCourseInfo(@Param("monday") String monday,
                                                            @Param("nextMonday") String nextMonday,
@@ -107,16 +107,6 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
 
     List<StudentServeCourseDto> getNoCourseBeServeStudentInfo(@Param("noCourseStudentIds") List<Integer> noCourseStudentIds);
 
-    /**
-     * @param monday:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentServeDto>
-     * @describe 查询被服务学员信息
-     * @author Joburgess
-     * @date 2020.05.27
-     */
-    List<StudentServeDto> getBeServiceStudents(@Param("monday") String monday,
-                                               @Param("courseExpireDate") Date courseExpireDate);
-
 
     List<StudentServeDto> getBeServiceStudentsInfoWithStudents(@Param("monday") String monday,
                                                                @Param("courseExpireDate") Date courseExpireDate,
@@ -234,7 +224,7 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * @param pushMemberRenew
      * @return
      */
-    List<Integer> queryPushMemberRenew(String pushMemberRenew);
+    List<Integer> queryPushMemberRenew(@Param("pushMemberRenew") String pushMemberRenew,@Param("tenantId") Integer tenantId);
 
     /**
      * 清空学员会员
@@ -350,7 +340,6 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      */
     int getOrganEVipStudentNum(@Param("organId") Integer organId);
     int getOrgansTotalEVipStudentNum(@Param("organIds") List<Integer> organIds);
-    List<Map<Integer, Integer>> getOrgansEVipStudentNum(@Param("organIds") List<Integer> organIds);
 
     List<Map<Integer, Integer>> getTeacherExperienceMemberStudentNum(@Param("teacherIds") List<Integer> teacherIds,
                                                                      @Param("organId") Integer organId);

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentExtracurricularExercisesSituationDao.java

@@ -83,7 +83,7 @@ public interface StudentExtracurricularExercisesSituationDao extends BaseDAO<Lon
      * @param sunday:
      * @return int
      */
-    int findLastWeekTodayUpdateNum(@Param("sunday") String sunday);
+    int findLastWeekTodayUpdateNum(@Param("sunday") String sunday,@Param("tenantId") Integer tenantId);
 
     /**
      * @describe 获取学生指定星期的课外训练统计记录
@@ -112,7 +112,7 @@ public interface StudentExtracurricularExercisesSituationDao extends BaseDAO<Lon
      * @param monday:
      * @return int
      */
-    int countWeekServiceNum(@Param("monday") String monday);
+    int countWeekServiceNum(@Param("monday") String monday, @Param("tenantId") Integer tenantId);
 
     /**
      * @describe 获取指定周指定学员的服务指标

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

@@ -57,7 +57,7 @@ public interface StudentGoodsSellDao extends BaseDAO<Integer, StudentGoodsSell>
      * @param autoAffirmReceiveTime:
      * @return java.util.List<java.lang.String>
      */
-    String queryNoAffirmOrderNo(@Param("autoAffirmReceiveTime") String autoAffirmReceiveTime);
+    String queryNoAffirmOrderNo(@Param("autoAffirmReceiveTime") String autoAffirmReceiveTime, @Param("tenantid") Integer tenantid);
 
     /**
      * @describe 自动确认收货

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

@@ -68,7 +68,7 @@ public interface StudentInstrumentDao extends BaseDAO<Long, StudentInstrument> {
      * @param organId
      * @return
      */
-    List<StudentInstrumentExportDto> getInstruments(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("organId") String organId);
+    List<StudentInstrumentExportDto> getInstruments(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("organId") String organId, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取学生的乐团信息

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

@@ -120,13 +120,6 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
                                                 @Param("status") DealStatusEnum status);
 
     /**
-     * 查找支付成功和支付中订单
-     *
-     * @return
-     */
-    int findPayOrderNum();
-
-    /**
      * 获取学员报名时所购买的商品
      *
      * @param musicGroupId
@@ -210,8 +203,6 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
     List<Map<Long, BigDecimal>> queryExpectAmount(@Param("paymentOrderNo") List<Long> paymentOrderNo);
 
 
-    List<StudentPaymentOrder> findFixOrder();
-
     /**
      * 订单导出
      *
@@ -236,7 +227,7 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
      */
     int countSporadicPage(Map<String, Object> params);
 
-    List<OrderStatisDto> getLuckStatis();
+    List<OrderStatisDto> getLuckStatis(Integer tenantId);
 
     /**
      * 统计收入信息

+ 3 - 15
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -385,7 +385,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      *
      * @return
      */
-    List<OrderStatisDto> getOrganNormalStudent();
+    List<OrderStatisDto> getOrganNormalStudent(Integer tenantId);
 
     /**
      * @param userIds:
@@ -671,7 +671,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @param pushMemberRenew
      * @return
      */
-    List<Map<String,String>> queryAutoCreateStudentMap(@Param("pushMemberRenew") String pushMemberRenew);
+    List<Map<String,String>> queryAutoCreateStudentMap(@Param("pushMemberRenew") String pushMemberRenew, @Param("tenantId") Integer tenantId);
 
     /**
      * @describe 查询学员乐团名称字典
@@ -690,19 +690,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * 获取进行中在读的学员列表
      * @return
      */
-    List<Integer> findStudentIds();
-
-    /**
-     * 获取有会员团的学员
-     * @return
-     */
-    List<Integer> queryHasMemberGroupStudent();
-
-    /**
-     * 获取云教练活动分部目标
-     * @return
-     */
-    List<CloudTeacherActiveTargetJsonDto> queryOrganTarget();
+    List<Integer> findStudentIds(Integer tenantId);
 
     /**
     * @description: 获取乐团在读学员乐保信息

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

@@ -15,7 +15,7 @@ public interface SubjectGoodsMapperDao extends BaseDAO<Long, SubjectGoodsMapper>
      * @param goodsCategoryId
      * @param subjectIds
      */
-    void batchAdd(@Param("goodsCategoryId") Integer goodsCategoryId, @Param("subjectIds") List<Integer> subjectIds);
+    void batchAdd(@Param("goodsCategoryId") Integer goodsCategoryId, @Param("subjectIds") List<Integer> subjectIds, @Param("tenantId") Integer tenantId);
 
     /**
      * 删除科目与商品类型关联

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupTrainPlanSaveDto.java

@@ -35,6 +35,8 @@ public class MusicGroupTrainPlanSaveDto {
 	private Date courseClassTime;
 
 	private Boolean studentFlag = false;
+	
+	private Integer tenantId;
 
 	public Boolean getStudentFlag() {
 		return studentFlag;
@@ -115,4 +117,12 @@ public class MusicGroupTrainPlanSaveDto {
 	public void setMusicGroupId(String musicGroupId) {
 		this.musicGroupId = musicGroupId;
 	}
+
+	public Integer getTenantId() {
+		return tenantId;
+	}
+
+	public void setTenantId(Integer tenantId) {
+		this.tenantId = tenantId;
+	}
 }

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

@@ -86,7 +86,7 @@ public interface GoodsService extends BaseService<Integer, Goods> {
      * @date 2020.10.13
      * @return void
      */
-    void sellOrderBatchNoAllot();
+    void sellOrderBatchNoAllot(Integer tenantId);
 
     /**
      * @describe 扣减商品库存

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

@@ -27,7 +27,7 @@ public interface StudentCompetitionService extends BaseService<Long, StudentComp
      * @date 2020.11.10
      * @return void
      */
-    List<StudentCompetitionRankingDto> getWinnerList();
+    List<StudentCompetitionRankingDto> getWinnerList(Integer tenantId);
 
     StudentCompetition checkIsUpload(Integer userId);
 

+ 0 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java

@@ -76,13 +76,6 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
     List<StudentPaymentOrder> queryByBatchNo(Integer userId, String batchNo, DealStatusEnum status);
 
     /**
-     * 查找支付成功和支付中订单
-     *
-     * @return
-     */
-    int findPayOrderNum();
-
-    /**
      * 查询支付中订单
      *
      * @param status

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/StudentServeService.java

@@ -21,9 +21,9 @@ public interface StudentServeService {
      * @param :
      * @return void
      */
-    void exercisesSituationStatistics(String monday);
+    void exercisesSituationStatistics(String monday, Integer tenantId);
 
-    void exercisesSituationStatistics2(String monday, List<Integer> studentIds);
+    void exercisesSituationStatistics2(String monday, List<Integer> studentIds, Integer tenantId);
 
     /**
      * @describe

+ 0 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/StudentService.java

@@ -144,11 +144,6 @@ public interface StudentService extends BaseService<Integer, Student> {
     void cleanStudentCloudStudySequenceDays();
 
     /**
-     * 标记进行中乐团在读学员+VIP、网管有课学员总数(除弦乐声部、去重)
-     */
-    void remarkCountFlag();
-
-    /**
      * 云教练活动统计
      * @param organIds
      * @param queryInfo

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java

@@ -249,10 +249,12 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void exercisesSituationStatistics2(String monday) {
+		Integer tenantId = TenantContextHolder.getTenantId();
+		
 		LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
 
 		if(nowDate.getDayOfWeek()==DayOfWeek.MONDAY){
-			int lastWeekTodayUpdateNum = studentExtracurricularExercisesSituationDao.findLastWeekTodayUpdateNum(nowDate.plusDays(-1).toString());
+			int lastWeekTodayUpdateNum = studentExtracurricularExercisesSituationDao.findLastWeekTodayUpdateNum(nowDate.plusDays(-1).toString(),tenantId);
 			if(lastWeekTodayUpdateNum<=0){
 				nowDate = nowDate.plusDays(-1);
 			}
@@ -264,7 +266,7 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 		LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
 		LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
 
-		List<Student> serviceStudents = studentDao.getServiceStudents();
+		List<Student> serviceStudents = studentDao.getServiceStudents(tenantId);
 		if(CollectionUtils.isEmpty(serviceStudents)){
 			return;
 		}

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

@@ -49,7 +49,7 @@ public class GoodsCategoryServiceImpl extends BaseServiceImpl<Integer, GoodsCate
 			goodsCategoryDao.insert(goodsCategory);
 		}
 		List<Integer> subjectIds = goodsCategory.getSubjectIds();
-		subjectGoodsMapperDao.batchAdd(goodsCategory.getId(),subjectIds);
+		subjectGoodsMapperDao.batchAdd(goodsCategory.getId(),subjectIds, goodsCategory.getTenantId());
 	}
 
 	@Override

+ 6 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -22,6 +22,7 @@ import com.ym.mec.biz.dal.page.GoodsQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.collection.MapUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.PictureData;
 import org.slf4j.Logger;
@@ -54,6 +55,7 @@ import com.ym.mec.common.entity.UploadReturnBean;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.excel.POIUtil;
 import com.ym.mec.util.ini.IniFileUtil;
@@ -136,7 +138,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		goodsProcurement.setGoodsCategoryId(existsGood.getGoodsCategoryId());
 		goodsProcurementDao.insert(goodsProcurement);
 
-		sellOrderBatchNoAllot();
+		sellOrderBatchNoAllot(existsGood.getTenantId());
 	}
 
 	@Override
@@ -427,7 +429,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		}
 		goodsProcurementDao.batchInsert(goodsProcurements);
 
-		sellOrderBatchNoAllot();
+		sellOrderBatchNoAllot(TenantContextHolder.getTenantId());
 
 		return goodsList;
 	}
@@ -468,8 +470,8 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 
 	@Override
 	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-	public void sellOrderBatchNoAllot() {
-		List<Integer> noneBatchNoSellOrderIds = sellOrderDao.getNoneBatchNoSellOrderIds();
+	public void sellOrderBatchNoAllot(Integer tenantId) {
+		List<Integer> noneBatchNoSellOrderIds = sellOrderDao.getNoneBatchNoSellOrderIds(tenantId);
 		if(CollectionUtils.isEmpty(noneBatchNoSellOrderIds)){
 			return;
 		}

+ 7 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -327,8 +327,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	@Transactional(rollbackFor = Exception.class)
 	public void indexBaseDataTask(String dayStr, Set<IndexDataType> dataTypes) {
 		LocalDate nowDate = LocalDate.now();
+		
+		Integer tenantId = TenantContextHolder.getTenantId();
 
-		List<Organization> allOrgans = organizationDao.findAllOrgans();
+		List<Organization> allOrgans = organizationDao.findAllOrgans(tenantId);
 		if(CollectionUtils.isEmpty(this.organIds.get())){
 			this.organIds.get().clear();
 			this.organIds.get().addAll(allOrgans.stream().map(Organization::getId).collect(Collectors.toSet()));
@@ -340,8 +342,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		LocalDate day = LocalDate.parse(dayStr, DateUtil.dateFormatter);
 		LocalDate monday = day.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-		
-		Integer tenantId = TenantContextHolder.getTenantId();
 
 		//学员数据
 		if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.STUDENT_REGISTRATION_NUM)){
@@ -563,7 +563,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		//云教练新用户人数
 		if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.CLOUD_NEW_STUDENT_NUM)) {
-			List<Integer> studentIdList = studentRegistrationDao.findStudentIds();
+			List<Integer> studentIdList = studentRegistrationDao.findStudentIds(tenantId);
 			saveData(studentDao.groupOrganId(null,studentIdList),LocalDate.now().toString(),IndexDataType.CLOUD_NEW_STUDENT_NUM);
 		}
 
@@ -1063,7 +1063,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		String configValue1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_CREATE_PAYMENT_CALENDER, tenantId);
 		if(StringUtils.isNotEmpty(configValue1)){
 			//获取关联的乐团列表
-			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIds);
+			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIds,tenantId);
 			String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
 			if(musicGroupIds.size() > 0){
 				List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,musicGroupIds);
@@ -1281,7 +1281,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 		if(!flag5){
 			//获取关联的乐团列表
-			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIdsStr);
+			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIdsStr,tenantId);
 			if(musicGroupIds.size() > 0){
 				String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
 				date = new Date();
@@ -1308,7 +1308,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	@Override
 	public PageInfo<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds, OrganCloudStudyStudentDataQueryInfo queryInfo) {
 		PageInfo<EduOrganStudentDataDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-		List<Organization> organs = organizationDao.getOrgans(organIds);
+		List<Organization> organs = organizationDao.getOrgans(organIds, queryInfo.getTenantId());
 		pageInfo.setTotal(organs.size());
 
 		if(CollectionUtils.isEmpty(organs)){

+ 5 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberPrivilegesItemServiceImpl.java

@@ -10,7 +10,6 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.filters.TenantIdThreadLocal;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.common.tenant.TenantContextHolder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -34,7 +33,7 @@ public class MemberPrivilegesItemServiceImpl extends BaseServiceImpl<Integer, Me
 	}
 
 	private MemberPrivilegesItem getTree(MemberPrivilegesItem item){
-		List<MemberPrivilegesItem> privilegesItems = memberPrivilegesItemDao.findList(item.getId(), TenantContextHolder.getTenantId());
+		List<MemberPrivilegesItem> privilegesItems = memberPrivilegesItemDao.findList(item.getId());
 		if(privilegesItems != null && privilegesItems.size() > 0) {
 			item.setMemberPrivilegesItems(privilegesItems);
 			for (MemberPrivilegesItem privilegesItem : privilegesItems) {
@@ -56,7 +55,7 @@ public class MemberPrivilegesItemServiceImpl extends BaseServiceImpl<Integer, Me
 		if(memberRankPrivilegesDao.hasPrivileges(memberPrivilegesItemId)){
 			throw new BizException("删除失败:该功能已被使用");
 		}
-		List<MemberPrivilegesItem> memberPrivilegesItems = memberPrivilegesItemDao.findList(memberPrivilegesItemId,TenantContextHolder.getTenantId());
+		List<MemberPrivilegesItem> memberPrivilegesItems = memberPrivilegesItemDao.findList(memberPrivilegesItemId);
 		for (MemberPrivilegesItem item : memberPrivilegesItems) {
 			item = getTree(item);
 		}
@@ -84,7 +83,7 @@ public class MemberPrivilegesItemServiceImpl extends BaseServiceImpl<Integer, Me
 
 	@Override
 	public List<MemberPrivilegesItem> findAllItem(MemberPrivilegesItemQueryInfo queryInfo) {
-		List<MemberPrivilegesItem> rows = memberPrivilegesItemDao.findList(queryInfo.getParentId(),TenantContextHolder.getTenantId());
+		List<MemberPrivilegesItem> rows = memberPrivilegesItemDao.findList(queryInfo.getParentId());
 		if(rows == null || rows.size() == 0){
 			return rows;
 		}
@@ -97,7 +96,7 @@ public class MemberPrivilegesItemServiceImpl extends BaseServiceImpl<Integer, Me
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void updateItem(MemberPrivilegesItem memberPrivilegesItem) {
-		List<MemberPrivilegesItem> itemList = memberPrivilegesItemDao.findList(memberPrivilegesItem.getParentId(),TenantContextHolder.getTenantId());
+		List<MemberPrivilegesItem> itemList = memberPrivilegesItemDao.findList(memberPrivilegesItem.getParentId());
 		if(itemList.size() == 0){
 			if(memberRankPrivilegesDao.hasPrivileges(memberPrivilegesItem.getParentId())){
 				throw new BizException("修改失败:被关联的子集不能被添加子功能");
@@ -120,7 +119,7 @@ public class MemberPrivilegesItemServiceImpl extends BaseServiceImpl<Integer, Me
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void add(MemberPrivilegesItem memberPrivilegesItem) {
-		List<MemberPrivilegesItem> itemList = memberPrivilegesItemDao.findList(memberPrivilegesItem.getParentId(),TenantContextHolder.getTenantId());
+		List<MemberPrivilegesItem> itemList = memberPrivilegesItemDao.findList(memberPrivilegesItem.getParentId());
 		if(itemList.size() == 0){
 			if(memberRankPrivilegesDao.hasPrivileges(memberPrivilegesItem.getParentId())){
 				throw new BizException("修改失败:被关联的子集不能被添加子功能");

+ 51 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -1,39 +1,72 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.*;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
+import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ym.mec.biz.dal.dao.CloudTeacherOrderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
 import com.ym.mec.biz.event.source.GroupEventSource;
-import com.ym.mec.biz.service.*;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderActivityService;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
+import com.ym.mec.biz.service.StudentService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
-import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
 
 @Service
 public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail>  implements MusicGroupPaymentCalenderDetailService {
@@ -632,7 +665,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		if(StringUtils.isNotBlank(organIdsStr)){
 			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
 		}
-		return musicGroupPaymentCalenderDetailDao.getNoPaymentStudentMusicGroups(organIds);
+		return musicGroupPaymentCalenderDetailDao.getNoPaymentStudentMusicGroups(organIds, TenantContextHolder.getTenantId());
 	}
 
 	@Override

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSchoolTermCourseDetailServiceImpl.java

@@ -173,7 +173,7 @@ public class MusicGroupSchoolTermCourseDetailServiceImpl extends BaseServiceImpl
 		String remindCourseTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.REMIND_COURSE_TIME,tenantId);
 		if(StringUtils.isNotEmpty(remindCourseTime)){
 			//获取当前学期截止前14天的乐团,并提醒教务老师排课
-			List<String> musicGroupIds = musicGroupSchoolTermCourseDetailDao.queryPushCourseTermMusicIds(remindCourseTime);
+			List<String> musicGroupIds = musicGroupSchoolTermCourseDetailDao.queryPushCourseTermMusicIds(remindCourseTime,tenantId);
 			if(musicGroupIds.size() > 0){
 				List<MusicGroup> musicGroupList = musicGroupDao.getMusicGroupByIds(musicGroupIds);
 				List<Integer> educationIds = musicGroupList.stream().map(e -> e.getEducationalTeacherId()).collect(Collectors.toList());
@@ -210,7 +210,7 @@ public class MusicGroupSchoolTermCourseDetailServiceImpl extends BaseServiceImpl
 			memberName = memberRankSetting.getName();
 		}
 		if(StringUtils.isNotEmpty(pushMemberRenewAgain)){
-			List<Integer> studentIdList = studentDao.queryPushMemberRenew(pushMemberRenewAgain);
+			List<Integer> studentIdList = studentDao.queryPushMemberRenew(pushMemberRenewAgain, tenantId);
 			if(studentIdList.size() > 0){
 				Map<Integer, String> studentPhoneMap = MapUtil.convertMybatisMap(teacherDao.queryPhoneByIds(StringUtils.join(studentIdList,",")));
 				Map<Integer,String> userMap = new HashMap<>(studentIdList.size());
@@ -241,7 +241,7 @@ public class MusicGroupSchoolTermCourseDetailServiceImpl extends BaseServiceImpl
 		//会员结束前15天自动创建乐团续费(默认提前15天)
 		String autoCreateMemberRenew = sysTenantConfigService.getTenantConfigValue(SysConfigService.AUTO_CREATE_MEMBER_RENEW,tenantId);
 		if(StringUtils.isNotEmpty(autoCreateMemberRenew)){
-			Map<String,String> studentMusicMap = MapUtil.convertMybatisMap(studentRegistrationDao.queryAutoCreateStudentMap(autoCreateMemberRenew));
+			Map<String,String> studentMusicMap = MapUtil.convertMybatisMap(studentRegistrationDao.queryAutoCreateStudentMap(autoCreateMemberRenew, tenantId));
 			if(studentMusicMap.size() > 0){
 				for (String musicGroupId : studentMusicMap.keySet()) {
 					MusicGroup musicGroup = musicGroupDao.get(musicGroupId);

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

@@ -1514,7 +1514,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     public List<MusicCardDto> queryOrganMusicInfos(Integer organId) {
-        return musicGroupDao.queryOrganMusicInfos(organId);
+        return musicGroupDao.queryOrganMusicInfos(organId, TenantContextHolder.getTenantId());
     }
 
     @Override
@@ -3368,7 +3368,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 educationUserId = sysUser.getId();
             }
             //获取关联的乐团列表
-            List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId, queryInfo.getOrganId());
+            List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId, queryInfo.getOrganId(), queryInfo.getTenantId());
             String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
             Date date = new Date();
             String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupTrainPlanServiceImpl.java

@@ -11,8 +11,10 @@ import com.ym.mec.biz.service.MusicGroupTrainPlanService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -179,6 +181,7 @@ public class MusicGroupTrainPlanServiceImpl extends BaseServiceImpl<Integer, Mus
 
 	@Override
 	public List<MusicGroupTrainPlan> queryPlan(MusicGroupTrainPlanSaveDto schoolTerm) {
+		schoolTerm.setTenantId(TenantContextHolder.getTenantId());
 		return musicGroupTrainPlanDao.queryPlan(schoolTerm);
 	}
 }

+ 14 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OperatingReportServiceImpl.java

@@ -70,7 +70,7 @@ public class OperatingReportServiceImpl extends BaseServiceImpl<Integer, Operati
             organOperating.put(organFullJobResource.getOrganId(), operatingReport);
         }
         //1.2 初始化没有全职资源数的分部
-        List<Organization> organs = organizationDao.findAllOrgans();
+        List<Organization> organs = organizationDao.findAllOrgans(tenantId);
         for (Organization organ : organs) {
             if(organOperating.containsKey(organ.getId())) continue;
             OperatingReport operatingReport = new OperatingReport();
@@ -122,29 +122,29 @@ public class OperatingReportServiceImpl extends BaseServiceImpl<Integer, Operati
         }
 
         //3.1、乐团销售订单的统计
-        List<OperatingReport> reports = sellOrderDao.getMusicGroupMonthReport(startTime, endTime);
+        List<OperatingReport> reports = sellOrderDao.getMusicGroupMonthReport(startTime, endTime, tenantId);
         //乐团订单总收入的统计
-        reports.addAll(sellOrderDao.getMusicGroupIncome(startTime, endTime));
+        reports.addAll(sellOrderDao.getMusicGroupIncome(startTime, endTime, tenantId));
         //3.2、VIP、网管课订单的统计(关联学生注册取一条记录)
-        reports.addAll(sellOrderDao.getMusicVipPracticeMonthReport(startTime, endTime));
+        reports.addAll(sellOrderDao.getMusicVipPracticeMonthReport(startTime, endTime, tenantId));
         //3.3、外部添加订单销售
-        reports.addAll(sellOrderDao.getOutOrderMonthReport(startTime, endTime));
+        reports.addAll(sellOrderDao.getOutOrderMonthReport(startTime, endTime, tenantId));
         //外部添加订单销售总收入
-        reports.addAll(sellOrderDao.getOutOrderIncome(startTime, endTime));
+        reports.addAll(sellOrderDao.getOutOrderIncome(startTime, endTime, tenantId));
         //3.4、乐器维修
-        reports.addAll(sellOrderDao.getRepairGoodsSellGroupMonthReport(startTime, endTime));
-        reports.addAll(sellOrderDao.getRepairGoodsSellGroupIncome(startTime, endTime));
+        reports.addAll(sellOrderDao.getRepairGoodsSellGroupMonthReport(startTime, endTime, tenantId));
+        reports.addAll(sellOrderDao.getRepairGoodsSellGroupIncome(startTime, endTime, tenantId));
         //3.5、商品销售
-        reports.addAll(sellOrderDao.getGoodsSellGroupMonthReport(startTime, endTime));
+        reports.addAll(sellOrderDao.getGoodsSellGroupMonthReport(startTime, endTime, tenantId));
         //3.6、零星支付充值
-        reports.addAll(sellOrderDao.getRechargeMonthReport(startTime, endTime));
+        reports.addAll(sellOrderDao.getRechargeMonthReport(startTime, endTime, tenantId));
         //3.7、零星收费(不是充值部分的)
-        reports.addAll(sellOrderDao.getSporadicMonthReport(startTime, endTime));
+        reports.addAll(sellOrderDao.getSporadicMonthReport(startTime, endTime, tenantId));
         //3.8 声部更换的收入
-        reports.addAll(sellOrderDao.getSubjectChangeMonthReport(startTime, endTime));
-        reports.addAll(sellOrderDao.getSubjectChangeGroupIncome(startTime, endTime));
+        reports.addAll(sellOrderDao.getSubjectChangeMonthReport(startTime, endTime, tenantId));
+        reports.addAll(sellOrderDao.getSubjectChangeGroupIncome(startTime, endTime, tenantId));
         //3.9 退货部分的统计
-        reports.addAll(sellOrderDao.getRefundIncome(startTime, endTime));
+        reports.addAll(sellOrderDao.getRefundIncome(startTime, endTime, tenantId));
 
         updateFee(organOperating, cooperationOperating, reports);
 

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

@@ -85,7 +85,7 @@ public class ReplacementInstrumentCooperationServiceImpl extends BaseServiceImpl
     public PageInfo<ReplacementInstrumentCooperation> getPageList(ReplacementInstrumentCooperationQueryInfo queryInfo) {
         PageInfo<ReplacementInstrumentCooperation> pageInfo = queryPage(queryInfo);
         if (pageInfo.getRows().size() > 0) {
-            List<ReplacementInstrumentCooperation> replacementInstruments = replacementInstrumentCooperationDao.countAllReplacementsInfo();
+            List<ReplacementInstrumentCooperation> replacementInstruments = replacementInstrumentCooperationDao.countAllReplacementsInfo(queryInfo.getTenantId());
             for (ReplacementInstrumentCooperation row : pageInfo.getRows()) {
                 for (ReplacementInstrumentCooperation replacementInstrument : replacementInstruments) {
                     if (!row.getId().equals(replacementInstrument.getId())) continue;

+ 5 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ResourceRespositoryServiceImpl.java

@@ -29,25 +29,25 @@ public class ResourceRespositoryServiceImpl extends BaseServiceImpl<Integer, Res
 			menuQueryInfo.setSubjectId(subjectId == 5?6:subjectId == 23?18:subjectId == 3?2:subjectId == 16?15:subjectId == 20?18:subjectId == 50?18:subjectId == 53?18
 					:subjectId == 54?18:subjectId == 55?18:subjectId == 56?18:subjectId == 60?18:subjectId == 8?4:subjectId);
 		}
-		List<ResourceRespository> resourceRespositories = resourceRespositoryDao.findList(menuQueryInfo.getParentId(),menuQueryInfo.getDelFlag(),menuQueryInfo.getSubjectId());
+		List<ResourceRespository> resourceRespositories = resourceRespositoryDao.findList(menuQueryInfo.getParentId(),menuQueryInfo.getDelFlag(),menuQueryInfo.getSubjectId(),menuQueryInfo.getTenantId());
 		for (ResourceRespository repository:resourceRespositories) {
-			repository = getTree(repository,menuQueryInfo.getDelFlag(),menuQueryInfo.getSubjectId());
+			repository = getTree(repository,menuQueryInfo.getDelFlag(),menuQueryInfo.getSubjectId(), menuQueryInfo.getTenantId());
 		}
 		return resourceRespositories;
 	}
 
-	private ResourceRespository getTree(ResourceRespository repository, String delFlag,Integer subjectId){
+	private ResourceRespository getTree(ResourceRespository repository, String delFlag,Integer subjectId, Integer tenantId){
 		//得到根节点对象
 		//获取子节点list
 		List<ResourceRespository> repositories = null;
-		repositories = resourceRespositoryDao.findList(repository.getId(),delFlag,subjectId);
+		repositories = resourceRespositoryDao.findList(repository.getId(),delFlag,subjectId,tenantId);
 		//如果存在子节点
 		if(repositories != null && repositories.size() > 0) {
 			//将子节点list放入父节点对象
 			repository.setRepositories(repositories);
 			//遍历子节点....
 			for (ResourceRespository sysMenu : repositories) {
-				getTree(sysMenu,delFlag,subjectId);
+				getTree(sysMenu,delFlag,subjectId,tenantId);
 			}
 		}
 		return repository;

+ 6 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCompetitionServiceImpl.java

@@ -7,11 +7,14 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+
 import com.ym.mec.biz.dal.entity.StudentCompetition;
 import com.ym.mec.biz.service.StudentCompetitionService;
 import com.ym.mec.biz.dal.dao.StudentCompetitionDao;
+
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
@@ -76,8 +79,8 @@ public class StudentCompetitionServiceImpl extends BaseServiceImpl<Long, Student
 	}
 
 	@Override
-	public List<StudentCompetitionRankingDto> getWinnerList() {
-		List<StudentCompetition> winnerList = studentCompetitionDao.getWinnerList();
+	public List<StudentCompetitionRankingDto> getWinnerList(Integer tenantId) {
+		List<StudentCompetition> winnerList = studentCompetitionDao.getWinnerList(tenantId);
 		List<StudentCompetitionRankingDto> winnerSimpleInfoList = new ArrayList<>();
 		for (StudentCompetition studentCompetition : winnerList) {
 			winnerSimpleInfoList.add(new StudentCompetitionRankingDto(studentCompetition.getId(), studentCompetition.getPrizeLevel(), studentCompetition.getUsername(), studentCompetition.getPictureUrl()));
@@ -88,7 +91,7 @@ public class StudentCompetitionServiceImpl extends BaseServiceImpl<Long, Student
 	@Override
 	public void updateCompetition(StudentCompetition studentCompetition) {
 		if(Objects.nonNull(studentCompetition.getPrizeLevel())&&studentCompetition.getPrizeLevel()>0){
-			Set<Long> competitionsWithPrizeLevel = studentCompetitionDao.getCompetitionsWithPrizeLevel(studentCompetition.getPrizeLevel());
+			Set<Long> competitionsWithPrizeLevel = studentCompetitionDao.getCompetitionsWithPrizeLevel(studentCompetition.getPrizeLevel(),studentCompetition.getTenantId());
 			int maxPrizeLevelUserNum = 0;
 			switch (studentCompetition.getPrizeLevel()){
 				case 1:

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

@@ -93,7 +93,7 @@ public class StudentGoodsSellServiceImpl extends BaseServiceImpl<Integer, Studen
                 TenantInfo tenantInfo = tenantInfos.get(i);
                 String autoAffirmReceiveTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.AUTO_AFFIRM_RECEIVE_TIME,tenantInfo.getId());
                 //获取到期的订单编号
-                String s = studentGoodsSellDao.queryNoAffirmOrderNo(autoAffirmReceiveTime);
+                String s = studentGoodsSellDao.queryNoAffirmOrderNo(autoAffirmReceiveTime, tenantInfo.getId());
                 if(StringUtils.isNotEmpty(s)){
                     sb.append(s).append(",");
                 }

+ 0 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -210,11 +210,6 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
 		return studentPaymentOrderDao.queryByBatchNo(userId, batchNo, status);
 	}
 
-	@Override
-    public int findPayOrderNum() {
-        return studentPaymentOrderDao.findPayOrderNum();
-    }
-
     @Override
     public List<StudentPaymentOrder> findOrdersByStatus(DealStatusEnum status, String paymentChannel) {
         return studentPaymentOrderDao.findOrdersByStatus(status, paymentChannel);

+ 8 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -57,10 +57,10 @@ public class StudentServeServiceImpl implements StudentServeService {
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void exercisesSituationStatistics(String monday) {
+    public void exercisesSituationStatistics(String monday, Integer tenantId) {
         LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
 
-        int lastWeekTodayUpdateNum = studentExtracurricularExercisesSituationDao.findLastWeekTodayUpdateNum(nowDate.plusDays(-nowDate.getDayOfWeek().getValue()).toString());
+        int lastWeekTodayUpdateNum = studentExtracurricularExercisesSituationDao.findLastWeekTodayUpdateNum(nowDate.plusDays(-nowDate.getDayOfWeek().getValue()).toString(), tenantId);
         if(lastWeekTodayUpdateNum<=0){
             nowDate = nowDate.plusDays(-nowDate.getDayOfWeek().getValue());
         }
@@ -73,9 +73,9 @@ public class StudentServeServiceImpl implements StudentServeService {
         LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
         Date nextMonday = Date.from(sunDayDate.plusDays(1).atStartOfDay(DateUtil.zoneId).toInstant());
 
-        List<Integer> beServeStudentIds=studentDao.getServeStudentIds();
+        List<Integer> beServeStudentIds=studentDao.getServeStudentIds(tenantId);
         List<Integer> serveStudentIds=new ArrayList<>();
-        List<StudentServeCourseDto> serveStudentCourseStartTimes = studentDao.getServeStudentCourseStartTimes(monDayDate.toString());
+        List<StudentServeCourseDto> serveStudentCourseStartTimes = studentDao.getServeStudentCourseStartTimes(monDayDate.toString(),tenantId);
         Map<Integer, List<StudentServeCourseDto>> studentTimesMap = new HashMap<>();
         if(!CollectionUtils.isEmpty(serveStudentCourseStartTimes)){
             studentTimesMap = serveStudentCourseStartTimes.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
@@ -298,11 +298,11 @@ public class StudentServeServiceImpl implements StudentServeService {
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void exercisesSituationStatistics2(String monday, List<Integer> studentIds) {
+    public void exercisesSituationStatistics2(String monday, List<Integer> studentIds, Integer tenantId) {
         LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
 
-        int preWeekServiceNum = studentExtracurricularExercisesSituationDao.countWeekServiceNum(nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue()).plusDays(-7).toString());
-        int lastWeekTodayUpdateNum = studentExtracurricularExercisesSituationDao.findLastWeekTodayUpdateNum(nowDate.plusDays(-nowDate.getDayOfWeek().getValue()).toString());
+        int preWeekServiceNum = studentExtracurricularExercisesSituationDao.countWeekServiceNum(nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue()).plusDays(-7).toString(), tenantId);
+        int lastWeekTodayUpdateNum = studentExtracurricularExercisesSituationDao.findLastWeekTodayUpdateNum(nowDate.plusDays(-nowDate.getDayOfWeek().getValue()).toString(), tenantId);
         if(preWeekServiceNum>0 && lastWeekTodayUpdateNum<=0){
             nowDate = nowDate.plusDays(-nowDate.getDayOfWeek().getValue());
         }
@@ -348,7 +348,7 @@ public class StudentServeServiceImpl implements StudentServeService {
         Set<Integer> musicCourseStudentIds = studentFutureCourseInfo.stream().filter(s -> CourseSchedule.CourseScheduleType.SINGLE.equals(s.getType()) || CourseSchedule.CourseScheduleType.MIX.equals(s.getType())).map(StudentServeCourseDto::getStudentId).collect(Collectors.toSet());
 
         Set<Integer> haveCourseBeServeStudentIds = studentCourseMap.keySet();
-        List<Integer> allServeStudentIds = studentDao.getServeStudentIds();
+        List<Integer> allServeStudentIds = studentDao.getServeStudentIds(tenantId);
         Set<Integer> noCourseServeStudentIds = allServeStudentIds.stream().filter(id -> !haveCourseBeServeStudentIds.contains(id)).collect(Collectors.toSet());
 
         Set<Integer> musicStudentIds = new HashSet<>();

+ 2 - 20
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -739,7 +739,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
 
     @Override
     public List<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds) {
-        List<Organization> organs = organizationDao.getOrgans(organIds);
+        List<Organization> organs = organizationDao.getOrgans(organIds,TenantContextHolder.getTenantId());
 
         if(CollectionUtils.isEmpty(organs)){
             return Collections.emptyList();
@@ -849,7 +849,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         List<CloudTeacherActiveTargetDto> targetDtoList = JSONArray.parseArray(cloudTeacherActiveTarget, CloudTeacherActiveTargetDto.class);
         Map<Integer, List<CloudTeacherActiveTargetDto>> targetMap = targetDtoList.stream().collect(Collectors.groupingBy(e -> e.getOrganId()));
 
-        List<Organization> organs = organizationDao.getOrgans(organIds);
+        List<Organization> organs = organizationDao.getOrgans(organIds, queryInfo.getTenantId());
         pageInfo.setTotal(organs.size());
 
         if(CollectionUtils.isEmpty(organs)){
@@ -1042,24 +1042,6 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     }
 
     @Override
-    public void remarkCountFlag() {
-        //清除标记
-        studentDao.cleanCountFlag();
-        //打标记
-//        List<Integer> studentIds = new ArrayList<>();
-        //获取在会员团的学员
-//        studentIds.addAll(studentRegistrationDao.queryHasMemberGroupStudent());
-        //获取购买过云教练(非活动)的学员
-//        studentIds.addAll(cloudTeacherOrderDao.getStudentIds());
-        //标记目标学员
-        studentDao.remarkCountFlag();
-        //更新目标学员、目标金额
-        SysConfig config = sysConfigDao.findByParamName("cloud_teacher_active_target");
-        config.setParanValue(JSON.toJSONString(studentRegistrationDao.queryOrganTarget()));
-        sysConfigDao.update(config);
-    }
-
-    @Override
     public Map<String,Object> countCloudTeacherActive(List<Integer> organIdList, CloudTeacherActiveQueryInfo queryInfo) {
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);

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

@@ -84,7 +84,7 @@
 		LEFT JOIN organization o ON o.id_ = mrofm.organ_id_
 		LEFT JOIN sys_user su ON su.id_ = mrofm.operator_id_
 		<where>
-			tenant_id_ = #{tenantId}
+			mrofm.tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				AND mrs.name_ LIKE CONCAT('%',#{search},'%')
 			</if>
@@ -101,7 +101,7 @@
 		SELECT COUNT(mrofm.id_) FROM member_rank_organization_fee_mapper mrofm
 		LEFT JOIN member_rank_setting mrs ON  mrofm.member_rank_setting_id_ = mrs.id_
 		<where>
-			tenant_id_ = #{tenantId}
+			mrofm.tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				AND mrs.name_ LIKE CONCAT('%',#{search},'%')
 			</if>

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/MusicGroupBuildLogMapper.xml

@@ -13,6 +13,7 @@
         <result column="operator_" property="operator"/>
         <result column="memo_" property="memo"/>
         <result column="create_time_" property="createTime"/>
+		<result column="tenant_id_" property="tenantId" />
         <result column="real_name_" property="realName"/>
     </resultMap>
 
@@ -23,14 +24,14 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroupBuildLog">
-		SELECT * FROM music_group_build_log ORDER BY id_
+		SELECT * FROM music_group_build_log where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupBuildLog" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_build_log (music_group_id_,event_,operator_,memo_,create_time_)
-		VALUES(#{musicGroupId},#{event},#{operator},#{memo},now())
+		INSERT INTO music_group_build_log (music_group_id_,event_,operator_,memo_,create_time_,tenant_id_)
+		VALUES(#{musicGroupId},#{event},#{operator},#{memo},now(),#{tenantId})
 	</insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -50,7 +51,7 @@
                 music_group_id_ = #{musicGroupId},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -60,13 +61,13 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupBuildLog" parameterType="map">
-        SELECT * FROM music_group_build_log ORDER BY id_
+        SELECT * FROM music_group_build_log where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_build_log
+		SELECT COUNT(*) FROM music_group_build_log where tenant_id_ = #{tenantId}
 	</select>
     <select id="findById" resultMap="MusicGroupBuildLog">
 		SELECT mgbl.*,su.real_name_ FROM music_group_build_log mgbl LEFT JOIN sys_user su ON mgbl.operator_ = su.id_

+ 12 - 25
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -92,7 +92,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroup">
         SELECT *
-        FROM music_group
+        FROM music_group where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -258,10 +258,7 @@
 
     <sql id="musicGroupQueryPageSql">
         <where>
-            mg.del_flag_ = 0
-            <if test="tenantId != null">
-                AND mg.tenant_id_ = #{tenantId}
-            </if>
+            mg.del_flag_ = 0 AND mg.tenant_id_ = #{tenantId}
             <if test="organId != null">
                 AND FIND_IN_SET(mg.organ_id_,#{organId})
             </if>
@@ -455,24 +452,12 @@
         FROM music_group
         WHERE FIND_IN_SET(id_, #{musicGroupIds})
     </select>
-    <select id="findSettlementTypeByMusicGroups" resultType="map">
-        SELECT
-        id_ AS 'key',
-        settlement_type_ AS 'value'
-        FROM
-        music_group
-        WHERE
-        id_ IN
-        <foreach collection="musicGroupIds" item="musicGroupId" open="(" close=")" separator=",">
-            #{musicGroupId}
-        </foreach>
-    </select>
 
     <select id="queryOrganMusicGroupNum" resultType="map">
         select count(*) total,sum(case when status_ = 'PREPARE' then 1 else 0 end) prepare_num_,sum(case when status_ =
         'PROGRESS' then 1 else 0 end) progress_num_,sum(case when status_ = 'PAUSE' then 1 else 0 end) pause_num_ from
         music_group
-        where organ_id_ not in (36,38)
+        where organ_id_ not in (36,38) and tenant_id_ = #{tenantId}
         <if test="organId != null">
             and FIND_IN_SET(organ_id_,#{organId})
         </if>
@@ -482,7 +467,7 @@
         SELECT count(cs.id_) from course_schedule cs
         left join class_group cg on cs.class_group_id_ = cg.id_
         left join music_group mg on cg.music_group_id_ = mg.id_
-        where cs.group_type_ = 'MUSIC' AND cg.group_type_ = 'MUSIC'
+        where cs.group_type_ = 'MUSIC' AND cg.group_type_ = 'MUSIC' and cs.tenant_id_ = #{tenantId}
         and DATE_FORMAT(cs.class_date_, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m') and (cs.del_flag_ = 0 or cs.del_flag_
         is null) and mg.organ_id_ not in (36,38) AND cs.pre_course_flag_ = 0
         <if test="organId != null">
@@ -597,6 +582,7 @@
 
     <sql id="findMusicGroupsCondition">
         <where>
+        	tenant_id_ = #{tenantId}
             <if test="repairUserId != null">
                 AND repair_user_id_ = #{repairUserId}
             </if>
@@ -629,8 +615,9 @@
         LEFT JOIN student_registration sr ON mg.id_ = sr.music_group_id_
         LEFT JOIN organization o on o.id_ = mg.organ_id_
         <where>
+        	mg.tenant_id_ = #{tenantId}
             <if test="musicGroupStatusList != null">
-                mg.status_ IN
+                and mg.status_ IN
                 <foreach collection="musicGroupStatusList" item="musicGroupStatus" open="(" close=")"
                          separator=",">
                     #{musicGroupStatus}
@@ -711,7 +698,7 @@
         mg.name_ music_group_name_,
         mg.id_ music_group_id_
         FROM music_group mg
-        WHERE mg.status_ IN ('APPLY','PAY','PREPARE','PROGRESS')
+        WHERE mg.status_ IN ('APPLY','PAY','PREPARE','PROGRESS') and mg.tenant_id_ = #{tenantId}
         <if test="organId != null">
             AND mg.organ_id_ = #{organId}
         </if>
@@ -756,7 +743,7 @@
     <select id="queryIdsByEduIdAndOrganIds" resultType="java.lang.String">
         SELECT DISTINCT id_ FROM music_group
         <where>
-            status_ = 'PROGRESS'
+            status_ = 'PROGRESS' and tenant_id_ = #{tenantId}
             <if test="educationId != null">
                 AND educational_teacher_id_ = #{educationId}
             </if>
@@ -819,7 +806,7 @@
         LEFT JOIN class_group_student_mapper cgsm ON cgsm.group_type_='MUSIC' AND
         cgsm.music_group_id_=sr.music_group_id_ AND cgsm.user_id_=sr.user_id_
         WHERE
-        sr.music_group_status_ = 'NORMAL'
+        sr.music_group_status_ = 'NORMAL' and sr.tenant_id_ = #{tenantId}
         AND mg.status_ = 'PROGRESS'
         AND cgsm.id_ IS NULL
         <if test="organIds!=null and organIds.size()>0">
@@ -885,7 +872,7 @@
         SELECT mg.id_ musicGroupId,o.name_ organName,mg.name_ musicGroupName,mg.status_ musicGroupStatus,mg.course_view_type_ courseViewType FROM
         music_group mg
         LEFT JOIN organization o ON mg.organ_id_ = o.id_
-        WHERE status_ IN ('PRE_APPLY','PRE_BUILD_FEE','FEE_AUDIT','APPLY','PAY')
+        WHERE status_ IN ('PRE_APPLY','PRE_BUILD_FEE','FEE_AUDIT','APPLY','PAY') and tenant_id_ = #{tenantId}
         <if test="organId != null">
             AND FIND_IN_SET(mg.organ_id_,#{organId})
         </if>
@@ -942,7 +929,7 @@
     </select>
     <sql id="queryMusicMemberListSql">
         <where>
-            sr.music_group_status_ = 'NORMAL' AND mg.course_view_type_ = 2
+            sr.music_group_status_ = 'NORMAL' AND mg.course_view_type_ = 2 and sr.tenant_id_ = #{tenantId}
             AND mg.status_ = 'PROGRESS'
             <if test="search != null and search != ''">
                 AND (mg.name_ LIKE CONCAT('%',#{search},'%') OR mg.id_ LIKE CONCAT('%',#{search},'%')

+ 7 - 4
mec-biz/src/main/resources/config/mybatis/MusicGroupNewsMapper.xml

@@ -18,6 +18,7 @@
 		<result column="real_name_" property="operatorName" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -27,13 +28,13 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupNews">
-		SELECT * FROM music_group_news ORDER BY id_
+		SELECT * FROM music_group_news where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupNews" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_news (title_,status_,link_url_,order_,music_group_id_,author_,operator_id_,create_time_,update_time_)
-		VALUES(#{title},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{linkUrl},#{order},#{musicGroupId},#{author},#{operatorId},NOW(),NOW())
+		INSERT INTO music_group_news (title_,status_,link_url_,order_,music_group_id_,author_,operator_id_,create_time_,update_time_,tenant_id_)
+		VALUES(#{title},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{linkUrl},#{order},#{musicGroupId},#{author},#{operatorId},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -61,7 +62,7 @@
 		music_group_id_ = #{musicGroupId},
 		</if>
 		update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -74,6 +75,7 @@
 		SELECT mgn.*,su.real_name_ FROM music_group_news mgn
 		LEFT JOIN sys_user su ON  su.id_ = mgn.operator_id_
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				mgn.music_group_id_ = #{search}
 			</if>
@@ -89,6 +91,7 @@
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(mgn.id_) FROM music_group_news mgn
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				mgn.music_group_id_ = #{search}
 			</if>

+ 9 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsDetailMapper.xml

@@ -16,12 +16,13 @@
         <result column="is_student_optional_" property="isStudentOptional"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
         id_, music_group_organization_course_settings_id_, course_type_, course_total_minuties_,
         unit_price_, course_original_price_, course_current_price_, is_student_optional_,
-        create_time_, update_time_
+        create_time_, update_time_,tenant_id_
     </sql>
     <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettingsDetail">
         <!--@mbg.generated-->
@@ -42,10 +43,10 @@
         insert into music_group_organization_course_settings_detail (music_group_organization_course_settings_id_,
         course_type_, course_total_minuties_,
         unit_price_, course_original_price_, course_current_price_, is_student_optional_,
-        create_time_, update_time_)
+        create_time_, update_time_,tenant_id_)
         values (#{musicGroupOrganizationCourseSettingsId}, #{courseType}, #{courseTotalMinuties},
         #{unitPrice}, #{courseOriginalPrice}, #{courseCurrentPrice}, #{isStudentOptional},
-        NOW(),NOW())
+        NOW(),NOW(),#{tenantId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail">
         <!--@mbg.generated-->
@@ -79,34 +80,34 @@
                 update_time_ = #{updateTime},
             </if>
         </set>
-        where id_ = #{id}
+        where id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
         insert into music_group_organization_course_settings_detail (music_group_organization_course_settings_id_,
         course_type_, course_total_minuties_,
         unit_price_, course_original_price_, course_current_price_, is_student_optional_,
-        create_time_, update_time_)
+        create_time_, update_time_,tenant_id_)
         VALUE
         <foreach collection="settingDetails" separator="," item="settingDetail">
             (#{settingDetail.musicGroupOrganizationCourseSettingsId}, #{settingDetail.courseType},
             #{settingDetail.courseTotalMinuties},
             #{settingDetail.unitPrice}, #{settingDetail.courseOriginalPrice}, #{settingDetail.courseCurrentPrice},
             #{settingDetail.isStudentOptional},
-            NOW(),NOW())
+            NOW(),NOW(),#{tenantId})
         </foreach>
     </insert>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupOrganizationCourseSettingsDetail" parameterType="map">
-        SELECT * FROM music_group_organization_course_settings_detail ORDER BY id_
+        SELECT * FROM music_group_organization_course_settings_detail where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM music_group_organization_course_settings_detail
+        FROM music_group_organization_course_settings_detail where tenant_id_ = #{tenantId}
     </select>
 
     <delete id="deleteBySettingId" parameterType="java.lang.Integer">

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

@@ -13,11 +13,12 @@
         <result column="total_original_price_" property="totalOriginalPrice"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
         id_, name_, organ_id_, charge_type_id_, total_current_price_, total_original_price_,
-        create_time_, update_time_
+        create_time_, update_time_,tenant_id_
     </sql>
     <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettings">
         <!--@mbg.generated-->
@@ -36,9 +37,9 @@
         <!--@mbg.generated-->
         insert into music_group_organization_course_settings (name_, organ_id_, charge_type_id_, total_current_price_,
         total_original_price_,
-        create_time_, update_time_)
+        create_time_, update_time_,tenant_id_)
         values (#{name}, #{organId}, #{chargeTypeId}, #{totalCurrentPrice}, #{totalOriginalPrice},
-        NOW(),NOW())
+        NOW(),NOW(),#{tenantId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
         <!--@mbg.generated-->
@@ -66,7 +67,7 @@
                 update_time_ = #{updateTime},
             </if>
         </set>
-        where id_ = #{id}
+        where id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 分页查询 -->
@@ -84,6 +85,7 @@
 
     <sql id="queryCondition">
         <where>
+        	tenant_id_ = #{tenantId}
             <if test="organId != null">
                 AND mgocs.organ_id_=#{organId}
             </if>

+ 7 - 10
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderActivityDao.xml

@@ -13,10 +13,10 @@
     <result column="original_amount_" property="originalAmount" />
     <result column="create_time_" property="createTime" />
     <result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
   </resultMap>
   <sql id="Base_Column_List">
-    id_,activity_id_,activity_name_,num_,category_name_,calender_id_,optional_flag_,actual_amount_,original_amount_,create_time_,update_time_
-  </sql>
+    id_, activity_id_, calender_id_, optional_flag_,actual_amount_ ,original_amount_, create_time_, update_time_,tenant_id_  </sql>
 
   <!-- 根据主键查询一条记录 -->
   <select id="get" resultMap="MusicGroupPaymentCalenderActivity" >
@@ -31,9 +31,9 @@
   <!-- 向数据库增加一条记录 -->
   <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
     INSERT INTO music_group_payment_calender_activity (activity_id_,activity_name_,num_,
-    category_name_,calender_id_,optional_flag_,actual_amount_,original_amount_,create_time_,update_time_)
+    category_name_,calender_id_,optional_flag_,actual_amount_,original_amount_,create_time_,update_time_,tenant_id_)
     VALUES(#{activityId},#{activityName},#{num},#{categoryName},#{calenderId},#{optionalFlag},
-          #{actualAmount},#{originalAmount},NOW(),NOW())
+          #{actualAmount},#{originalAmount},NOW(),NOW(),#{tenantId})
   </insert>
 
   <!-- 根据主键查询一条记录 -->
@@ -87,13 +87,10 @@
 
   <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
           parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity">
-    insert into music_group_payment_calender_activity(activity_id_,activity_name_,num_,category_name_,calender_id_,
-                                                      optional_flag_,actual_amount_,original_amount_,create_time_,update_time_)
-    values
+    insert into music_group_payment_calender_activity(activity_id_, calender_id_, optional_flag_, actual_amount_ ,original_amount_, create_time_, update_time_, tenant_id_)    values
     <foreach collection="calenderActivityList" item="entity" separator=",">
-      (#{entity.activityId},#{entity.activityName},#{entity.num},#{entity.categoryName},#{entity.calenderId},#{entity.optionalFlag},
-      #{entity.actualAmount},#{entity.originalAmount},NOW(),NOW())
-    </foreach>
+#{entity.activityId}, #{entity.calenderId}, #{entity.optionalFlag}, #{entity.actualAmount},
+      #{entity.originalAmount}, NOW(), NOW(),#{entity.tenantId})    </foreach>
   </insert>
   <delete id="delByCalenderId">
     DELETE FROM music_group_payment_calender_activity WHERE calender_id_ = #{calenderId}

+ 9 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml

@@ -18,6 +18,7 @@
 		<result column="name_" property="name" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -27,7 +28,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupPaymentCalenderCourseSettings">
-		SELECT * FROM music_group_payment_calender_course_settings ORDER BY id_
+		SELECT * FROM music_group_payment_calender_course_settings where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -36,21 +37,21 @@
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_payment_calender_course_settings
 		(music_group_payment_calender_id_,course_type_,course_total_minuties_,unit_price_,course_original_price_,
-		course_current_price_,is_student_optional_,create_time_,update_time_,name_)
+		course_current_price_,is_student_optional_,create_time_,update_time_,name_,tenant_id_)
 		VALUES(#{musicGroupPaymentCalenderId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{courseTotalMinuties},
-		#{unitPrice},#{courseOriginalPrice},#{courseCurrentPrice},#{isStudentOptional},#{createTime},#{updateTime},#{name})
+		#{unitPrice},#{courseOriginalPrice},#{courseCurrentPrice},#{isStudentOptional},#{createTime},#{updateTime},#{name},#{tenantId})
 	</insert>
 	
 	<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
 		INSERT INTO music_group_payment_calender_course_settings
 		(music_group_payment_calender_id_,course_type_,course_total_minuties_,unit_price_,course_original_price_,
-		course_current_price_,is_student_optional_,create_time_,update_time_,name_)
+		course_current_price_,is_student_optional_,create_time_,update_time_,name_,tenant_id_)
 		VALUES
 		<foreach collection="list" item="item" separator=",">
 		(#{item.musicGroupPaymentCalenderId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 		#{item.courseTotalMinuties},#{item.unitPrice},#{item.courseOriginalPrice},#{item.courseCurrentPrice},
-		#{item.isStudentOptional},NOW(),NOW(),#{item.name})
+		#{item.isStudentOptional},NOW(),NOW(),#{item.name},#{item.tenantId})
 		</foreach>
 	</insert>
 
@@ -85,7 +86,7 @@
 			</if>
 				update_time_ = NOW()
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -96,13 +97,13 @@
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupPaymentCalenderCourseSettings"
 		parameterType="map">
-		SELECT * FROM music_group_payment_calender_course_settings ORDER BY id_
+		SELECT * FROM music_group_payment_calender_course_settings where tenant_id_ = #{tenantId} ORDER BY id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_payment_calender_course_settings
+		SELECT COUNT(*) FROM music_group_payment_calender_course_settings where tenant_id_ = #{tenantId} 
 	</select>
 
     <select id="getWithPaymentCalender" resultMap="MusicGroupPaymentCalenderCourseSettings">

+ 11 - 10
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -6,6 +6,7 @@
 	<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail"
 		id="MusicGroupPaymentCalenderDetail">
 		<result column="id_" property="id" />
+        <result column="tenant_id_" property="tenantId"/>
 		<result column="music_group_payment_calender_id_" property="musicGroupPaymentCalenderId" />
 		<result column="user_id_" property="userId" />
 		<result column="expect_amount_" property="expectAmount" />
@@ -46,7 +47,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupPaymentCalenderDetail">
-		SELECT * FROM music_group_payment_calender_detail ORDER BY id_
+		SELECT * FROM music_group_payment_calender_detail where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -56,11 +57,11 @@
 		INSERT INTO music_group_payment_calender_detail
 		(music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,payment_status_,
 		user_status_,pay_time_,update_time_,create_time_,start_payment_date_,deadline_payment_date_,
-		payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_,expect_member_amount_)
+		payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_,expect_member_amount_,tenant_id_)
 		VALUES(#{musicGroupPaymentCalenderId},#{userId},#{expectAmount},#{actualAmount},
 		       #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 		#{userStatus},#{payTime},NOW(),NOW(),#{startPaymentDate},#{deadlinePaymentDate},
-		       #{paymentOrderId},#{useInCourse},#{responsibleUserId},#{responsibleRecord},#{expectMemberAmount})
+		       #{paymentOrderId},#{useInCourse},#{responsibleUserId},#{responsibleRecord},#{expectMemberAmount},#{tenantId})
 	</insert>
 
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
@@ -68,13 +69,13 @@
         INSERT INTO music_group_payment_calender_detail
 		(music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,
 		payment_status_,user_status_,pay_time_,update_time_,create_time_,start_payment_date_,
-		 deadline_payment_date_,payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_,expect_member_amount_)
+		 deadline_payment_date_,payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_,expect_member_amount_,tenant_id_)
 		VALUES
 		<foreach collection="list" item="item" separator=",">
             (#{item.musicGroupPaymentCalenderId},#{item.userId},#{item.expectAmount},
             #{item.actualAmount},#{item.paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.userStatus},#{item.payTime},
             #{item.updateTime},#{item.createTime},#{item.startPaymentDate},#{item.deadlinePaymentDate},
-             #{item.paymentOrderId},#{item.useInCourse},#{item.responsibleUserId},#{item.responsibleRecord},#{item.expectMemberAmount})
+             #{item.paymentOrderId},#{item.useInCourse},#{item.responsibleUserId},#{item.responsibleRecord},#{item.expectMemberAmount},#{item.tenantid})
         </foreach>
     </insert>
 
@@ -132,7 +133,7 @@
 				responsible_record_ = #{responsibleRecord},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	<update id="batchUpdate">
 		<foreach collection="calenderDetails" item="item" index="index" open="" close="" separator=";">
@@ -187,7 +188,7 @@
 					responsible_record_ = #{item.responsibleRecord},
 				</if>
 			</set>
-			WHERE id_ = #{item.id}
+			WHERE id_ = #{item.id} and tenant_id_ = #{item.tenantId}
 		</foreach>
 	</update>
 	<update id="refreshUserMusicGroupPaymentStatusTask">
@@ -232,7 +233,7 @@
 	</select>
 	<sql id="queryPageSql">
 		<where>
-			mgpc.music_group_id_ = sr.music_group_id_
+			mgpc.music_group_id_ = sr.music_group_id_ and mgpcd.tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				AND (mgpcd.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
 			</if>
@@ -438,7 +439,7 @@
 
 	<sql id="queryArrearageStudentsCondition">
 		<where>
-			mg.status_ = 'PROGRESS'
+			mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId}
 			AND ((mgpc.member_rank_setting_id_ IS NOT NULL AND (sr.membership_end_time_ &lt; NOW() OR sr.membership_end_time_ IS NULL)) OR mgpc.member_rank_setting_id_ IS NULL)
 			<if test="noPaymentType==null or noPaymentType==0">
 				AND DATE_FORMAT(NOW(),'%Y-%m-%d') > DATE_FORMAT(mgpc.deadline_payment_date_,'%Y-%m-%d')
@@ -524,7 +525,7 @@
 		music_group_payment_calender_detail mgpcd
 		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
 		LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
-		WHERE mg.status_ = 'PROGRESS'
+		WHERE mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId}
 			AND DATE_FORMAT( NOW(), '%Y-%m-%d' ) >= DATE_FORMAT( mgpc.payment_valid_start_date_, '%Y-%m-%d' )
 			AND mgpcd.payment_status_ = 'NON_PAYMENT'
 			AND (mgpcd.expect_amount_ + mgpcd.expect_member_amount_) > 0 AND mgpc.pay_user_type_ = 'STUDENT'

+ 10 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -9,6 +9,7 @@
     <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" id="MusicGroupPaymentCalender">
         <result column="id_" property="id"/>
         <result column="music_group_id_" property="musicGroupId"/>
+        <result column="tenant_id_" property="tenantId"/>
         <result column="music_group_organization_course_settings_id_" property="musicGroupOrganizationCourseSettingId"/>
         <result column="pay_user_type_" property="payUserType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="start_payment_date_" property="startPaymentDate"/>
@@ -51,7 +52,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroupPaymentCalender">
-		SELECT * FROM music_group_payment_calender ORDER BY id_
+		SELECT * FROM music_group_payment_calender where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -63,14 +64,14 @@
         payment_pattern_,payment_type_,payment_amount_,batch_no_,audit_memo_,operator_,attribute1_,
          attribute2_,student_ids_,member_payment_amount_,member_rank_setting_id_,member_valid_date_
          ,original_member_payment_amount_,member_period_,member_optional_flag_,
-         music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_,current_total_amount_,original_total_amount_)
+         music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_,current_total_amount_,original_total_amount_,tenant_id_)
         VALUES(#{musicGroupId},#{musicGroupOrganizationCourseSettingId},#{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{rejectReason},#{startPaymentDate},#{deadlinePaymentDate},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},now(),now(),
         #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{paymentAmount},#{batchNo},#{auditMemo},#{operator},#{attribute1},#{attribute2},#{studentIds},
                #{memberPaymentAmount},#{memberRankSettingId},#{memberValidDate},#{originalMemberPaymentAmount},#{memberPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-               #{memberOptionalFlag},#{musicRepairNum},#{musicRepairActualPrice},#{musicRepairOptionalFlag},#{currentTotalAmount},#{originalTotalAmount})
+               #{memberOptionalFlag},#{musicRepairNum},#{musicRepairActualPrice},#{musicRepairOptionalFlag},#{currentTotalAmount},#{originalTotalAmount},#{tenantId})
     </insert>
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
@@ -80,7 +81,7 @@
         actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_amount_,
         payment_type_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_,student_ids_,
          member_payment_amount_,member_rank_setting_id_,member_valid_date_,original_member_payment_amount_,member_period_
-        ,member_optional_flag_,music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_,current_total_amount_,original_total_amount_)
+        ,member_optional_flag_,music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_,current_total_amount_,original_total_amount_,tenant_id_)
         VALUES
         <foreach collection="list" item="item" index="index" separator=",">
         (#{item.musicGroupId},#{item.musicGroupOrganizationCourseSettingId},#{item.payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.rejectReason},#{item.startPaymentDate},#{item.deadlinePaymentDate},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
@@ -88,7 +89,7 @@
         #{item.paymentValidStartDate},#{item.paymentValidEndDate},#{item.paymentPattern},#{item.paymentAmount},#{item.paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{item.batchNo},#{item.auditMemo},#{item.operator},#{item.attribute1},#{item.attribute2},
          #{item.studentIds},#{item.memberPaymentAmount},#{item.memberRankSettingId},#{item.memberValidDate},#{item.originalMemberPaymentAmount},#{item.memberPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{item.memberOptionalFlag},#{item.musicRepairNum},#{item.musicRepairActualPrice},#{item.musicRepairOptionalFlag},#{item.currentTotalAmount},#{item.originalTotalAmount})
+            #{item.memberOptionalFlag},#{item.musicRepairNum},#{item.musicRepairActualPrice},#{item.musicRepairOptionalFlag},#{item.currentTotalAmount},#{item.originalTotalAmount},#{tenantId})
         </foreach>
     </insert>
 
@@ -194,7 +195,7 @@
                 attribute2_ = #{attribute2},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
     
     <update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender">
@@ -277,7 +278,7 @@
 	                attribute2_ = #{item.attribute2},
 	            </if>
 	        </set>
-	        WHERE id_ = #{item.id}
+	        WHERE id_ = #{item.id} and tenant_id_ = #{item.tenantId}
 		</foreach>
     </update>
     <update id="cutCalenderExpectNum">
@@ -319,6 +320,7 @@
 
     <sql id="queryPageSql">
         <where>
+        	mgpc.tenant_id_ = #{tenantId}
             <if test="musicGroupId != null">
                 AND mgpc.music_group_id_ = #{musicGroupId}
             </if>
@@ -521,7 +523,7 @@
     </resultMap>
     <sql id="MusicGroupPaymentCalenderAuditDtoSql">
         <where>
-                mgpc.batch_no_ IS NOT NULL
+                mgpc.batch_no_ IS NOT NULL and mgpc.tenant_id_ = #{tenantId}
             <if test="paymentType != null">
                 AND mgpc.payment_type_ = #{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMemberMapper.xml

@@ -18,6 +18,7 @@
 		<result column="original_amount_" property="originalAmount" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -27,15 +28,15 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupPaymentCalenderMember">
-		SELECT * FROM music_group_payment_calender_member ORDER BY id_
+		SELECT * FROM music_group_payment_calender_member where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderMember" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_payment_calender_member (calender_id_,name_,num_,period_,
-		member_rank_setting_id_,optional_flag_,actual_amount_,original_amount_,create_time_,update_time_)
+		member_rank_setting_id_,optional_flag_,actual_amount_,original_amount_,create_time_,update_time_,tenant_id_)
 		VALUES(#{calenderId},#{name},#{num},#{period,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{memberRankSettingId},#{optionalFlag},#{actualAmount},
-		       #{originalAmount},NOW(),NOW())
+		       #{originalAmount},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -66,7 +67,7 @@
 		name_ = #{name},
 		</if>
 		update_time_ = NOW()
-	</set> WHERE id_ = #{id}
+	</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -79,11 +80,11 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupPaymentCalenderMember" parameterType="map">
-		SELECT * FROM music_group_payment_calender_member ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM music_group_payment_calender_member where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_payment_calender_member
+		SELECT COUNT(*) FROM music_group_payment_calender_member  where tenant_id_ = #{tenantId}
 	</select>
 </mapper>

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderRepairMapper.xml

@@ -15,6 +15,7 @@
 		<result column="original_amount_" property="originalAmount" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -24,13 +25,13 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupPaymentCalenderRepair">
-		SELECT * FROM music_group_payment_calender_repair ORDER BY id_
+		SELECT * FROM music_group_payment_calender_repair where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderRepair" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_payment_calender_repair (calender_id_,num_,optional_flag_,actual_amount_,original_amount_,create_time_,update_time_)
-		VALUES(#{calenderId},#{num},#{optionalFlag},#{actualAmount},#{originalAmount},NOW(),NOW())
+		INSERT INTO music_group_payment_calender_repair (calender_id_,num_,optional_flag_,actual_amount_,original_amount_,create_time_,update_time_,tenant_id_)
+		VALUES(#{calenderId},#{num},#{optionalFlag},#{actualAmount},#{originalAmount},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -52,7 +53,7 @@
 		original_amount_ = #{originalAmount},
 		</if>
 		update_time_ = NOW()
-	</set> WHERE id_ = #{id}
+	</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -65,11 +66,11 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupPaymentCalenderRepair" parameterType="map">
-		SELECT * FROM music_group_payment_calender_repair ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM music_group_payment_calender_repair where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_payment_calender_repair
+		SELECT COUNT(*) FROM music_group_payment_calender_repair where tenant_id_ = #{tenantId}
 	</select>
 </mapper>

+ 10 - 9
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderStudentDetailMapper.xml

@@ -20,6 +20,7 @@
 		<result column="batch_no_" property="batchNo" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -29,15 +30,15 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupPaymentCalenderStudentDetail">
-		SELECT * FROM music_group_payment_calender_student_detail ORDER BY id_
+		SELECT * FROM music_group_payment_calender_student_detail where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_payment_calender_student_detail (id_,user_id_,phone_,username_,course_original_price_,
-																 course_current_price_,course_type_,course_time_,class_group_id_,batch_no_,create_time_,update_time_,master_sub_course_price_)
+																 course_current_price_,course_type_,course_time_,class_group_id_,batch_no_,create_time_,update_time_,master_sub_course_price_,tenant_id_)
 		VALUES(#{id},#{userId},#{phone},#{username},#{courseOriginalPrice},#{courseCurrentPrice},
-			   #{courseType},#{courseTime},#{classGroupId},#{batchNo},NOW(),NOW(),#{masterSubCoursePrice})
+			   #{courseType},#{courseTime},#{classGroupId},#{batchNo},NOW(),NOW(),#{masterSubCoursePrice},#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -74,7 +75,7 @@
 		username_ = #{username},
 		</if>
 		update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -84,20 +85,20 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupPaymentCalenderStudentDetail" parameterType="map">
-		SELECT * FROM music_group_payment_calender_student_detail ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM music_group_payment_calender_student_detail where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_payment_calender_student_detail
+		SELECT COUNT(*) FROM music_group_payment_calender_student_detail where tenant_id_ = #{tenantId}
 	</select>
 	<insert id="batchInsert">
 		INSERT INTO music_group_payment_calender_student_detail (user_id_,phone_,username_,course_original_price_,
-		course_current_price_,course_type_,course_time_,class_group_id_,batch_no_,create_time_,update_time_,master_sub_course_price_)
+		course_current_price_,course_type_,course_time_,class_group_id_,batch_no_,create_time_,update_time_,master_sub_course_price_,tenant_id_)
 		VALUES
 		<foreach collection="musicGroupPaymentCalenderStudentDetails" item="item" index="index" separator=",">
 			(#{item.userId},#{item.phone},#{item.username},#{item.courseOriginalPrice},#{item.courseCurrentPrice},
-			#{item.courseType},#{item.courseTime},#{item.classGroupId},#{batchNo},NOW(),NOW(),#{item.masterSubCoursePrice})
+			#{item.courseType},#{item.courseTime},#{item.classGroupId},#{batchNo},NOW(),NOW(),#{item.masterSubCoursePrice},#{item.tenantId})
 		</foreach>
 	</insert>
 
@@ -113,7 +114,7 @@
 			</if>
 			update_time_ = NOW()
 		</set>
-			WHERE id_ = #{item.id}
+			WHERE id_ = #{item.id} and tenant_id_ = #{item.tenantId}
 		</foreach>
 	</update>
 	<update id="updateByCourseType">

+ 9 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentEntitiesMapper.xml

@@ -15,6 +15,7 @@
 		<result column="memo_" property="memo" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -24,19 +25,19 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupPaymentEntities">
-		SELECT * FROM music_group_payment_entities ORDER BY id_
+		SELECT * FROM music_group_payment_entities where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentEntities" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_payment_entities (id_,music_group_id_,name_,payment_method_,amount_,memo_,create_time_,update_time_)
-		VALUES(#{id},#{musicGroupId},#{name},#{paymentMethod, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{amount},#{memo},now(),now())
+		INSERT INTO music_group_payment_entities (id_,music_group_id_,name_,payment_method_,amount_,memo_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{musicGroupId},#{name},#{paymentMethod, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{amount},#{memo},now(),now(),#{tenantId})
 	</insert>
     <insert id="batchAdd">
-		INSERT INTO music_group_payment_entities (music_group_id_,name_,payment_method_,amount_,memo_,create_time_,update_time_)
+		INSERT INTO music_group_payment_entities (music_group_id_,name_,payment_method_,amount_,memo_,create_time_,update_time_,tenant_id_)
 		VALUES
 		<foreach collection="entities" item="item" separator=",">
-			(#{musicGroupId},#{item.name},#{item.paymentMethod.code},#{item.amount},#{item.memo},now(),now())
+			(#{musicGroupId},#{item.name},#{item.paymentMethod.code},#{item.amount},#{item.memo},now(),now(),#{tenantId})
 		</foreach>
 	</insert>
 
@@ -63,7 +64,7 @@
 				name_ = #{name},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -76,12 +77,12 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupPaymentEntities" parameterType="map">
-		SELECT * FROM music_group_payment_entities ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM music_group_payment_entities where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_payment_entities
+		SELECT COUNT(*) FROM music_group_payment_entities  where tenant_id_ = #{tenantId}
 	</select>
     <select id="findByMusicGroupId" resultMap="MusicGroupPaymentEntities">
 		SELECT * FROM music_group_payment_entities WHERE music_group_id_ = #{musicGroupId}

+ 10 - 9
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml

@@ -18,6 +18,7 @@
         <result column="used_course_minutes_" property="usedCourseMinutes"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -30,7 +31,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroupPaymentStudentCourseDetail">
         SELECT *
-        FROM music_group_payment_student_course_detail
+        FROM music_group_payment_student_course_detail where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -40,22 +41,22 @@
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         INSERT INTO music_group_payment_student_course_detail
         (music_group_payment_calender_id_,music_group_payment_calender_detail_id_,user_id_,course_type_,
-         total_course_minutes_,used_course_minutes_,create_time_,update_time_,course_original_price_,course_current_price_)
+         total_course_minutes_,used_course_minutes_,create_time_,update_time_,course_original_price_,course_current_price_,tenant_id_)
         VALUES(#{musicGroupPaymentCalenderId},#{musicGroupPaymentCalenderDetailId},#{userId},
                #{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{totalCourseMinutes},#{usedCourseMinutes},
-               NOW(),NOW(),#{courseOriginalPrice},#{courseCurrentPrice})
+               NOW(),NOW(),#{courseOriginalPrice},#{courseCurrentPrice},#{tenantId})
     </insert>
 
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO music_group_payment_student_course_detail
         (music_group_payment_calender_id_,music_group_payment_calender_detail_id_,user_id_,
-         course_type_,total_course_minutes_,used_course_minutes_,create_time_,update_time_,course_original_price_,course_current_price_)
+         course_type_,total_course_minutes_,used_course_minutes_,create_time_,update_time_,course_original_price_,course_current_price_,tenant_id_)
         VALUES
         <foreach collection="list" item="item" separator=",">
             (#{item.musicGroupPaymentCalenderId},#{item.musicGroupPaymentCalenderDetailId},
              #{item.userId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-             #{item.totalCourseMinutes},#{item.usedCourseMinutes},NOW(),NOW(),#{item.courseOriginalPrice},#{item.courseCurrentPrice})
+             #{item.totalCourseMinutes},#{item.usedCourseMinutes},NOW(),NOW(),#{item.courseOriginalPrice},#{item.courseCurrentPrice},#{item.tenantId})
         </foreach>
     </insert>
 
@@ -90,7 +91,7 @@
             </if>
                 update_time_ = NOW()
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <update id="batchUpdate"
@@ -124,7 +125,7 @@
                 </if>
                 update_time_ = NOW()
             </set>
-            WHERE id_ = #{paymentCourseDetail.id}
+            WHERE id_ = #{paymentCourseDetail.id} and tenant_id_ = #{paymentCourseDetail.tenantId}
         </foreach>
     </update>
     <update id="updateByCourseType">
@@ -171,14 +172,14 @@
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupPaymentStudentCourseDetail"
             parameterType="map">
-        SELECT * FROM music_group_payment_student_course_detail ORDER BY id_
+        SELECT * FROM music_group_payment_student_course_detail where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM music_group_payment_student_course_detail
+        FROM music_group_payment_student_course_detail where tenant_id_ = #{tenantId}
     </select>
 
     <select id="getUnUseWithStudentAndCourseTypeAndCourseMinutes" resultMap="MusicGroupPaymentStudentCourseDetail">

+ 9 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupPerformanceMapper.xml

@@ -20,6 +20,7 @@
 		<result column="organ_name_" property="organName" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -29,13 +30,13 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupPerformance">
-		SELECT * FROM music_group_performance ORDER BY id_
+		SELECT * FROM music_group_performance where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPerformance" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_performance (music_group_id_,name_,music_score_name_,operator_,order_,start_time_,create_time_,update_time_)
-		VALUES(#{musicGroupId},#{name},#{musicScoreName},#{operator},#{order},#{startTime},NOW(),NOW())
+		INSERT INTO music_group_performance (music_group_id_,name_,music_score_name_,operator_,order_,start_time_,create_time_,update_time_,tenant_id_)
+		VALUES(#{musicGroupId},#{name},#{musicScoreName},#{operator},#{order},#{startTime},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -60,7 +61,7 @@
 		start_time_ = #{startTime},
 		</if>
 		update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -73,6 +74,7 @@
 		SELECT mgp.*,su.real_name_ operator_name_ FROM music_group_performance mgp
 		LEFT JOIN sys_user su ON  su.id_ = mgp.operator_
 		<where>
+			mgp.tenant_id_ = #{tenantId}
 			<if test="musicGroupId != null and musicGroupId != ''">
 				AND mgp.music_group_id_ = #{musicGroupId}
 			</if>
@@ -85,6 +87,7 @@
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(mgp.id_) FROM music_group_performance mgp
 		<where>
+			mgp.tenant_id_ = #{tenantId}
 			<if test="musicGroupId != null and musicGroupId != ''">
 				AND mgp.music_group_id_ = #{musicGroupId}
 			</if>
@@ -94,9 +97,7 @@
 		SELECT mgp.* FROM music_group_performance mgp
 		LEFT JOIN music_group mg ON mg.id_ = mgp.music_group_id_
 		WHERE DATEDIFF(DATE_FORMAT(start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) >= 0
-		<if test="educationUserId != null">
 			AND mg.educational_teacher_id_ = #{educationUserId}
-		</if>
 		<if test="organIds != null and organIds != ''">
 			AND FIND_IN_SET(mg.organ_id_,#{organIds})
 		</if>
@@ -106,7 +107,7 @@
 		FROM music_group_performance mgp
 		LEFT JOIN music_group mg ON mg.id_ = mgp.music_group_id_
 		LEFT JOIN organization o ON o.id_ = mg.organ_id_
-		WHERE DATEDIFF(DATE_FORMAT(mgp.start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) >= 0
+		WHERE DATEDIFF(DATE_FORMAT(mgp.start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) >= 0 and mgp.tenant_id_ = #{tenantId}
 		<if test="educationUserId != null">
 			AND mg.educational_teacher_id_ = #{educationUserId}
 		</if>
@@ -121,7 +122,7 @@
 	<select id="countNoStart" resultType="java.lang.Integer">
 		SELECT COUNT(mgp.id_) FROM music_group_performance mgp
 		LEFT JOIN music_group mg ON mg.id_ = mgp.music_group_id_
-		WHERE DATEDIFF(DATE_FORMAT(start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) >= 0
+		WHERE DATEDIFF(DATE_FORMAT(start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) >= 0 and mgp.tenant_id_ = #{tenantId}
 		<if test="educationUserId != null">
 			AND mg.educational_teacher_id_ = #{educationUserId}
 		</if>

+ 11 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupPurchaseListMapper.xml

@@ -13,6 +13,7 @@
         <result column="purchase_num_" property="purchaseNum"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -25,7 +26,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroupPurchaseList">
         SELECT *
-        FROM music_group_purchase_list
+        FROM music_group_purchase_list where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -37,8 +38,8 @@
         SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
         </selectKey>
         -->
-        INSERT INTO music_group_purchase_list (id_,music_group_id_,goods_id_,purchase_num_,create_time_,update_time_)
-        VALUES(#{id},#{musicGroupId},#{goodsId},#{purchaseNum},now(),now())
+        INSERT INTO music_group_purchase_list (id_,music_group_id_,goods_id_,purchase_num_,create_time_,update_time_,tenant_id_)
+        VALUES(#{id},#{musicGroupId},#{goodsId},#{purchaseNum},now(),now(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -58,7 +59,7 @@
                 goods_id_ = #{goodsId},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -72,8 +73,9 @@
     <select id="queryPage" resultMap="MusicGroupPurchaseList" parameterType="map">
         SELECT * FROM music_group_purchase_list
         <where>
+        	tenant_id_ = #{tenantId}
             <if test="musicGroupId != null">
-                music_group_id_ = #{musicGroupId}
+                and music_group_id_ = #{musicGroupId}
             </if>
         </where>
         ORDER BY id_
@@ -84,18 +86,19 @@
     <select id="queryCount" resultType="int">
         SELECT COUNT(*) FROM music_group_purchase_list
         <where>
+        	tenant_id_ = #{tenantId}
             <if test="musicGroupId != null">
-                music_group_id_ = #{musicGroupId}
+                and music_group_id_ = #{musicGroupId}
             </if>
         </where>
     </select>
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPurchaseList" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-        INSERT INTO music_group_purchase_list (id_,music_group_id_,goods_id_,purchase_num_,create_time_,update_time_)
+        INSERT INTO music_group_purchase_list (id_,music_group_id_,goods_id_,purchase_num_,create_time_,update_time_,tenant_id_)
         VALUES
         <foreach collection="musicGroupPurchaseLists" item="item" index="index" separator=",">
-            (#{item.id},#{item.musicGroupId},#{item.goodsId},#{item.purchaseNum},now(),now())
+            (#{item.id},#{item.musicGroupId},#{item.goodsId},#{item.purchaseNum},now(),now(),#{item.tenantId})
         </foreach>
     </insert>
 

+ 5 - 3
mec-biz/src/main/resources/config/mybatis/MusicGroupQuestionnaireMapper.xml

@@ -16,6 +16,7 @@
 		<result column="question_time_" property="questionTime" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -27,13 +28,13 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupQuestionnaire">
-		SELECT * FROM music_group_questionnaire ORDER BY id_
+		SELECT * FROM music_group_questionnaire where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupQuestionnaire" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_questionnaire (questionnaire_topic_id_,music_group_id_,target_,operator_id_,question_time_,create_time_,update_time_)
-		VALUES(#{questionnaireTopicId},#{musicGroupId},#{target},#{operatorId},#{questionTime},NOW(),NOW())
+		INSERT INTO music_group_questionnaire (questionnaire_topic_id_,music_group_id_,target_,operator_id_,question_time_,create_time_,update_time_,tenant_id_)
+		VALUES(#{questionnaireTopicId},#{musicGroupId},#{target},#{operatorId},#{questionTime},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -73,6 +74,7 @@
 	</select>
 	<sql id="queryPageSql">
 		<where>
+			mgq.tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				AND mgq.music_group_id_ = #{search}
 			</if>

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

@@ -6,6 +6,7 @@
     <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupQuit"
                id="MusicGroupQuit">
         <result column="id_" property="id"/>
+        <result column="tenant_id_" property="tenantId"/>
         <result column="user_id_" property="userId"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="join_date_" property="joinDate"/>
@@ -40,7 +41,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroupQuit">
         SELECT *
-        FROM music_group_quit
+        FROM music_group_quit where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -48,9 +49,9 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupQuit"
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         INSERT INTO music_group_quit
-        (id_,user_id_,music_group_id_,join_date_,quit_date_,create_time_,reason_,user_comment_,status_,apply_user_id_,is_visit_,visit_time_,fee_json_,current_approve_role_,return_total_fee_)
+        (id_,user_id_,music_group_id_,join_date_,quit_date_,create_time_,reason_,user_comment_,status_,apply_user_id_,is_visit_,visit_time_,fee_json_,current_approve_role_,return_total_fee_,tenant_id_)
         VALUES(#{id},#{userId},#{musicGroupId},#{joinDate},#{quitDate},#{createTime},#{reason},#{userComment},
-        #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{applyUserId},#{isVisit},#{visitTime},#{feeJson},#{currentApproveRole},#{returnTotalFee})
+        #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{applyUserId},#{isVisit},#{visitTime},#{feeJson},#{currentApproveRole},#{returnTotalFee},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -97,7 +98,7 @@
                 status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -121,6 +122,7 @@
     </select>
     <sql id="queryPageSql">
         <where>
+        	tenant_id_ = #{tenantId}
             <if test="ids != null and ids != ''">
                 AND FIND_IN_SET(mgq.id_,#{ids})
             </if>

+ 8 - 7
mec-biz/src/main/resources/config/mybatis/MusicGroupSchoolTermCourseDetailMapper.xml

@@ -16,6 +16,7 @@
 		<result column="total_course_time_" property="totalCourseTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="create_time_" property="createTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -25,14 +26,14 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupSchoolTermCourseDetail">
-		SELECT * FROM music_group_school_term_course_detail ORDER BY id_
+		SELECT * FROM music_group_school_term_course_detail where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupSchoolTermCourseDetail" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_school_term_course_detail (music_group_id_,start_course_date_,start_school_term_,
-	   end_school_term_,course_flag_,total_course_time_,update_time_,create_time_)
-	   VALUES(#{musicGroupId},#{startCourseDate},#{startSchoolTerm},#{endSchoolTerm},#{courseFlag},#{totalCourseTime},NOW(),NOW())
+	   end_school_term_,course_flag_,total_course_time_,update_time_,create_time_,tenant_id_)
+	   VALUES(#{musicGroupId},#{startCourseDate},#{startSchoolTerm},#{endSchoolTerm},#{courseFlag},#{totalCourseTime},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -57,7 +58,7 @@
 			music_group_id_ = #{musicGroupId},
 		</if>
 			update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -67,12 +68,12 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupSchoolTermCourseDetail" parameterType="map">
-		SELECT * FROM music_group_school_term_course_detail ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM music_group_school_term_course_detail where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_school_term_course_detail
+		SELECT COUNT(*) FROM music_group_school_term_course_detail where tenant_id_ = #{tenantId}
 	</select>
 	<select id="findByMusicGroupId" resultMap="MusicGroupSchoolTermCourseDetail">
 		SELECT * FROM music_group_school_term_course_detail
@@ -93,7 +94,7 @@
 		WHERE course_flag_ = 0
 	</select>
     <select id="queryPushCourseTermMusicIds" resultType="java.lang.String">
-		SELECT music_group_id_ FROM music_group_school_term_course_detail
+		SELECT music_group_id_ FROM music_group_school_term_course_detail where tenant_id_ = #{tenantId}
 		GROUP BY music_group_id_ HAVING DATEDIFF(MAX(end_school_term_),NOW()) = #{remindCourseTime}
 	</select>
 </mapper>

+ 9 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupSchoolTermStudentCourseDetailMapper.xml

@@ -16,6 +16,7 @@
 		<result column="single_course_minutes_" property="singleCourseMinutes" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -25,22 +26,22 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupSchoolTermStudentCourseDetail">
-		SELECT * FROM music_group_school_term_student_course_detail ORDER BY id_
+		SELECT * FROM music_group_school_term_student_course_detail where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupSchoolTermStudentCourseDetail" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_school_term_student_course_detail
 		    (music_group_school_term_course_detail_id_,user_id_,member_course_minutes_,
-		   pre_member_course_minutes_,mix_course_minutes_,single_course_minutes_,create_time_,update_time_)
-		   VALUES(#{musicGroupSchoolTermCourseDetailId},#{userId},#{memberCourseMinutes},#{preMemberCourseMinutes},#{mixCourseMinutes},#{singleCourseMinutes},NOW(),NOW())
+		   pre_member_course_minutes_,mix_course_minutes_,single_course_minutes_,create_time_,update_time_,tenant_id_)
+		   VALUES(#{musicGroupSchoolTermCourseDetailId},#{userId},#{memberCourseMinutes},#{preMemberCourseMinutes},#{mixCourseMinutes},#{singleCourseMinutes},NOW(),NOW(),#{tenantId})
 	</insert>
 	<insert id="init">
 		INSERT INTO music_group_school_term_student_course_detail
-		(music_group_school_term_course_detail_id_,user_id_,member_course_minutes_,create_time_,update_time_)
+		(music_group_school_term_course_detail_id_,user_id_,member_course_minutes_,create_time_,update_time_,tenant_id_)
 		VALUES
 		<foreach collection="studentIds" item="userId" separator=",">
-			(#{studentCourseDetail.musicGroupSchoolTermCourseDetailId},#{userId},#{studentCourseDetail.memberCourseMinutes},NOW(),NOW())
+			(#{studentCourseDetail.musicGroupSchoolTermCourseDetailId},#{userId},#{studentCourseDetail.memberCourseMinutes},NOW(),NOW(),#{tenantId})
 		</foreach>
 	</insert>
 
@@ -66,7 +67,7 @@
 			pre_member_course_minutes_ = #{preMemberCourseMinutes},
 		</if>
 			update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
     <update id="updateMinutes">
 		UPDATE music_group_school_term_student_course_detail SET pre_member_course_minutes_ = #{preMemberCourseMinutes} + pre_member_course_minutes_,
@@ -105,12 +106,12 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupSchoolTermStudentCourseDetail" parameterType="map">
-		SELECT * FROM music_group_school_term_student_course_detail ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM music_group_school_term_student_course_detail where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_school_term_student_course_detail
+		SELECT COUNT(*) FROM music_group_school_term_student_course_detail where tenant_id_ = #{tenantId}
 	</select>
 
 	<select id="getMixCourseMinutes" resultType="java.lang.Integer">

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/MusicGroupStudentClassAdjustMapper.xml

@@ -25,6 +25,7 @@
 		<result column="master_class_group_id_" property="masterClassGroupId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -34,17 +35,17 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MusicGroupStudentClassAdjust">
-		SELECT * FROM music_group_student_class_adjust ORDER BY id_
+		SELECT * FROM music_group_student_class_adjust where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_student_class_adjust (music_group_id_,batch_no_,new_class_group_json_,
 		class_group_ids_,student_ids_,class_course_minute_,all_lock_course_ids_,sub_lock_course_ids_,
-		operator_id_,student_payment_ids_,class_group_students_,default_course_type_minute_,master_class_group_id_,master_class_course_times_,master_total_price_,create_time_,update_time_)
+		operator_id_,student_payment_ids_,class_group_students_,default_course_type_minute_,master_class_group_id_,master_class_course_times_,master_total_price_,create_time_,update_time_,tenant_id_)
 		VALUES(#{musicGroupId},#{batchNo},#{newClassGroupJson},#{classGroupIds},#{studentIds},
 		#{classCourseMinute},#{allLockCourseIds},#{subLockCourseIds},#{operatorId},#{studentPaymentIds},#{classGroupStudents},
-			   #{defaultCourseTypeMinute},#{masterClassGroupId},#{masterClassCourseTimes},#{masterTotalPrice},NOW(),NOW())
+			   #{defaultCourseTypeMinute},#{masterClassGroupId},#{masterClassCourseTimes},#{masterTotalPrice},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -93,7 +94,7 @@
 		music_group_id_ = #{musicGroupId},
 		</if>
 		update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -103,12 +104,12 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupStudentClassAdjust" parameterType="map">
-		SELECT * FROM music_group_student_class_adjust ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM music_group_student_class_adjust where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_student_class_adjust
+		SELECT COUNT(*) FROM music_group_student_class_adjust where tenant_id_ = #{tenantId}
 	</select>
     <select id="findByBatchNo" resultMap="MusicGroupStudentClassAdjust">
 		SELECT * FROM music_group_student_class_adjust WHERE FIND_IN_SET(#{batchNo},batch_no_)

+ 7 - 12
mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml

@@ -8,6 +8,7 @@
 
     <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupStudentFee" id="MusicGroupStudentFee">
         <result column="id_" property="id"/>
+        <result column="tenant_id_" property="tenantId"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="user_id_" property="userId"/>
         <result column="subject_id_" property="subjectId"/>
@@ -36,7 +37,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroupStudentFee">
-		SELECT * FROM music_group_student_fee_ ORDER BY id_
+		SELECT * FROM music_group_student_fee_ where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -44,19 +45,19 @@
             keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_student_fee_ (id_,music_group_id_,user_id_,course_fee_,create_time_,
 		update_time_,next_payment_date_,latest_paid_time_,continuous_absenteeism_times_,subject_id_,
-		payment_status_,temporary_course_fee_,payment_period_list_,remain_network_class_times_)
+		payment_status_,temporary_course_fee_,payment_period_list_,remain_network_class_times_,tenant_id_)
 		VALUES(#{id},#{musicGroupId},#{userId},#{courseFee},now(),now(),#{nextPaymentDate},#{latestPaidTime},
 		#{continuousAbsenteeismTimes},#{subjectId},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-		#{temporaryCourseFee},#{paymentPeriodList},#{remainNetworkClassTimes})
+		#{temporaryCourseFee},#{paymentPeriodList},#{remainNetworkClassTimes},#{tenantId})
 	</insert>
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentFee">
         INSERT INTO music_group_student_fee_ (music_group_id_,user_id_,create_time_,update_time_,next_payment_date_,
-        subject_id_,payment_status_,course_fee_,payment_period_list_,remain_network_class_times_)
+        subject_id_,payment_status_,course_fee_,payment_period_list_,remain_network_class_times_,tenant_id_)
 		VALUES
 		<foreach collection="musicGroupStudentFees" item="item" separator=",">
             (#{item.musicGroupId},#{item.userId},NOW(),NOW(),#{nextPaymentDate},#{item.subjectId},
-            #{paymentStatus},#{item.courseFee},#{item.paymentPeriodList},#{item.remainNetworkClassTimes})
+            #{paymentStatus},#{item.courseFee},#{item.paymentPeriodList},#{item.remainNetworkClassTimes},#{item.tenantId})
         </foreach>
     </insert>
 
@@ -104,7 +105,7 @@
                 payment_period_list_ = #{paymentPeriodList},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
     
     <update id="updateStudentAbsenteeismTimes">
@@ -180,12 +181,6 @@
         update music_group_student_fee_ set next_payment_date_ = #{nextPaymentDate},update_time_ = now() WHERE music_group_id_ = #{musicGroupId}
     </update>
 
-    <select id="queryWillRenewList" resultMap="MusicGroupStudentFee">
-        SELECT * FROM music_group_student_fee_
-        WHERE next_payment_date_ IS NOT NULL AND payment_status_ = 'PAID_COMPLETED'
-        and date_add(now(), interval #{days} day) >= next_payment_date_
-    </select>
-
     <select id="countContinuosAbsenteeismStudentNum" resultType="java.util.Map">
         SELECT
             music_group_id_ AS 'key',

+ 9 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectGoodsGroupMapper.xml

@@ -20,6 +20,7 @@
         <result column="group_remission_course_fee_" property="groupRemissionCourseFee"/>
         <result column="kit_group_purchase_type_json_" property="kitGroupPurchaseTypeJson"/>
         <result column="course_purchase_type_json_" property="coursePurchaseTypeJson"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -31,7 +32,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroupSubjectGoodsGroup">
         SELECT *
-        FROM music_group_subject_goods_group
+        FROM music_group_subject_goods_group where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -40,16 +41,16 @@
             parameterType="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup"
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         INSERT INTO music_group_subject_goods_group
-        (id_,name_,type_,music_group_id_,subject_id_,goods_id_list_,create_time_,update_time_,price_,deposit_fee_,remission_course_fee_,kit_group_purchase_type_json_,course_purchase_type_json_)
-        VALUES(#{id},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{subjectId},#{goodsIdList},NOW(),NOW(),#{price},#{depositFee},#{remissionCourseFee},#{kitGroupPurchaseTypeJson},#{coursePurchaseTypeJson})
+        (id_,name_,type_,music_group_id_,subject_id_,goods_id_list_,create_time_,update_time_,price_,deposit_fee_,remission_course_fee_,kit_group_purchase_type_json_,course_purchase_type_json_,tenant_id_)
+        VALUES(#{id},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{subjectId},#{goodsIdList},NOW(),NOW(),#{price},#{depositFee},#{remissionCourseFee},#{kitGroupPurchaseTypeJson},#{coursePurchaseTypeJson},#{tenantId})
     </insert>
 
     <insert id="batchInsert" parameterType="java.util.List">
         INSERT INTO music_group_subject_goods_group
-        (name_,type_,music_group_id_,subject_id_,goods_id_list_,create_time_,update_time_,price_,deposit_fee_,remission_course_fee_,group_remission_course_fee_,kit_group_purchase_type_json_,course_purchase_type_json_) VALUES
+        (name_,type_,music_group_id_,subject_id_,goods_id_list_,create_time_,update_time_,price_,deposit_fee_,remission_course_fee_,group_remission_course_fee_,kit_group_purchase_type_json_,course_purchase_type_json_,tenant_id_) VALUES
         <foreach collection="lists" item="item" index="index" separator=",">
             (#{item.name},#{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{musicGroupId},#{item.subjectId},#{item.goodsIdList},now(),now(),#{item.price},#{item.depositFee},#{item.remissionCourseFee},#{item.groupRemissionCourseFee},#{item.kitGroupPurchaseTypeJson},#{item.coursePurchaseTypeJson})
+            #{musicGroupId},#{item.subjectId},#{item.goodsIdList},now(),now(),#{item.price},#{item.depositFee},#{item.remissionCourseFee},#{item.groupRemissionCourseFee},#{item.kitGroupPurchaseTypeJson},#{item.coursePurchaseTypeJson},#{item.tenantId})
         </foreach>
     </insert>
 
@@ -89,7 +90,7 @@
                 name_ = #{name},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -103,14 +104,14 @@
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupSubjectGoodsGroup"
             parameterType="map">
-        SELECT * FROM music_group_subject_goods_group ORDER BY id_
+        SELECT * FROM music_group_subject_goods_group where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM music_group_subject_goods_group
+        FROM music_group_subject_goods_group where tenant_id_ = #{tenantId}
     </select>
 
     <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup" extends="MusicGroupSubjectGoodsGroup" id="findGoodsGroupMap">

+ 9 - 8
mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectPlanMapper.xml

@@ -22,6 +22,7 @@
         <result column="update_time_" property="updateTime"/>
         <result column="version" property="version"/>
         <result column="sub_name_" property="subName"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -32,7 +33,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="MusicGroupSubjectPlan">
         SELECT *
-        FROM music_group_subject_plan
+        FROM music_group_subject_plan where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -40,16 +41,16 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO music_group_subject_plan
-        (id_,music_group_id_,subject_id_,expected_student_num_,apply_student_num_,fee_,kit_group_purchase_type_,deposit_fee_,create_time_,update_time_)
-        VALUES(#{id},#{musicGroupId},#{subjectId},#{expectedStudentNum},#{applyStudentNum},#{fee},#{kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{depositFee},now(),now())
+        (id_,music_group_id_,subject_id_,expected_student_num_,apply_student_num_,fee_,kit_group_purchase_type_,deposit_fee_,create_time_,update_time_,tenant_id_)
+        VALUES(#{id},#{musicGroupId},#{subjectId},#{expectedStudentNum},#{applyStudentNum},#{fee},#{kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{depositFee},now(),now(),#{tenantId})
     </insert>
     <insert id="batchAdd">
         INSERT INTO music_group_subject_plan
-        (music_group_id_,subject_id_,expected_student_num_,fee_,kit_group_purchase_type_,deposit_fee_,create_time_,update_time_)
+        (music_group_id_,subject_id_,expected_student_num_,fee_,kit_group_purchase_type_,deposit_fee_,create_time_,update_time_,tenant_id_)
         VALUES
         <foreach collection="subjectPlans" item="item" separator=",">
             (#{musicGroupId},#{item.subjectId},#{item.expectedStudentNum},#{item.fee},#{item.kitGroupPurchaseType},
-            #{item.depositFee},now(),now())
+            #{item.depositFee},now(),now(),#{tenantId})
         </foreach>
     </insert>
 
@@ -92,7 +93,7 @@
                 version = version+1,
             </if>
         </set>
-        WHERE id_ = #{id} AND version =#{version}
+        WHERE id_ = #{id} AND version =#{version} and tenant_id_ = #{tenantId}
     </update>
 
     <update id="updateExpectedStudentNum">
@@ -122,14 +123,14 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupSubjectPlan" parameterType="map">
-        SELECT * FROM music_group_subject_plan ORDER BY id_
+        SELECT * FROM music_group_subject_plan where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM music_group_subject_plan
+        FROM music_group_subject_plan where tenant_id_ = #{tenantId}
     </select>
 
     <!-- 查询乐团科目计划表 -->

+ 11 - 7
mec-biz/src/main/resources/config/mybatis/MusicGroupTrainPlanMapper.xml

@@ -16,6 +16,7 @@
 		<result column="end_school_term_" property="endSchoolTerm" />
 		<result column="update_time_" property="updateTime" />
 		<result column="create_time_" property="createTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -27,6 +28,7 @@
 	<select id="findAll" resultMap="MusicGroupTrainPlan">
 		SELECT * FROM music_group_train_plan
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="classGroupId != null">
 				AND class_group_id_ = #{classGroupId}
 			</if>
@@ -45,6 +47,7 @@
 	<select id="findAllPlan" resultType="java.lang.String">
 		SELECT plan_ FROM music_group_train_plan
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="classGroupId != null">
 				AND class_group_id_ = #{classGroupId}
 			</if>
@@ -63,14 +66,14 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupTrainPlan" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_train_plan (music_group_id_,class_group_id_,course_type_,plan_,start_school_term_,end_school_term_,update_time_,create_time_)
-		VALUES(#{musicGroupId},#{classGroupId},#{courseType},#{plan},#{startSchoolTerm},#{endSchoolTerm},NOW(),NOW())
+		INSERT INTO music_group_train_plan (music_group_id_,class_group_id_,course_type_,plan_,start_school_term_,end_school_term_,update_time_,create_time_,tenant_id_)
+		VALUES(#{musicGroupId},#{classGroupId},#{courseType},#{plan},#{startSchoolTerm},#{endSchoolTerm},NOW(),NOW(),#{tenantId})
 	</insert>
     <insert id="add">
-		INSERT INTO music_group_train_plan (music_group_id_,class_group_id_,course_type_,plan_,start_school_term_,end_school_term_,update_time_,create_time_)
+		INSERT INTO music_group_train_plan (music_group_id_,class_group_id_,course_type_,plan_,start_school_term_,end_school_term_,update_time_,create_time_,tenant_id_)
 		VALUES
 		<foreach collection="dto.plans" separator="," item="plan">
-			(#{dto.musicGroupId},#{dto.classGroupId},#{dto.courseScheduleType},#{plan},#{dto.startSchoolTerm},#{dto.endSchoolTerm},NOW(),NOW())
+			(#{dto.musicGroupId},#{dto.classGroupId},#{dto.courseScheduleType},#{plan},#{dto.startSchoolTerm},#{dto.endSchoolTerm},NOW(),NOW(),#{tenantId})
 		</foreach>
 	</insert>
 
@@ -96,7 +99,7 @@
 		music_group_id_ = #{musicGroupId},
 		</if>
 		update_time_ = NOW(),
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -106,12 +109,12 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupTrainPlan" parameterType="map">
-		SELECT * FROM music_group_train_plan ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM music_group_train_plan where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM music_group_train_plan
+		SELECT COUNT(*) FROM music_group_train_plan where tenant_id_ = #{tenantId}
 	</select>
 	<resultMap id="WaitCourseTrainPlanDto" type="com.ym.mec.biz.dal.dto.WaitCourseTrainPlanDto">
 		<result property="classGroupId" column="class_group_id_"/>
@@ -179,6 +182,7 @@
 	<select id="queryPlan" resultMap="MusicGroupTrainPlan">
 		SELECT * FROM music_group_train_plan
 		<where>
+			tenant_id_ = #{schoolTerm.tenantId}
 			<if test="schoolTerm.startSchoolTerm != null">
 				AND start_school_term_ = #{schoolTerm.startSchoolTerm}
 			</if>

+ 7 - 7
mec-biz/src/main/resources/config/mybatis/OperatingReportMapper.xml

@@ -22,13 +22,14 @@
         <result column="profit_" property="profit"/>
         <result column="month_" property="month"/>
         <result column="create_time_" property="createTime"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
         id_, organ_id_, cooperation_organ_id_, sell_amount_, service_amount_,other_income_, refund_amount_,
         income_total_,
         sell_cost_, expenses_amount_, variable_cost_, distribution_amount_, cost_amount_,
-        profit_, month_, create_time_
+        profit_, month_, create_time_,tenant_id_
     </sql>
     <select id="get" parameterType="java.lang.Integer" resultMap="OperatingReport">
         <!--@mbg.generated-->
@@ -48,10 +49,10 @@
         insert into operating_report (organ_id_, cooperation_organ_id_, sell_amount_, service_amount_,other_income_,
         refund_amount_,
         income_total_, sell_cost_, expenses_amount_, variable_cost_, distribution_amount_,
-        cost_amount_, profit_, month_, create_time_)
+        cost_amount_, profit_, month_, create_time_,tenant_id_)
         values (#{organId}, #{cooperationOrganId}, #{sellAmount}, #{serviceAmount},#{otherIncome}, #{refundAmount},
         #{incomeTotal}, #{sellCost}, #{expensesAmount}, #{variableCost}, #{distributionAmount},
-        #{costAmount}, #{profit}, #{month}, #{createTime})
+        #{costAmount}, #{profit}, #{month}, #{createTime},#{tenantId})
     </insert>
 
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.OperatingReport">
@@ -104,7 +105,7 @@
                 create_time_ = #{createTime},
             </if>
         </set>
-        where id_ = #{id}
+        where id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
 
@@ -126,6 +127,7 @@
 
     <sql id="queryPageSql">
         <where>
+        	opr.tenant_id_ = #{tenantId}
             <if test="organIdList != null and organIdList != ''">
                 AND FIND_IN_SET(opr.organ_id_,#{organIdList})
             </if>
@@ -149,9 +151,7 @@
     <select id="getReport" resultMap="OperatingReport" parameterType="map">
         SELECT * FROM operating_report
         <where>
-            <if test="organId != null">
-                AND organ_id_ = #{organId}
-            </if>
+        	organ_id_ = #{organId}
             <if test="cooperationOrganId != null">
                 AND cooperation_organ_id_ = #{cooperationOrganId}
             </if>

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

@@ -10,6 +10,7 @@
         <result column="plus_price_" property="plusPrice"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
         <result column="organName" property="organName"/>
     </resultMap>
 
@@ -23,7 +24,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="OrganizationCloudTeacherFee">
         SELECT *
-        FROM organization_cloud_teacher_fee
+        FROM organization_cloud_teacher_fee where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -31,8 +32,8 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee"
             useGeneratedKeys="true" keyColumn="id_" keyProperty="id">
         INSERT INTO organization_cloud_teacher_fee
-            (organ_id_, price_,plus_price_, create_time_, update_time_)
-        VALUES (#{organId}, #{price},#{plusPrice}, NOW(), NOW())
+            (organ_id_, price_,plus_price_, create_time_, update_time_,tenant_id_)
+        VALUES (#{organId}, #{price},#{plusPrice}, NOW(), NOW(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -47,7 +48,7 @@
             </if>
             update_time_=NOW()
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -74,6 +75,7 @@
 
     <sql id="queryPageSql">
         <where>
+        	octf.tenant_id_ = #{tenantId}
             <if test="organId != null">
                 AND FIND_IN_SET(octf.organ_id_,#{organId})
             </if>

+ 7 - 4
mec-biz/src/main/resources/config/mybatis/OrganizationCourseDurationSettingsMapper.xml

@@ -11,6 +11,7 @@
         <result column="duration_" property="duration"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
         <result column="organ_name_" property="organ.name"/>
     </resultMap>
 
@@ -24,7 +25,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="OrganizationCourseDurationSettings">
         SELECT *
-        FROM organization_course_duration_settings
+        FROM organization_course_duration_settings where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -34,8 +35,8 @@
         <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
             AS ID FROM DUAL </selectKey> -->
         INSERT INTO organization_course_duration_settings
-        (id_,organ_id_,course_type_,duration_,create_time_,update_time_)
-        VALUES(#{id},#{organId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{duration},now(),now())
+        (id_,organ_id_,course_type_,duration_,create_time_,update_time_,tenant_id_)
+        VALUES(#{id},#{organId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{duration},now(),now(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -61,7 +62,7 @@
                 update_time_ = #{updateTime},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -76,6 +77,7 @@
         SELECT ocds.*,o.name_ organ_name_ FROM organization_course_duration_settings ocds
         LEFT JOIN organization o on ocds.organ_id_ = o.id_
         <where>
+        	ocds.tenant_id_ = #{tenantId}
             <if test="organId != null">
                 and ocds.organ_id_ = #{organId}
             </if>
@@ -91,6 +93,7 @@
     <select id="queryCount" resultType="int">
         SELECT COUNT(ups.id_) FROM organization_course_duration_settings ups
         <where>
+        	ups.tenant_id_ = #{tenantId}
             <if test="organId != null">
                 and ups.organ_id_ = #{organId}
             </if>

+ 9 - 6
mec-biz/src/main/resources/config/mybatis/OrganizationCourseUnitPriceSettingsMapper.xml

@@ -11,6 +11,7 @@
 		<result column="unit_price_" property="unitPrice" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 		<result column="organ_name_" property="organ.name" />
 		<result column="charge_type_name_" property="chargeType.name" />
 	</resultMap>
@@ -22,7 +23,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="OrganizationCourseUnitPriceSettings">
-		SELECT * FROM organization_course_unit_price_settings ORDER BY id_
+		SELECT * FROM organization_course_unit_price_settings where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -30,16 +31,16 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO organization_course_unit_price_settings
-		(id_,organ_id_,course_type_,charge_type_id_,unit_price_,create_time_,update_time_)
-		VALUES(#{id},#{organId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{chargeTypeId},#{unitPrice},now(),now())
+		(id_,organ_id_,course_type_,charge_type_id_,unit_price_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{organId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{chargeTypeId},#{unitPrice},now(),now(),#{tenantId})
 	</insert>
 	
 	<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO organization_course_unit_price_settings
-		(id_,organ_id_,course_type_,charge_type_id_,unit_price_,create_time_,update_time_)
+		(id_,organ_id_,course_type_,charge_type_id_,unit_price_,create_time_,update_time_,tenant_id_)
 		VALUES
 		<foreach collection="list" item="item" separator=",">
-		(#{item.id},#{item.organId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.chargeTypeId},#{item.unitPrice},now(),now())
+		(#{item.id},#{item.organId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.chargeTypeId},#{item.unitPrice},now(),now(),#{tenantId})
 		</foreach>
 	</insert>
 
@@ -69,7 +70,7 @@
 				create_time_ = #{createTime},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -82,6 +83,7 @@
 		SELECT ups.*,o.name_ organ_name_ ,ct.name_ charge_type_name_ FROM organization_course_unit_price_settings ups left join organization o on ups.organ_id_ = o.id_
 		left join charge_type ct on ct.id_ = ups.charge_type_id_
 		<where>
+			ups.tenant_id_ = #{tenantId}
 			<if test="organId != null">
 				and ups.organ_id_ = #{organId}
 			</if>
@@ -100,6 +102,7 @@
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(ups.id_) FROM organization_course_unit_price_settings ups
 		<where>
+			ups.tenant_id_ = #{tenantId}
 			<if test="organId != null">
 				and ups.organ_id_ = #{organId}
 			</if>

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

@@ -14,6 +14,7 @@
         <result column="theory_" property="theory"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
     <select id="get" parameterType="java.lang.Integer" resultMap="OrganizationDegreeCourseFee">
         <!--@mbg.generated-->
@@ -30,9 +31,9 @@
             parameterType="com.ym.mec.biz.dal.entity.OrganizationDegreeCourseFee" useGeneratedKeys="true">
         <!--@mbg.generated-->
         insert into organization_degree_course_fee (organ_id_,original_vip_1v1_,original_vip_1v2_, vip_1v1_,
-        vip_1v2_,theory_, create_time_, update_time_)
+        vip_1v2_,theory_, create_time_, update_time_, tenant_id_)
         values (#{organId},#{originalVip1v1},#{originalVip1v2}, #{vip1v1},#{vip1v2}, #{theory}, #{createTime},
-        #{updateTime})
+        #{updateTime},#{tenantId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.OrganizationDegreeCourseFee">
         <!--@mbg.generated-->
@@ -63,7 +64,7 @@
                 update_time_ = #{updateTime},
             </if>
         </set>
-        where id_ = #{id}
+        where id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <select id="getByOrganId" resultMap="OrganizationDegreeCourseFee">

+ 5 - 10
mec-biz/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -37,7 +37,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="Organization">
-		SELECT * FROM organization ORDER BY id_
+		SELECT * FROM organization where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -92,7 +92,7 @@
                 grade_type_ = #{gradeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -102,6 +102,7 @@
 
     <sql id="queryPageSql">
         <where>
+        	o.tenant_id_ = #{tenantId}
             <if test="delFlag != null">
                 and o.del_flag_ = #{delFlag,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
@@ -138,9 +139,7 @@
         SELECT * FROM organization o
         <where>
             o.del_flag_ = 0
-            <if test="userId != null">
                 AND FIND_IN_SET(o.id_,(SELECT GROUP_CONCAT(organ_id_list_) FROM employee e WHERE e.user_id_ = #{userId}))
-            </if>
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(o.id_,#{organId})
             </if>
@@ -163,7 +162,7 @@
     </select>
     
     <select id="findAllOrgans" resultMap="Organization">
-        SELECT * from organization where del_flag_=0 ORDER BY id_ ASC;
+        SELECT * from organization where del_flag_=0 and tenant_id_ = #{tenantId} ORDER BY id_ ASC;
     </select>
 
     <select id="findOrgans" resultMap="Organization">
@@ -175,7 +174,7 @@
 
     <select id="getOrgans" resultMap="Organization">
         SELECT * FROM organization
-        WHERE 1=1
+        WHERE tenant_id_ = #{tenantId}
          <if test="organIds!=null and organIds.size()>0">
              AND id_ IN
              <foreach collection="organIds" item="organId" separator="," open="(" close=")">
@@ -184,8 +183,4 @@
          </if>
     </select>
 
-    <select id="getActivityOrgans" resultMap="Organization">
-        SELECT o.* FROM practice_group_sell_price pgsp
-        LEFT JOIN organization o ON pgsp.organ_id_=o.id_
-    </select>
 </mapper>

+ 5 - 4
mec-biz/src/main/resources/config/mybatis/PageMonitorMapper.xml

@@ -15,6 +15,7 @@
         <result property="eventName" column="event_name_"/>
         <result property="pageName" column="page_name_"/>
         <result property="pageUrl" column="page_url_"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -24,7 +25,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="PageMonitor">
-		SELECT * FROM page_monitor ORDER BY id_
+		SELECT * FROM page_monitor where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
     <select id="findByUserIdAndEvent" resultMap="PageMonitor">
         SELECT * FROM page_monitor WHERE user_id_ = #{userId} AND event_ = #{event} LIMIT 1 FOR UPDATE
@@ -33,8 +34,8 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.PageMonitor" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO page_monitor (page_name_,page_url_,event_,event_name_,user_id_,times_,update_time_)
-        VALUES(#{pageName},#{pageUrl},#{event},#{eventName},#{userId},#{times},NOW())
+        INSERT INTO page_monitor (page_name_,page_url_,event_,event_name_,user_id_,times_,update_time_,tenant_id_)
+        VALUES(#{pageName},#{pageUrl},#{event},#{eventName},#{userId},#{times},NOW(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -63,6 +64,6 @@
                 update_time_ = #{updateTime}
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 </mapper>

+ 7 - 5
mec-biz/src/main/resources/config/mybatis/PhotoAlbumMapper.xml

@@ -18,6 +18,7 @@
 		<result column="time_line_" property="timeLine" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -27,14 +28,14 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="PhotoAlbum">
-		SELECT * FROM photo_album_ ORDER BY id_
+		SELECT * FROM photo_album_ where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.PhotoAlbum" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO photo_album_ (music_group_id_,name_,client_show_,type_,cover_url_,cover_thumbnail_url_,create_time_,update_time_,order_,time_line_)
+		INSERT INTO photo_album_ (music_group_id_,name_,client_show_,type_,cover_url_,cover_thumbnail_url_,create_time_,update_time_,order_,time_line_,tenant_id_)
 		VALUES(#{musicGroupId},#{name},#{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-		       #{type},#{coverUrl},#{coverThumbnailUrl},NOW(),NOW(),#{order},#{timeLine})
+		       #{type},#{coverUrl},#{coverThumbnailUrl},NOW(),NOW(),#{order},#{timeLine},#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -65,7 +66,7 @@
 			name_ = #{name},
 		</if>
 			update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	<update id="batchUpdate">
 		<foreach collection="photoAlbumList" item="album" separator=";">
@@ -95,7 +96,7 @@
 				name_ = #{album.name},
 			</if>
 			update_time_ = NOW()
-		</set> WHERE id_ = #{album.id}
+		</set> WHERE id_ = #{album.id} and tenant_id_ = #{album.tenantId}
 		</foreach>
 	</update>
 
@@ -116,6 +117,7 @@
 	</select>
 	<sql id="queryPageSql">
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="timeLine != null and timeLine != ''">
 				AND DATE_FORMAT(time_line_,"%Y%m") = #{timeLine}
 			</if>

+ 9 - 7
mec-biz/src/main/resources/config/mybatis/PhotoMapper.xml

@@ -16,6 +16,7 @@
 		<result column="order_" property="order" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -25,20 +26,20 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="Photo">
-		SELECT * FROM photo_ ORDER BY id_
+		SELECT * FROM photo_ where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Photo" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO photo_ (photo_album_id_,name_,client_show_,url_,thumbnail_url_,create_time_,update_time_,order_)
-		VALUES(#{photoAlbumId},#{name},#{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{url},#{thumbnailUrl},NOW(),NOW(),#{order})
+		INSERT INTO photo_ (photo_album_id_,name_,client_show_,url_,thumbnail_url_,create_time_,update_time_,order_,tenant_id_)
+		VALUES(#{photoAlbumId},#{name},#{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{url},#{thumbnailUrl},NOW(),NOW(),#{order},#{tenantId})
 	</insert>
 	<insert id="batchInsert">
-		INSERT INTO photo_ (photo_album_id_,name_,client_show_,url_,thumbnail_url_,create_time_,update_time_,order_)
+		INSERT INTO photo_ (photo_album_id_,name_,client_show_,url_,thumbnail_url_,create_time_,update_time_,order_,tenant_id_)
 		VALUES
 		<foreach collection="photoList" item="photo" separator=",">
 			(#{photo.photoAlbumId},#{photo.name},#{photo.clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-			 #{photo.url},#{photo.thumbnailUrl},NOW(),NOW(),#{photo.order})
+			 #{photo.url},#{photo.thumbnailUrl},NOW(),NOW(),#{photo.order},#{photo.tenantId})
 		</foreach>
 	</insert>
 
@@ -64,7 +65,7 @@
 		name_ = #{name},
 		</if>
 		update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
     <update id="batchUpdate">
 		<foreach collection="photoList" item="item" separator=";">
@@ -88,7 +89,7 @@
 				name_ = #{item.name},
 			</if>
 			update_time_ = NOW()
-		</set> WHERE id_ = #{item.id}
+		</set> WHERE id_ = #{item.id} and tenant_id_ = #{item.tenantId}
 		</foreach>
 	</update>
 
@@ -112,6 +113,7 @@
 	</select>
 	<sql id="queryPageSql">
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="photoAlbumId != null">
 				AND photo_album_id_ = #{photoAlbumId}
 			</if>

+ 11 - 13
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -20,6 +20,7 @@
         <result column="courses_expire_date_" property="coursesExpireDate"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
         <result column="memo_" property="memo"/>
         <result column="buy_months_" property="buyMonths"/>
         <result column="drill_times_on_week_" property="drillTimesOnWeek"/>
@@ -127,7 +128,7 @@
             </if>
             update_time_ = NOW()
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <update id="batchUpdate">
@@ -162,7 +163,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="PracticeGroup">
         SELECT *
-        FROM practice_group
+        FROM practice_group where tenant_id_ = #{tenantId}
     </select>
 
     <!-- 向数据库增加一条记录 -->
@@ -191,14 +192,14 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="PracticeGroup" parameterType="map">
-        SELECT * FROM practice_group
+        SELECT * FROM practice_group where tenant_id_ = #{tenantId}
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM practice_group
+        FROM practice_group where tenant_id_ = #{tenantId}
     </select>
     <select id="getUserPracticeCoursesWithDateRange" resultMap="PracticeGroup">
         SELECT *
@@ -227,9 +228,6 @@
         GROUP BY pg.id_ ORDER BY pg.id_ DESC
         <include refid="global.limit"/>
     </select>
-    <select id="countPracticeGroupOverCourse" resultType="java.util.Map">
-
-    </select>
 
     <select id="findUserLatestPracticeGroup" resultMap="PracticeGroup">
         SELECT *
@@ -293,6 +291,7 @@
 
     <sql id="practiceGroupQueryCondition">
         <where>
+        	pg.tenant_id_ = #{tenantId}
             <if test="hasEducationalTeacherId != null and hasEducationalTeacherId == true">
                 AND pg.educational_teacher_id_ IS NOT NULL
             </if>
@@ -371,9 +370,7 @@
     <sql id="practiceGroupReviewsQueryCondition">
         <where>
             pg.group_status_ != 'LOCK'
-            <if test="tenantId != null">
-                AND pg.tenanr_id_ = #{tenantId}
-            </if>
+            AND pg.tenanr_id_ = #{tenantId}
             <if test="month != null">
                 AND DATE_FORMAT(cse.create_time_, '%Y-%m') = #{month}
             </if>
@@ -534,6 +531,7 @@
     </select>
     <sql id="queryStudentBuysSql">
         <where>
+        	u.tenant_id_ = #{tenantId}
             <if test="search != null and search != ''">
                 (u.id_ = #{search} OR u.`username_` LIKE CONCAT('%',#{search},'%'))
             </if>
@@ -577,7 +575,7 @@
         LEFT JOIN organization o on o.id_ = pg.organ_id_
         LEFT JOIN sys_user su ON su.id_ = pg.student_id_
         left join sys_user edut ON edut.id_ = pg.educational_teacher_id_
-        WHERE pg.group_status_ IN ('NORMAL','FINISH')
+        WHERE pg.group_status_ IN ('NORMAL','FINISH') and pg.tenant_id_ = #{tenantId}
         <if test="organIds != null and organIds != ''">
             AND FIND_IN_SET(pg.organ_id_, #{organIds})
         </if>
@@ -590,7 +588,7 @@
         FROM
             sys_user su
         WHERE
-            1=1
+            su.tenant_id_ = #{tenantId}
             AND su.del_flag_=0 AND su.lock_flag_=0
 			AND FIND_IN_SET('STUDENT',su.user_type_)
             <if test="organIdList!=null">
@@ -611,7 +609,7 @@
         FROM
             sys_user su
         WHERE
-            1=1
+            su.tenant_id_ = #{tenantId}
             AND su.del_flag_=0 AND su.lock_flag_=0
 			AND FIND_IN_SET('STUDENT',su.user_type_)
             <if test="organIdList!=null">

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/PracticeGroupSellPriceMapper.xml

@@ -24,6 +24,7 @@
 		<result column="single_class_minutes_price_" property="singleClassMinutesPrice" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -34,7 +35,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="PracticeGroupSellPrice">
-		SELECT * FROM practice_group_sell_price
+		SELECT * FROM practice_group_sell_price where tenant_id_ = #{tenantId}
 		ORDER BY id_
 	</select>
 
@@ -43,9 +44,9 @@
 		useGeneratedKeys="true" keyColumn="organ_id_" keyProperty="organId">
 		INSERT INTO practice_group_sell_price
 		(`organ_id_`, `once_original_price`, `once_activity_price`, `twice_original_price`,
-		 `twice_activity_price`, `create_time_`, `update_time_`,single_class_minutes_price_)
+		 `twice_activity_price`, `create_time_`, `update_time_`,single_class_minutes_price_,tenant_id_)
 		VALUES(#{organId},#{onceOriginalPrice},#{onceActivityPrice},#{twiceOriginalPrice},
-		       #{twiceActivityPrice},NOW(),NOW(),#{singleClassMinutesPrice})
+		       #{twiceActivityPrice},NOW(),NOW(),#{singleClassMinutesPrice},#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -69,7 +70,7 @@
 			</if>
 			update_time_=NOW
 		</set>
-		WHERE organ_id_ = #{organId}
+		WHERE organ_id_ = #{organId} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -79,12 +80,12 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="PracticeGroupSellPrice" parameterType="map">
-		SELECT * FROM practice_group_sell_price ORDER BY id_
+		SELECT * FROM practice_group_sell_price where tenant_id_ = #{tenantId} ORDER BY id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM practice_group_sell_price
+		SELECT COUNT(*) FROM practice_group_sell_price where tenant_id_ = #{tenantId}
 	</select>
 </mapper>

+ 5 - 4
mec-biz/src/main/resources/config/mybatis/PracticeLessonApplyMapper.xml

@@ -11,12 +11,13 @@
 		<result column="user_id_" property="userId" />
 		<result column="create_time_" property="createTime" />
 		<result column="memo_" property="memo" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="PracticeLessonApply">
-		SELECT * FROM practice_lesson_apply
+		SELECT * FROM practice_lesson_apply where tenant_id_ = #{tenantId}
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
@@ -26,19 +27,19 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO practice_lesson_apply (id_,user_id_,create_time_,memo_) VALUES(#{id},#{userId},#{createTime},#{memo})
+		INSERT INTO practice_lesson_apply (id_,user_id_,create_time_,memo_,tenant_id_) VALUES(#{id},#{userId},#{createTime},#{memo},#{tenantId})
 	</insert>
 	
 	
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="PracticeLessonApply" parameterType="map">
-		SELECT * FROM practice_lesson_apply <include refid="global.limit"/>
+		SELECT * FROM practice_lesson_apply where tenant_id_ = #{tenantId} <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM practice_lesson_apply
+		SELECT COUNT(*) FROM practice_lesson_apply where tenant_id_ = #{tenantId} 
 	</select>
     <select id="findByUserId" resultMap="PracticeLessonApply">
 		SELECT * FROM practice_lesson_apply WHERE user_id_ = #{userId} LIMIT 1 FOR UPDATE

+ 9 - 7
mec-biz/src/main/resources/config/mybatis/QuestionnaireQuestionItemMapper.xml

@@ -15,6 +15,7 @@
 		<result column="is_over_" property="isOver"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -26,6 +27,7 @@
 	<select id="findAll" resultMap="QuestionnaireQuestionItem">
 		SELECT * FROM questionnaire_question_item 
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="questionIdList != null and questionIdList.size > 0">
 				AND questionnaire_question_id_ IN
 				<foreach collection="questionIdList" open="(" close=")" separator="," item="item">
@@ -38,15 +40,15 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.QuestionnaireQuestionItem" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO questionnaire_question_item (questionnaire_topic_id_,questionnaire_question_id_,answer_value_,sort_,is_over_,create_time_,update_time_)
-		VALUES(#{questionnaireTopicId},#{questionnaireQuestionId},#{answerValue},#{sort},#{isOver},NOW(),NOW())
+		INSERT INTO questionnaire_question_item (questionnaire_topic_id_,questionnaire_question_id_,answer_value_,sort_,is_over_,create_time_,update_time_,tenant_id_)
+		VALUES(#{questionnaireTopicId},#{questionnaireQuestionId},#{answerValue},#{sort},#{isOver},NOW(),NOW(),#{tenantId})
 	</insert>
 
     <insert id="batchInsert" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO questionnaire_question_item (questionnaire_topic_id_,questionnaire_question_id_,answer_value_,sort_,is_over_,create_time_,update_time_)
+		INSERT INTO questionnaire_question_item (questionnaire_topic_id_,questionnaire_question_id_,answer_value_,sort_,is_over_,create_time_,update_time_,tenant_id_)
 		VALUES
 		<foreach collection="questionItemList" item="item" separator=",">
-			(#{topicId},#{questionId},#{item.answerValue},#{item.sort},#{item.isOver},NOW(),NOW())
+			(#{topicId},#{questionId},#{item.answerValue},#{item.sort},#{item.isOver},NOW(),NOW(),#{tenantId})
 		</foreach>
 	</insert>
 
@@ -65,7 +67,7 @@
 		<if test="answerValue != null">
 			answer_value_ = #{answerValue},
 		</if>
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -105,12 +107,12 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="QuestionnaireQuestionItem" parameterType="map">
-		SELECT * FROM questionnaire_question_item ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM questionnaire_question_item where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM questionnaire_question_item
+		SELECT COUNT(*) FROM questionnaire_question_item where tenant_id_ = #{tenantId}
 	</select>
     <select id="findByQuestionId" resultMap="QuestionnaireQuestionItem">
 		SELECT * FROM questionnaire_question_item WHERE questionnaire_question_id_ = #{questionId} LIMIT 1

+ 7 - 4
mec-biz/src/main/resources/config/mybatis/QuestionnaireQuestionMapper.xml

@@ -16,6 +16,7 @@
 		<result column="desc_" property="desc" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 		<collection property="questionnaireQuestionItemList" ofType="com.ym.mec.biz.dal.entity.QuestionnaireQuestionItem">
 			<result column="item_id_" property="id" />
 			<result column="item_questionnaire_topic_id_" property="questionnaireTopicId" />
@@ -41,6 +42,7 @@
 		FROM questionnaire_question qq
 		LEFT JOIN questionnaire_question_item qqi ON qq.id_ = qqi.questionnaire_question_id_
 		<where>
+			qq.tenant_id_ = #{tenantId}
 			<if test="topicId != null">
 				AND qq.questionnaire_topic_id_ = #{topicId}
 			</if>
@@ -50,8 +52,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.QuestionnaireQuestion" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO questionnaire_question (questionnaire_topic_id_,content_,type_,sort_,is_require_,desc_,create_time_,update_time_)
-		VALUES(#{questionnaireTopicId},#{content},#{type},#{sort},#{isRequire},#{desc},NOW(),NOW())
+		INSERT INTO questionnaire_question (questionnaire_topic_id_,content_,type_,sort_,is_require_,desc_,create_time_,update_time_,tenant_id_)
+		VALUES(#{questionnaireTopicId},#{content},#{type},#{sort},#{isRequire},#{desc},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -75,7 +77,7 @@
 		<if test="desc != null">
 			desc_ = #{desc},
 		</if>
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -92,6 +94,7 @@
 
 	<sql id="queryPageSql">
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="topicId != null">
 				AND questionnaire_topic_id_ = #{topicId}
 			</if>
@@ -124,7 +127,7 @@
 			qq.*
 		FROM
 			questionnaire_question qq
-		WHERE
+		WHERE qq.tennat_id_ = #{tenantId} and 
 				qq.questionnaire_topic_id_ = ( SELECT questionnaire_topic_id_ FROM questionnaire_user_result WHERE active_type_ = 'CLOUD_TEACHER_FEEDBACK' LIMIT 1 )
 		ORDER BY
 			sort_

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

@@ -15,6 +15,7 @@
 		<result column="tenant_id_" property="tenantId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -24,7 +25,7 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="QuestionnaireTopic">
-		SELECT * FROM questionnaire_topic ORDER BY id_
+		SELECT * FROM questionnaire_topic where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
@@ -61,15 +62,13 @@
 
 	<sql id="queryPageSql">
 		<where>
+			 tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				AND (id_ = #{search} OR title_ LIKE CONCAT('%',#{search},'%'))
 			</if>
 			<if test="status != null">
 				AND status_ = #{status}
 			</if>
-			<if test="tenantId != null">
-				AND tenant_id_ = #{tenantId}
-			</if>
 		</where>
 	</sql>
 	<!-- 分页查询 -->

+ 11 - 7
mec-biz/src/main/resources/config/mybatis/QuestionnaireUserResultMapper.xml

@@ -19,6 +19,7 @@
 		<result column="additional_value_" property="additionalValue" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -31,6 +32,7 @@
 		SELECT qur.* FROM questionnaire_user_result qur
 		LEFT JOIN sys_user su ON su.id_ = qur.user_id_
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="userId != null">
 				AND qur.user_id_ = #{userId}
 			</if>
@@ -47,18 +49,18 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.QuestionnaireUserResult" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO questionnaire_user_result (user_id_,questionnaire_topic_id_,questionnaire_question_id_,
-		                                       questionnaire_question_item_id_list_,additional_value_,active_type_,active_id_,create_time_,update_time_)
+		                                       questionnaire_question_item_id_list_,additional_value_,active_type_,active_id_,create_time_,update_time_,tenant_id_)
 		VALUES(#{userId},#{questionnaireTopicId},#{questionnaireQuestionId},#{questionnaireQuestionItemIdList},#{additionalValue}
-			  ,#{activeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{activeId},NOW(),NOW())
+			  ,#{activeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{activeId},NOW(),NOW(),#{tenantId})
 	</insert>
 
 	<insert id="batchInsert1">
 		INSERT INTO questionnaire_user_result (user_id_,questionnaire_topic_id_,questionnaire_question_id_,
-		questionnaire_question_item_id_list_,additional_value_,active_type_,active_id_,create_time_,update_time_)
+		questionnaire_question_item_id_list_,additional_value_,active_type_,active_id_,create_time_,update_time_,tenant_id_)
 		VALUES
 		<foreach collection="questionnaireUserResultList" item="item" separator=",">
 			(#{item.userId},#{item.questionnaireTopicId},#{item.questionnaireQuestionId},#{item.questionnaireQuestionItemIdList},#{item.additionalValue}
-			,#{item.activeType},#{item.activeId},NOW(),NOW())
+			,#{item.activeType},#{item.activeId},NOW(),NOW(),#{tenantId})
 		</foreach>
 	</insert>
 
@@ -87,7 +89,7 @@
 			additional_value_ = #{additionalValue},
 		</if>
 			update_time_ = NOW()
-	</set> WHERE id_ = #{id}
+	</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -128,12 +130,12 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="QuestionnaireUserResult" parameterType="map">
-		SELECT * FROM questionnaire_user_result ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM questionnaire_user_result where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM questionnaire_user_result
+		SELECT COUNT(*) FROM questionnaire_user_result where tenant_id_ = #{tenantId}
 	</select>
 
     <select id="countByTopicId" resultType="java.lang.Integer">
@@ -164,6 +166,7 @@
 	</resultMap>
 	<sql id="queryDetailPageSql">
 		<where>
+			 qu.tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				qu.user_id_ = #{search} OR ria.username_ LIKE CONCAT('%',#{search},'%') OR ria.mobile_no_ LIKE CONCAT('%',#{search},'%')
 			</if>
@@ -181,6 +184,7 @@
 
 	<sql id="queryDetailPageSql1">
 		<where>
+			 qu1.tenant_id_ = #{tenantId}
 			<if test="activeId != null">
 				AND qu1.active_id_ = #{activeId}
 			</if>

+ 8 - 6
mec-biz/src/main/resources/config/mybatis/ReplacementInstrumentActivityMapper.xml

@@ -26,6 +26,7 @@
         <result column="pay_status_" property="payStatus"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <resultMap id="ReplacementInstrumentActivityStatDto"
@@ -53,7 +54,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="ReplacementInstrumentActivity">
         SELECT *
-        FROM replacement_instrument_activity
+        FROM replacement_instrument_activity where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -62,9 +63,9 @@
             keyColumn="id" keyProperty="id">
         INSERT INTO replacement_instrument_activity (cooperation_organ_id_, user_id_, user_name_, grade_, classes_,
                                                      mobile_no_, subject_id_, question_result_, instruments_id_,
-                                                     goods_id_,other_suggestion_,topic_id_,replacement_instrument_cooperation_id_,create_time_, update_time_)
+                                                     goods_id_,other_suggestion_,topic_id_,replacement_instrument_cooperation_id_,create_time_, update_time_,tenant_id_)
         VALUES (#{cooperationOrganId}, #{userId}, #{userName}, #{grade}, #{classes}, #{mobileNo}, #{subjectId},
-                #{questionResult}, #{instrumentsId}, #{goodsId}, #{otherSuggestion}, #{topicId},#{replacementInstrumentCooperationId}, NOW(), NOW())
+                #{questionResult}, #{instrumentsId}, #{goodsId}, #{otherSuggestion}, #{topicId},#{replacementInstrumentCooperationId}, NOW(), NOW(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -114,7 +115,7 @@
                 grade_ = #{grade},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -126,14 +127,14 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ReplacementInstrumentActivityStatDto" parameterType="map">
-        SELECT * FROM replacement_instrument_activity
+        SELECT * FROM replacement_instrument_activity where tenant_id_ = #{tenantId}
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM replacement_instrument_activity
+        FROM replacement_instrument_activity where tenant_id_ = #{tenantId}
     </select>
     <select id="findByUserId" resultMap="ReplacementInstrumentActivity">
         SELECT *
@@ -148,6 +149,7 @@
 
     <sql id="queryReplacementsCondition">
         <where>
+        	ria.tenant_id_ = #{tenantId}
             <if test="cooperationOrganId!=null">
                 AND ria.cooperation_organ_id_ = #{cooperationOrganId}
             </if>

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

@@ -14,6 +14,7 @@
         <result column="title_" property="title"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -26,11 +27,11 @@
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         <!--@mbg.generated-->
         insert into replacement_instrument_cooperation (organ_id_, cooperation_organ_id_, open_pay_,show_question_,topic_id_, create_time_,
-        update_time_,title_
+        update_time_,title_,tenant_id_
         )
         values (#{organId}, #{cooperationOrganId},
         #{openPay,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{showQuestion,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{topicId}, NOW(), NOW(),#{title}
+        #{topicId}, NOW(), NOW(),#{title},#{tenantId}
         )
     </insert>
 
@@ -61,7 +62,7 @@
                 update_time_ = NOW(),
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 分页查询 -->
@@ -76,6 +77,7 @@
     </select>
     <sql id="queryPageSql">
         <where>
+        	ric.tenant_id_ = #{tenantId}
             <if test="organId != null">
                 AND FIND_IN_SET(ric.organ_id_ , #{organId})
             </if>
@@ -103,7 +105,7 @@
                COUNT(user_id_)                           activeNum,
                SUM(IF(instruments_id_ IS NOT NULL AND instruments_id_ > 0, 1, 0)) replaceNum,
                SUM(IF(pay_status_ = 2, 1, 0)) payNum,replacement_instrument_cooperation_id_ id
-        FROM replacement_instrument_activity
+        FROM replacement_instrument_activity where tenant_id_ = #{tenantId}
         GROUP BY replacement_instrument_cooperation_id_
     </select>
     <select id="findByCooperationOrganIdAndTopicId" resultMap="ReplacementInstrumentCooperation">

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

@@ -18,6 +18,7 @@
 		<result column="sale_price_" property="salePrice" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -28,13 +29,13 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="ReplacementInstrument">
-		SELECT * FROM replacement_instrument
+		SELECT * FROM replacement_instrument where tenant_id_ = #{tenantId}
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ReplacementInstrument" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO replacement_instrument (subject_id_,brand_,specification_,param_,market_price_,discount_price_,depreciation_price_,sale_price_,create_time_,update_time_)
-		VALUES(#{subjectId},#{brand},#{specification},#{param},#{marketPrice},#{discountPrice},#{depreciationPrice},#{salePrice},NOW(),NOW())
+		INSERT INTO replacement_instrument (subject_id_,brand_,specification_,param_,market_price_,discount_price_,depreciation_price_,sale_price_,create_time_,update_time_,tenant_id_)
+		VALUES(#{subjectId},#{brand},#{specification},#{param},#{marketPrice},#{discountPrice},#{depreciationPrice},#{salePrice},NOW(),NOW(),#{tenantId})
 	</insert>
 
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.ReplacementInstrument">
@@ -66,7 +67,7 @@
 		<if test="updateTime != null">
 			update_time_ = #{updateTime},
 		</if>
-	</set> WHERE id_ = #{id}
+	</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -83,6 +84,7 @@
 	</select>
 	<sql id="queryPageSql">
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="subjectId != null">
 				AND subject_id_ = #{subjectId}
 			</if>

+ 7 - 5
mec-biz/src/main/resources/config/mybatis/ResourceRespositoryMapper.xml

@@ -17,18 +17,19 @@
 		<result column="del_flag_" property="delFlag" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="ResourceRespository">
-		SELECT * FROM resource_respository
+		SELECT * FROM resource_respository where tenant_id_ = #{tenantId}
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ResourceRespository" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO resource_respository (id_,name_,url_,order_,subject_id_,level_,parent_id_,del_flag_,create_time_,update_time_)
-		VALUES(#{id},#{name},#{url},#{order},#{subjectId},#{level},#{parentId},#{delFlag},now(),now())
+		INSERT INTO resource_respository (id_,name_,url_,order_,subject_id_,level_,parent_id_,del_flag_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{name},#{url},#{order},#{subjectId},#{level},#{parentId},#{delFlag},now(),now(),#{tenantId})
 	</insert>
 	
 	
@@ -37,7 +38,7 @@
 	<select id="queryPage" resultMap="ResourceRespository" parameterType="map">
 		SELECT * FROM resource_respository
 		<where>
-			del_flag_ != 1
+			del_flag_ != 1 and tenant_id_ = #{tenantId}
 			<if test="search != null">
 				AND name_ LIKE CONCAT('%',#{search},'%')
 			</if>
@@ -49,7 +50,7 @@
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(id_) FROM resource_respository
 		<where>
-			del_flag_ != 1
+			del_flag_ != 1 and tenant_id_ = #{tenantId}
 			<if test="search != null">
 				AND name_ LIKE CONCAT('%',#{search},'%')
 			</if>
@@ -58,6 +59,7 @@
     <select id="findList" resultMap="ResourceRespository">
 		SELECT * FROM resource_respository
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="delFlag != null">
 				AND del_flag_ = #{delFlag}
 			</if>

+ 6 - 8
mec-biz/src/main/resources/config/mybatis/SchoolMapper.xml

@@ -22,6 +22,7 @@
         <result column="subsidy_" property="subsidy"/>
         <result column="cooperation_organ_id_" property="cooperationOrganId"/>
         <result column="remark_" property="remark"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -31,15 +32,15 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="School">
-		SELECT * FROM school ORDER BY id_
+		SELECT * FROM school where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.School" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO school
-        (id_,user_id_,name_,organ_id_,address_,contact_phone_,create_time_,update_time_,contact_name_,longitude_latitude_,subsidy_,cooperation_organ_id_,remark_)
-        VALUES(#{id},#{userId},#{name},#{organId},#{address},#{contactPhone},now(),now(),#{contactName},#{longitudeLatitude},#{subsidy},#{cooperationOrganId},#{remark})
+        (id_,user_id_,name_,organ_id_,address_,contact_phone_,create_time_,update_time_,contact_name_,longitude_latitude_,subsidy_,cooperation_organ_id_,remark_,tenant_id_)
+        VALUES(#{id},#{userId},#{name},#{organId},#{address},#{contactPhone},now(),now(),#{contactName},#{longitudeLatitude},#{subsidy},#{cooperationOrganId},#{remark},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -83,7 +84,7 @@
                 remark_ = #{remark},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -101,6 +102,7 @@
         <include refid="global.limit"/>
     </select>
     <sql id="queryPageSql">
+    	s.tenant_id_ = #{tenantId}
         <if test="cooperationOrganId != null">
             AND s.cooperation_organ_id_ = #{cooperationOrganId}
         </if>
@@ -130,9 +132,7 @@
         SELECT * FROM school
         <where>
             del_flag_ = 0 and user_id_ is null
-            <if test="organId != null">
                 AND FIND_IN_SET(organ_id_,#{organId})
-            </if>
         </where>
     </select>
     <select id="queryNameByIds" resultType="java.util.Map" >
@@ -144,9 +144,7 @@
     </select>
     <select id="findVipSchoolByUserId" resultMap="School">
         SELECT * FROM school WHERE del_flag_ = 0
-        <if test="organId != null">
         AND ((FIND_IN_SET(organ_id_,#{organId}) and user_id_ is NULL) or user_id_ = #{userId})
-        </if>
         <if test="search != null and search != ''">
             AND (name_ LIKE CONCAT('%',#{search},'%') OR address_ LIKE CONCAT('%',#{search},'%'))
         </if>

+ 23 - 21
mec-biz/src/main/resources/config/mybatis/SellOrderMapper.xml

@@ -5,6 +5,7 @@
         <!--@mbg.generated-->
         <!--@Table sell_order-->
         <id column="id_" property="id"/>
+        <result column="tenant_id_" property="tenantId"/>
         <result column="organ_id_" property="organId"/>
         <result column="edu_teacher_id_" property="eduTeacherId"/>
         <result column="eduTeacher" property="eduTeacher"/>
@@ -44,7 +45,7 @@
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
-        id_, edu_teacher_id_,organ_id_, cooperation_organ_id_, trans_no_,order_id_, order_no_, expect_amount_,
+        id_, tenant_id_, edu_teacher_id_,organ_id_, cooperation_organ_id_, trans_no_,order_id_, order_no_, expect_amount_,
         actual_amount_,balance_amount_, sell_cost_, sell_cost2_, type_,parent_goods_id_, goods_id_,goods_name_, num_,
         user_id_,
         payment_channel_,mer_no_,batch_no_,stock_type_,account_type_,status_, refund_time_,sell_time_, create_ime_,
@@ -68,13 +69,13 @@
         insert into sell_order (edu_teacher_id_,organ_id_, cooperation_organ_id_, trans_no_,order_id_, order_no_,
         expect_amount_,actual_amount_,balance_amount_, type_,parent_goods_id_, goods_id_,goods_name_, sell_cost_,
         sell_cost2_, num_, user_id_, payment_channel_,
-        mer_no_,batch_no_,stock_type_,account_type_, refund_time_,sell_time_, create_ime_, update_time_,coupon_remit_amount_)
+        mer_no_,batch_no_,stock_type_,account_type_, refund_time_,sell_time_, create_ime_, update_time_,coupon_remit_amount_,tenant_id_)
         values (#{eduTeacherId},#{organId}, #{cooperationOrganId}, #{transNo}, #{orderNo},#{orderId}, #{expectAmount},
         #{actualAmount}, #{balanceAmount}, #{type},#{parentGoodsId}, #{goodsId}, #{goodsName}, #{sellCost},
         #{sellCost2}, #{num}, #{userId},
         #{paymentChannel}, #{merNo},#{batchNo},
         #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{accountType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{refundTime},#{sellTime}, #{createIme}, #{updateTime}, #{couponRemitAmount})
+        #{refundTime},#{sellTime}, #{createIme}, #{updateTime}, #{couponRemitAmount},#{tenantId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.SellOrder">
         <!--@mbg.generated-->
@@ -165,7 +166,7 @@
                 update_time_ = #{updateTime},
             </if>
         </set>
-        where id_ = #{id}
+        where id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.SellOrder">
@@ -252,7 +253,7 @@
                 </if>
                 update_time_ = NOW()
             </set>
-            where id_ = #{sellOrder.id}
+            where id_ = #{sellOrder.id} and tenant_id_ = #{sellOrder.tenantId}
         </foreach>
     </update>
 
@@ -260,7 +261,7 @@
         insert into sell_order (organ_id_, cooperation_organ_id_, trans_no_,order_id_, order_no_, expect_amount_,
         actual_amount_,balance_amount_, type_, parent_goods_id_, goods_id_,goods_name_, sell_cost_, sell_cost2_, num_,
         user_id_, payment_channel_,
-        mer_no_,batch_no_,stock_type_,account_type_, sell_time_,edu_teacher_id_, create_ime_, update_time_,coupon_remit_amount_)
+        mer_no_,batch_no_,stock_type_,account_type_, sell_time_,edu_teacher_id_, create_ime_, update_time_,coupon_remit_amount_,tenant_id_)
         VALUE
         <foreach collection="sellOrders" separator="," item="sellOrder">
             (#{sellOrder.organId},#{sellOrder.cooperationOrganId},#{sellOrder.transNo},#{sellOrder.orderId},#{sellOrder.orderNo},
@@ -268,7 +269,7 @@
             #{sellOrder.goodsName},#{sellOrder.sellCost},#{sellOrder.sellCost2},#{sellOrder.num},#{sellOrder.userId},
             #{sellOrder.paymentChannel},#{sellOrder.merNo},#{sellOrder.batchNo},
             #{sellOrder.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{sellOrder.accountType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{sellOrder.sellTime},#{sellOrder.eduTeacherId},NOW(),NOW(),#{sellOrder.couponRemitAmount})
+            #{sellOrder.sellTime},#{sellOrder.eduTeacherId},NOW(),NOW(),#{sellOrder.couponRemitAmount},#{sellOrder.tenantId})
         </foreach>
     </insert>
 
@@ -298,6 +299,7 @@
 
     <sql id="queryPageSql">
         <where>
+        	so.tenant_id_  = #{tenantId}
             <if test="search != null and search != ''">
                 AND (so.order_no_ = #{search} OR so.trans_no_ = #{search})
             </if>
@@ -342,7 +344,7 @@
                  LEFT JOIN music_group mg ON mg.id_ = spo.music_group_id_
                  LEFT JOIN cooperation_organ co ON co.id_ = mg.cooperation_organ_id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'MUSIC'
+          AND spo.group_type_ = 'MUSIC' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, co.id_
@@ -356,7 +358,7 @@
                  LEFT JOIN music_group mg ON mg.id_ = spo.music_group_id_
                  LEFT JOIN cooperation_organ co ON co.id_ = mg.cooperation_organ_id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'MUSIC'
+          AND spo.group_type_ = 'MUSIC' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, co.id_
@@ -377,7 +379,7 @@
                  LEFT JOIN music_group mg ON mg.id_ = sr.music_group_id_
                  LEFT JOIN cooperation_organ co ON co.id_ = mg.cooperation_organ_id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ IN ('VIP', 'PRACTICE')
+          AND spo.group_type_ IN ('VIP', 'PRACTICE') and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, co.id_
@@ -394,7 +396,7 @@
                  LEFT JOIN sell_order so on so.order_id_ = spo.id_
                  LEFT JOIN cooperation_organ co ON co.id_ = spo.music_group_id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'OUTORDER'
+          AND spo.group_type_ = 'OUTORDER' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, co.id_
@@ -408,7 +410,7 @@
         FROM student_payment_order spo
                  LEFT JOIN cooperation_organ co ON co.id_ = spo.music_group_id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'OUTORDER'
+          AND spo.group_type_ = 'OUTORDER' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, co.id_
@@ -425,7 +427,7 @@
                  LEFT JOIN music_group mg ON mg.id_ = sci.music_group_id_
                  LEFT JOIN cooperation_organ co ON co.id_ = mg.cooperation_organ_id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'SPORADIC'
+          AND spo.group_type_ = 'SPORADIC' and spo.tenant_id_ = #{tenantId}
           AND sci.charge_type_ = '9'
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
@@ -443,7 +445,7 @@
                  LEFT JOIN cooperation_organ co ON co.id_ = mg.cooperation_organ_id_
         WHERE spo.status_ = 'SUCCESS'
           AND spo.group_type_ = 'SPORADIC'
-          AND sci.charge_type_ != '9'
+          AND sci.charge_type_ != '9' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, co.id_
@@ -458,7 +460,7 @@
         FROM student_payment_order spo
                  LEFT JOIN sell_order so on so.order_id_ = spo.id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'REPAIR'
+          AND spo.group_type_ = 'REPAIR' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_
@@ -472,7 +474,7 @@
         FROM student_payment_order spo
                  LEFT JOIN sell_order so on so.order_id_ = spo.id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'REPAIR'
+          AND spo.group_type_ = 'REPAIR' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_
@@ -489,7 +491,7 @@
         FROM student_payment_order spo
                  LEFT JOIN sell_order so on so.order_id_ = spo.id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'GOODS_SELL'
+          AND spo.group_type_ = 'GOODS_SELL' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, so.cooperation_organ_id_
@@ -528,7 +530,7 @@
         FROM student_payment_order spo
                  LEFT JOIN sell_order so on so.order_id_ = spo.id_
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'SUBJECT_CHANGE'
+          AND spo.group_type_ = 'SUBJECT_CHANGE' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, spo.music_group_id_
@@ -542,7 +544,7 @@
                SUM(spo.actual_amount_) income_total_
         FROM student_payment_order spo
         WHERE spo.status_ = 'SUCCESS'
-          AND spo.group_type_ = 'SUBJECT_CHANGE'
+          AND spo.group_type_ = 'SUBJECT_CHANGE' and spo.tenant_id_ = #{tenantId}
           AND spo.create_time_ >= #{startTime}
           AND spo.create_time_ <= #{endTime}
         GROUP BY spo.organ_id_, spo.music_group_id_
@@ -554,7 +556,7 @@
                cooperation_organ_id_,
                -SUM(sell_cost_ * num_) sell_cost_
         FROM sell_order
-        WHERE status_ = 1
+        WHERE status_ = 1 and spo.tenant_id_ = #{tenantId}
           AND refund_time_ >= #{startTime}
           AND refund_time_ <= #{endTime}
         GROUP BY organ_id_, cooperation_organ_id_
@@ -577,7 +579,7 @@
     <select id="getNoneBatchNoSellOrderIds" resultType="int">
         SELECT id_
         FROM sell_order
-        WHERE status_ = 0
+        WHERE status_ = 0 and tenant_id_ = #{tenantId}
           AND stock_type_ IS NOT NULL
           AND batch_no_ IS NULL
         ORDER BY sell_time_

+ 9 - 8
mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml

@@ -24,6 +24,7 @@
         <result column="paid_amount_" property="paidAmount"/>
         <result column="open_max_term_" property="openMaxTerm" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="version_" property="version"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -36,7 +37,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="SporadicChargeInfo">
         SELECT *
-        FROM sporadic_charge_info
+        FROM sporadic_charge_info where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -45,10 +46,10 @@
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         INSERT INTO sporadic_charge_info
         (title_, charge_type_, organ_id_, amount_, discount_amount_, detail_, create_time_, update_time_, operator_id_,
-         user_id_, music_group_id_, max_num_,max_amount_,open_max_term_)
+         user_id_, music_group_id_, max_num_,max_amount_,open_max_term_,tenant_id_)
         VALUES (#{title}, #{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
                 #{organId}, #{amount}, #{discountAmount}, #{detail}, now(), now(), #{operatorId}, #{userId},
-                #{musicGroupId}, #{maxNum},#{maxAmount},#{openMaxTerm,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
+                #{musicGroupId}, #{maxNum},#{maxAmount},#{openMaxTerm,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -107,7 +108,7 @@
                 version_ = version_+1,
             </if>
         </set>
-        WHERE id_ = #{id} AND version_ = #{version}
+        WHERE id_ = #{id} AND version_ = #{version} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -128,7 +129,7 @@
 
     <sql id="queryPageSql">
         <where>
-            sci.del_flag_ != 1
+            sci.del_flag_ != 1 and sci.tenant_id_ = #{tenantId}
             <if test="organId != null">
                 AND FIND_IN_SET(sci.organ_id_,#{organId})
             </if>
@@ -181,7 +182,7 @@
         SELECT o.*
         FROM sporadic_charge_info sci
                  LEFT JOIN organization o ON o.id_ = sci.organ_id_
-        WHERE sci.charge_type_ = #{type}
+        WHERE sci.charge_type_ = #{type} and sci.tenant_id_ = #{tenantId}
           AND sci.del_flag_ = 0
         GROUP BY o.id_
     </select>
@@ -190,14 +191,14 @@
         SELECT o.id_ id,o.name_ name ,(SUM(sci.max_amount_)/COUNT(*)) maxAmount
         FROM sporadic_charge_info sci
         LEFT JOIN organization o ON o.id_ = sci.organ_id_
-        WHERE sci.charge_type_ = #{type}
+        WHERE sci.charge_type_ = #{type} and sci.tenant_id_ = #{tenantId}
         AND sci.del_flag_ = 0
         GROUP BY o.id_
     </select>
 
     <sql id="findSporadicChargeInfosCondition">
         <where>
-            del_flag_ = 0
+            del_flag_ = 0 and tenant_id_ = #{tenantId}
             <if test="organId!=null">
                 AND organ_id_=#{organId}
             </if>

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/StudentApplyRefundsMapper.xml

@@ -17,6 +17,7 @@
         <result column="update_time_" property="updateTime"/>
         <result column="orig_payment_order_id_" property="origPaymentOrderId"/>
         <result column="remark_" property="remark"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
     
     <resultMap type="com.ym.mec.biz.dal.entity.StudentApplyRefunds" extends="StudentApplyRefunds" id="StudentApplyRefundsListDTO">
@@ -32,7 +33,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="StudentApplyRefunds">
-		SELECT * FROM student_apply_refunds ORDER BY id_
+		SELECT * FROM student_apply_refunds where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -44,8 +45,8 @@
         </selectKey>
         -->
         INSERT INTO student_apply_refunds
-        (id_,user_id_,order_no_,status_,expect_amount_,actual_amount_,create_time_,update_time_,orig_payment_order_id_,remark_)
-        VALUES(#{id},#{userId},#{orderNo},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{expectAmount},#{actualAmount},now(),now(),#{origPaymentOrderId},#{remark})
+        (id_,user_id_,order_no_,status_,expect_amount_,actual_amount_,create_time_,update_time_,orig_payment_order_id_,remark_, tenant_id_)
+        VALUES(#{id},#{userId},#{orderNo},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{expectAmount},#{actualAmount},now(),now(),#{origPaymentOrderId},#{remark},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -77,7 +78,7 @@
                 remark_ = #{remark},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -88,7 +89,7 @@
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="StudentApplyRefundsListDTO" parameterType="map">
         SELECT sar.*,spo.expect_amount_,spo.actual_amount_,u.username_ FROM student_apply_refunds sar left join student_payment_order spo on sar.orig_payment_order_id_ = spo.id_ left join sys_user u on sar.user_id_ = u.id_
-        where 1=1 
+        where 1=1 and sar.tenant_id_ = #{tenantId}
         <if test="startTime != null">
             and DATE_FORMAT(sar.create_time_,"%Y-%m-%d") &gt;= DATE_FORMAT(#{startTime},"%Y-%m-%d")
         </if>
@@ -107,7 +108,7 @@
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int" parameterType="map">
 		SELECT count(1) FROM student_apply_refunds sar left join student_payment_order spo on sar.orig_payment_order_id_ = spo.id_ left join sys_user u on sar.user_id_ = u.id_
-		where 1=1 
+		where 1=1 and sar.tenant_id_ = #{tenantId}
         <if test="startTime != null">
             and DATE_FORMAT(sar.create_time_,"%Y-%m-%d") &gt;= DATE_FORMAT(#{startTime},"%Y-%m-%d")
         </if>

+ 10 - 9
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -41,6 +41,7 @@
         <result column="start_class_time_" property="courseSchedule.startClassTime"/>
         <result column="end_class_time_" property="courseSchedule.endClassTime"/>
         <result column="new_course_id_" property="courseSchedule.newCourseId"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -50,7 +51,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="StudentAttendance">
-		SELECT * FROM student_attendance ORDER BY id_
+		SELECT * FROM student_attendance where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -58,17 +59,17 @@
             keyColumn="id" keyProperty="id">
         INSERT INTO student_attendance
         (group_type_,music_group_id_,class_group_id_,course_schedule_id_,user_id_,teacher_id_,status_,create_time_,
-        update_time_,remark_,current_class_times_,sign_in_time_,sign_out_time_,current_schedule_id_,visit_flag_,normal_remind_)
+        update_time_,remark_,current_class_times_,sign_in_time_,sign_out_time_,current_schedule_id_,visit_flag_,normal_remind_,tenant_id_)
         VALUES(#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{classGroupId},
         #{courseScheduleId},#{userId},#{teacherId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),
         #{remark},#{currentClassTimes},#{signInTime},#{signOutTime},#{currentScheduleId},#{visitFlag,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{normalRemind})
+        #{normalRemind},#{tenantId})
     </insert>
 
     <insert id="addStudentAttendances" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
       INSERT INTO student_attendance (group_type_, music_group_id_, class_group_id_, course_schedule_id_,
       user_id_, teacher_id_, status_, create_time_,update_time_, remark_ ,current_class_times_,sign_in_time_,
-                                      sign_out_time_,current_schedule_id_,visit_flag_,normal_remind_)
+                                      sign_out_time_,current_schedule_id_,visit_flag_,normal_remind_,tenant_id_)
       VALUES
 	  <foreach collection="list" item="studentAttendance" separator=",">
           (#{studentAttendance.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
@@ -78,7 +79,7 @@
           #{studentAttendance.remark},#{studentAttendance.currentClassTimes},
           #{studentAttendance.signInTime},#{studentAttendance.signOutTime},#{studentAttendance.currentScheduleId},
            #{studentAttendance.visitFlag,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-          #{studentAttendance.normalRemind})
+          #{studentAttendance.normalRemind},#{studentAttendance.tenantId})
       </foreach>
     </insert>
 
@@ -130,7 +131,7 @@
             </if>
             update_time_ = NOW()
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
     
     <update id="cleanCourseStudentSignOut">
@@ -277,7 +278,7 @@
 
     <sql id="queryCondition">
         <where>
-            (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL) AND cs.pre_course_flag_ = 0
+            (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL) AND cs.pre_course_flag_ = 0 and cs.tenant_id_ = #{tenantId}
             <if test="studentID != null">
                 and sa.user_id_ = #{studentID}
             </if>
@@ -485,7 +486,7 @@
     </select>
     <sql id="findStudentAttendanceSql">
         <where>
-            cs.del_flag_ = 0 AND cs.pre_course_flag_ = 0 AND cs.is_lock_ = 0
+            cs.del_flag_ = 0 AND cs.pre_course_flag_ = 0 AND cs.is_lock_ = 0 and cs.tenant_id_ = #{tenantId}
             <if test="visitFlag != null">
                 <if test="visitFlag == 1">
                     AND sa.visit_flag_ = 1
@@ -599,7 +600,7 @@
     </select>
     <sql id="exportStudentAttendancesQueryPageSql">
         <where>
-                cs.pre_course_flag_ = 0
+                cs.pre_course_flag_ = 0 and cs.tenant_id_ = #{tenantId}
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(cs.organ_id_,#{organId})
             </if>

+ 10 - 8
mec-biz/src/main/resources/config/mybatis/StudentCompetitionMapper.xml

@@ -20,6 +20,7 @@
 		<result column="comment_" property="comment" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -29,7 +30,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="StudentCompetition">
-		SELECT * FROM student_competition ORDER BY id_
+		SELECT * FROM student_competition where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -39,8 +40,8 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
 		</selectKey>
 		-->
-		INSERT INTO student_competition (id_,user_id_,username_,id_card_no_,age_,gender_,grade_,subject_,chapter_,picture_url_,video_url_,score_,prize_level_,is_show_,comment_,create_time_,update_time_)
-		VALUES(#{id},#{userId},#{username},#{idCardNo},#{age},#{gender},#{grade},#{subject},#{chapter},#{pictureUrl},#{videoUrl},#{score},#{prizeLevel},#{isShow},#{comment},NOW(),NOW())
+		INSERT INTO student_competition (id_,user_id_,username_,id_card_no_,age_,gender_,grade_,subject_,chapter_,picture_url_,video_url_,score_,prize_level_,is_show_,comment_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{userId},#{username},#{idCardNo},#{age},#{gender},#{grade},#{subject},#{chapter},#{pictureUrl},#{videoUrl},#{score},#{prizeLevel},#{isShow},#{comment},NOW(),NOW(),#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -92,7 +93,7 @@
 			grade_ = #{grade},
 		</if>
 			update_time_ = NOW()
-	</set> WHERE id_ = #{id}
+	</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -102,16 +103,17 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="StudentCompetition" parameterType="map">
-		SELECT * FROM student_competition ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM student_competition where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM student_competition
+		SELECT COUNT(*) FROM student_competition where tenant_id_ = #{tenantId}
 	</select>
 
 	<sql id="queryStudentCondition">
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="grade!=null">
 				AND grade_=#{grade}
 			</if>
@@ -169,7 +171,7 @@
 	</select>
 
 	<select id="getWinnerList" resultMap="StudentCompetition">
-		SELECT * FROM student_competition WHERE is_show_ = 1
+		SELECT * FROM student_competition WHERE is_show_ = 1 and tenant_id_ = #{tenantId}
 		ORDER BY ISNULL(score_),score_ DESC
 	</select>
 
@@ -178,6 +180,6 @@
 	</select>
 
 	<select id="getCompetitionsWithPrizeLevel" resultType="long">
-		SELECT id_ FROM student_competition WHERE prize_level_ = #{prizeLevel} FOR UPDATE
+		SELECT id_ FROM student_competition WHERE prize_level_ = #{prizeLevel} and tenant_id_ = #{tenantId} FOR UPDATE
 	</select>
 </mapper>

+ 8 - 7
mec-biz/src/main/resources/config/mybatis/StudentCourseFeeDetailMapper.xml

@@ -14,17 +14,18 @@
 		<result column="operator_" property="operator" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="StudentCourseFeeDetail">
-		SELECT * FROM student_course_fee_detail
+		SELECT * FROM student_course_fee_detail where tenant_id_ = #{tenantId}
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentCourseFeeDetail" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO student_course_fee_detail (student_registration_id_,amount_,surplus_course_fee_,memo_,operator_,create_time_,update_time_)
-		VALUES(#{studentRegistrationId},#{amount},#{surplusCourseFee},#{memo},#{operator},NOW(),NOW())
+		INSERT INTO student_course_fee_detail (student_registration_id_,amount_,surplus_course_fee_,memo_,operator_,create_time_,update_time_,tenant_id_)
+		VALUES(#{studentRegistrationId},#{amount},#{surplusCourseFee},#{memo},#{operator},NOW(),NOW(),#{tenantId})
 	</insert>
 
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentCourseFeeDetail">
@@ -49,19 +50,19 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="StudentCourseFeeDetail" parameterType="map">
-		SELECT * FROM student_course_fee_detail <include refid="global.limit"/>
+		SELECT * FROM student_course_fee_detail where tenant_id_ = #{tenantId} <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM student_course_fee_detail
+		SELECT COUNT(*) FROM student_course_fee_detail where tenant_id_ = #{tenantId}
 	</select>
 
 	<insert id="batchInsert">
-		INSERT INTO student_course_fee_detail (student_registration_id_,amount_,surplus_course_fee_,memo_,operator_,create_time_,update_time_)
+		INSERT INTO student_course_fee_detail (student_registration_id_,amount_,surplus_course_fee_,memo_,operator_,create_time_,update_time_,tenant_id_)
 		VALUES
 		<foreach collection="studentCourseFeeDetails" item="item" separator=",">
-			(#{item.studentRegistrationId},#{item.amount},#{item.surplusCourseFee},#{item.memo},#{item.operator},NOW(),NOW())
+			(#{item.studentRegistrationId},#{item.amount},#{item.surplusCourseFee},#{item.memo},#{item.operator},NOW(),NOW(),#{item.tenantId})
 		</foreach>
     </insert>
 </mapper>

+ 11 - 12
mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml

@@ -26,6 +26,7 @@
         <result column="submit_time_" property="submitTime"/>
         <result column="music_score_name_" property="musicScoreName"/>
         <result column="music_score_id_" property="musicScoreId"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.dto.CourseHomeworkStudentDetailDto" id="CourseHomeworkStudentDetailDto">
@@ -61,7 +62,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="StudentCourseHomework">
         SELECT *
-        FROM student_course_homework
+        FROM student_course_homework where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -69,23 +70,23 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentCourseHomework" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_course_homework
-        (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_)
+        (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,tenant_id_)
         VALUES(#{userId},#{courseScheduleId},#{courseHomeworkId},#{attachments},#{score},now(),now(),#{remark},
                #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-               #{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isRepliedTimely},#{musicScoreId})
+               #{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isRepliedTimely},#{musicScoreId},#{tenantId})
     </insert>
 
     <insert id="batchInsertStudentCourseHomeworkRecord" parameterType="java.util.List" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_course_homework
         (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,
-         update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_)
+         update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,tenant_id_)
         VALUE
         <foreach collection="list" item="homework" separator=",">
             (#{homework.userId},#{homework.courseScheduleId},#{homework.courseHomeworkId},#{homework.attachments},
             #{homework.score},now(),now(),#{homework.remark},#{homework.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             #{homework.isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{homework.isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isRepliedTimely},#{homework.musicScoreId})
+            #{homework.isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isRepliedTimely},#{homework.musicScoreId},#{homework.tenantId})
         </foreach>
     </insert>
 
@@ -128,7 +129,7 @@
                 submit_time_ = #{submitTime}
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -161,7 +162,7 @@
 
     <sql id="queryCondition">
         <where>
-            (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL) AND cs.pre_course_flag_ = 0
+            (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL) AND cs.pre_course_flag_ = 0 and cs.tenant_id_ = #{tenantId}
             <if test="createTime != null">
                 AND DATE_FORMAT(ch.create_time_,"%Y%m%d") = DATE_FORMAT(#{createTime},"%Y%m%d")
             </if>
@@ -273,9 +274,7 @@
         student_course_homework sch
         LEFT JOIN sys_user su ON sch.user_id_=su.id_
         <where>
-            <if test="courseScheduleId!=null">
-                AND sch.course_schedule_id_=#{courseScheduleId}
-            </if>
+                sch.course_schedule_id_=#{courseScheduleId}
             <if test="homeworkId!=null">
                 AND sch.course_homework_id_=#{homeworkId}
             </if>
@@ -426,6 +425,7 @@
 
     <sql id="queryAllCondition">
         <where>
+        	tenant_id_ = #{tenantId}
             <if test="courseScheduleId!=null">
                 AND course_schedule_id_=#{courseScheduleId}
             </if>
@@ -563,12 +563,10 @@
                 LEFT JOIN student_course_homework sch ON ch.id_ = sch.course_homework_id_
                 LEFT JOIN student_registration sr ON sch.user_id_=sr.user_id_ AND ch.music_group_id_=sr.music_group_id_
         WHERE sr.music_group_status_='NORMAL'
-            <if test="groupIds!=null and groupIds.size()>0">
                 AND ch.music_group_id_ IN
                 <foreach collection="groupIds" item="groupId" open="(" close=")" separator=",">
                     #{groupId}
                 </foreach>
-            </if>
             <if test="startTime!=null">
                 AND cs.class_date_ &gt;= DATE_FORMAT(#{startTime}, "%Y-%m-%d")
             </if>
@@ -602,6 +600,7 @@
 
     <sql id="homeWorkCondition">
         <where>
+        	sch.tenant_id_ = #{tenantId}
             <if test="userId!=null">
                 AND sch.user_id_=#{userId}
             </if>

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

@@ -14,6 +14,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="parent_id_" property="parentId"/>
         <result column="msg_type_" property="msgType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <resultMap id="studentCourseHomeworkComment" type="com.ym.mec.biz.dal.dto.StudentCourseHomeworkCommentDto">
@@ -34,15 +35,15 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="StudentCourseHomeworkReply">
-		SELECT * FROM student_course_homework_reply ORDER BY id_
+		SELECT * FROM student_course_homework_reply where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentCourseHomeworkReply" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_course_homework_reply
-        (id_,student_course_homework_id_,user_id_,content_,create_time_,parent_id_,msg_type_)
-        VALUES(#{id},#{studentCourseHomeworkId},#{userId},#{content},now(),#{parentId},#{msgType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
+        (id_,student_course_homework_id_,user_id_,content_,create_time_,parent_id_,msg_type_,tenant_id_)
+        VALUES(#{id},#{studentCourseHomeworkId},#{userId},#{content},now(),#{parentId},#{msgType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -65,7 +66,7 @@
                 content_ = #{content},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -96,6 +97,7 @@
 
     <sql id="queryCondition">
         <where>
+        	schr.tenant_id_ = #{tenantId}
             <if test="parentID!=null">
                 AND schr.parent_id_ = #{parentID}
             </if>

+ 22 - 18
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -25,6 +25,7 @@
 		<result column="course_ids_" property="courseIds"/>
 		<result column="not_over_course_ids_" property="notOverCourseIds"/>
 		<result column="not_over_course_num_" property="notOverCourseNum"/>
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 	<resultMap id="StudentExercisesSituationDto" type="com.ym.mec.biz.dal.dto.StudentExercisesSituationDto" extends="StudentExtracurricularExercisesSituation">
@@ -41,7 +42,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="StudentExtracurricularExercisesSituation">
-		SELECT * FROM student_extracurricular_exercises_situation_ ORDER BY id_
+		SELECT * FROM student_extracurricular_exercises_situation_ where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -54,21 +55,21 @@
 		INSERT INTO student_extracurricular_exercises_situation_ (id_,student_id_,week_of_year_,monday_,sunday_,teacher_id_,expect_exercises_num_,
 		                                                          actual_exercises_num_,exercises_reply_num_,exercises_message_num_,
 		                                                          exercises_message_timely_num_,create_time_,update_time_,last_submit_time_,
-		                                                          serve_type_,course_ids_,not_over_course_ids_,not_over_course_num_)
+		                                                          serve_type_,course_ids_,not_over_course_ids_,not_over_course_num_,tenant_id_)
 		VALUES(#{id},#{studentId},#{weekOfYear},#{monday},#{sunday},#{teacherId},#{expectExercisesNum},#{actualExercisesNum},#{exercisesReplyNum},
-		       #{exercisesMessageNum},#{exercisesMessageTimelyNum},NOW(),NOW(),#{lastSubmitTime},#{serveType},#{courseIds},#{notOverCourseIds},#{notOverCourseNum})
+		       #{exercisesMessageNum},#{exercisesMessageTimelyNum},NOW(),NOW(),#{lastSubmitTime},#{serveType},#{courseIds},#{notOverCourseIds},#{notOverCourseNum},#{tenantId})
 	</insert>
 
 	<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO student_extracurricular_exercises_situation_ (student_id_,week_of_year_,monday_,sunday_,teacher_id_,expect_exercises_num_,
 		                                                          actual_exercises_num_,exercises_reply_num_,exercises_message_num_,
 		                                                          exercises_message_timely_num_,create_time_,update_time_,last_submit_time_,
-		                                                          serve_type_,course_ids_,not_over_course_ids_,not_over_course_num_)
+		                                                          serve_type_,course_ids_,not_over_course_ids_,not_over_course_num_,tenant_id_)
 		VALUES
 		<foreach collection="situations" item="situation" separator=",">
 			(#{situation.studentId},#{situation.weekOfYear},#{situation.monday},#{situation.sunday},#{situation.teacherId},#{situation.expectExercisesNum},
 			#{situation.actualExercisesNum},#{situation.exercisesReplyNum},#{situation.exercisesMessageNum},#{situation.exercisesMessageTimelyNum},
-			NOW(),NOW(),#{situation.lastSubmitTime},#{situation.serveType},#{situation.courseIds},#{situation.notOverCourseIds},#{situation.notOverCourseNum})
+			NOW(),NOW(),#{situation.lastSubmitTime},#{situation.serveType},#{situation.courseIds},#{situation.notOverCourseIds},#{situation.notOverCourseNum},#{situation.tenantId})
 		</foreach>
 	</insert>
 
@@ -128,7 +129,7 @@
 				not_over_course_num_=#{notOverCourseNum},
 			</if>
 			update_time_ = #{updateTime}
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation">
@@ -181,7 +182,7 @@
 					not_over_course_num_=#{situation.notOverCourseNum},
 				</if>
 				update_time_ = NOW()
-			</set> WHERE id_ = #{situation.id}
+			</set> WHERE id_ = #{situation.id} and tenant_id_ = #{situation.tenantId}
 		</foreach>
 	</update>
 
@@ -207,12 +208,12 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="StudentExtracurricularExercisesSituation" parameterType="map">
-		SELECT * FROM student_extracurricular_exercises_situation_ ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM student_extracurricular_exercises_situation_ where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM student_extracurricular_exercises_situation_
+		SELECT COUNT(*) FROM student_extracurricular_exercises_situation_ where tenant_id_ = #{tenantId}
 	</select>
 
 	<select id="findExercisesSituations" resultMap="StudentExercisesSituationDto">
@@ -248,7 +249,7 @@
 			LEFT JOIN organization o ON stu.organ_id_=o.id_
 		WHERE
 		sees.monday_ &gt;= #{monday}
-		AND sees.sunday_ &lt;= #{sunday}
+		AND sees.sunday_ &lt;= #{sunday} and sees.tenant_id_ = #{tenantId}
 		<if test="teacherId!=null">
 			AND sees.teacher_id_ = #{teacherId}
 		</if>
@@ -342,7 +343,7 @@
 		LEFT JOIN organization o ON stu.organ_id_=o.id_
 		WHERE
 		sees.monday_ &gt;= #{monday}
-		AND sees.sunday_ &lt;= #{sunday}
+		AND sees.sunday_ &lt;= #{sunday} and sees.tenant_id_ = #{tenantId}
 		<if test="teacherId!=null">
 			AND sees.teacher_id_ = #{teacherId}
 		</if>
@@ -448,7 +449,10 @@
 	</select>
 
 	<select id="findLastWeekTodayUpdateNum" resultType="int">
-		SELECT COUNT(id_) FROM student_extracurricular_exercises_situation_ WHERE sunday_=#{sunday} AND DATE_FORMAT(update_time_,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d')
+		SELECT COUNT(id_) FROM student_extracurricular_exercises_situation_ WHERE sunday_=#{sunday} AND DATE_FORMAT(update_time_,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d') 
+        <if test="tenantId != null">
+        and tenant_id_ = #{tenantId}
+        </if>
     </select>
 
 	<select id="findStudentExercisesSituationsWithMonDay" resultMap="StudentExtracurricularExercisesSituation">
@@ -471,18 +475,19 @@
 	</select>
 
 	<select id="countWeekServiceNum" resultType="int">
-		SELECT COUNT(id_) FROM student_extracurricular_exercises_situation_ WHERE monday_=#{monday}
+		SELECT COUNT(id_) FROM student_extracurricular_exercises_situation_ WHERE monday_=#{monday} 
+        <if test="tenantId != null">
+        and tenant_id_ = #{tenantId}
+        </if>
 	</select>
 
 	<select id="findWeekServiceWithStudents" resultMap="StudentExtracurricularExercisesSituation">
 		SELECT * FROM student_extracurricular_exercises_situation_
 		<where>
+			teacher_id_=#{teacherId}
 			<if test="monday != null and monday != ''">
 				AND monday_ = #{monday}
 			</if>
-			<if test="teacherId!=null">
-				AND teacher_id_=#{teacherId}
-			</if>
 			<if test="studentIds!=null and studentIds.size()>0">
 				AND student_id_ IN
 				<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
@@ -531,6 +536,7 @@
 
 	<sql id="queryTeacherServeInfoCondition">
 		<where>
+			sees.tenant_id_ = #{tenantId}
 			<if test="organIds!=null and organIds.size()>0">
 				AND tea.organ_id_ IN
 				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
@@ -681,12 +687,10 @@
 			<if test="serveType!=null and serveType!=''">
 				AND serve_type_=#{serveType}
 			</if>
-		  <if test="teacherIds!=null and teacherIds.size()>0">
 			  AND teacher_id_ IN
 			  <foreach collection="teacherIds" item="teacherId" open="(" close=")" separator=",">
 				  #{teacherId}
 			  </foreach>
-		  </if>
 	</select>
 
 	<select id="getHomeworkData" resultMap="com.ym.mec.biz.dal.dao.IndexBaseMonthDataDao.IndexBaseMonthData">

部分文件因为文件数量过多而无法显示