yonge 3 years ago
parent
commit
08c3f8aeda
41 changed files with 428 additions and 338 deletions
  1. 5 13
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  2. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudTeacherOrderDao.java
  3. 4 5
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CooperationOrganDao.java
  4. 20 18
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java
  5. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ChargeType.java
  6. 0 7
      mec-biz/src/main/java/com/ym/mec/biz/service/CloudTeacherOrderService.java
  7. 2 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  8. 0 13
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudTeacherOrderServiceImpl.java
  9. 6 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleEvaluateServiceImpl.java
  10. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OperatingReportServiceImpl.java
  11. 3 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  12. 6 5
      mec-biz/src/main/resources/config/mybatis/ActivityApplyStudentTypeMapper.xml
  13. 7 6
      mec-biz/src/main/resources/config/mybatis/ActivityPlanMapper.xml
  14. 21 24
      mec-biz/src/main/resources/config/mybatis/ActivityUserMapperAdjustLogMapper.xml
  15. 21 24
      mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml
  16. 7 5
      mec-biz/src/main/resources/config/mybatis/ChargeTypeMapper.xml
  17. 7 5
      mec-biz/src/main/resources/config/mybatis/ChargeTypeOrganizationFeeMapper.xml
  18. 10 13
      mec-biz/src/main/resources/config/mybatis/ChargeTypeSubjectMapperMapper.xml
  19. 6 5
      mec-biz/src/main/resources/config/mybatis/ChildrenDayDegreeDetailDao.xml
  20. 6 5
      mec-biz/src/main/resources/config/mybatis/ChildrenDayDegreeInfoDao.xml
  21. 9 5
      mec-biz/src/main/resources/config/mybatis/ChildrenDayReserveMapper.xml
  22. 47 11
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  23. 8 7
      mec-biz/src/main/resources/config/mybatis/ClassGroupRelationMapper.xml
  24. 20 7
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  25. 15 8
      mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherMapperMapper.xml
  26. 10 3
      mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherSalaryMapper.xml
  27. 7 6
      mec-biz/src/main/resources/config/mybatis/CloudTeacherMapper.xml
  28. 16 6
      mec-biz/src/main/resources/config/mybatis/CloudTeacherOrderMapper.xml
  29. 10 9
      mec-biz/src/main/resources/config/mybatis/CooperationOrganLinkmanMapper.xml
  30. 10 6
      mec-biz/src/main/resources/config/mybatis/CooperationOrganMapper.xml
  31. 16 5
      mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml
  32. 8 4
      mec-biz/src/main/resources/config/mybatis/CourseHomeworkTemplateMapper.xml
  33. 6 5
      mec-biz/src/main/resources/config/mybatis/CourseScheduleComplaintsMapper.xml
  34. 24 5
      mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml
  35. 4 7
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  36. 0 6
      mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java
  37. 0 5
      mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java
  38. 12 0
      mec-common/common-core/src/main/java/com/ym/mec/common/page/QueryInfo.java
  39. 69 49
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  40. 0 19
      mec-task/src/main/java/com/ym/mec/task/jobs/CloudTeacherOrderTask.java
  41. 0 6
      mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

+ 5 - 13
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -669,11 +669,11 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      */
     List<ClassGroup> findByClassGroupIds(@Param("classGroupIds") List<Integer> classGroupIds, @Param("lockFlag") Integer lockFlag);
 
-    List<ImGroupModel> queryStudentGroup();
+    List<ImGroupModel> queryStudentGroup(Integer tenantId);
 
-    List<ImGroupModel> queryTeacherGroup();
+    List<ImGroupModel> queryTeacherGroup(Integer tenantId);
 
-    List<ImUserModel> queryImUser();
+    List<ImUserModel> queryImUser(Integer tenantId);
 
     /**
      * 批量更新班级学生数减一
@@ -714,7 +714,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @author Joburgess
      * @date 2019/12/31
      */
-    List<Integer> findClassGroupIdsByStudent(@Param("search") String search);
+    List<Integer> findClassGroupIdsByStudent(@Param("search") String search, @Param("tenantId") Integer tenantId);
 
     /**
      * @param search:
@@ -723,15 +723,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @author Joburgess
      * @date 2019/12/31
      */
-    List<Integer> findClassGroupIdsByTeacher(@Param("search") String search);
-
-    /**
-     * 获取基础技能版数量
-     *
-     * @param musicGroupId
-     * @return
-     */
-    Integer countClassNumByType(String musicGroupId);
+    List<Integer> findClassGroupIdsByTeacher(@Param("search") String search, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取对应班级的声部名称列表

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

@@ -28,7 +28,7 @@ public interface CloudTeacherOrderDao extends BaseDAO<Long, CloudTeacherOrder> {
      *
      * @return
      */
-    List<CloudTeacherOrder> getNoStartCloudTeacherOrder();
+    List<CloudTeacherOrder> getNoStartCloudTeacherOrder(Integer tenantId);
 
     /**
      * 获取学生在有效期内的乐保数量
@@ -80,7 +80,7 @@ public interface CloudTeacherOrderDao extends BaseDAO<Long, CloudTeacherOrder> {
                                                  @Param("activeRemark") Integer activeRemark,
                                                  @Param("remark") String remark);
 
-    List<Integer> getStudentIds();
+    List<Integer> getStudentIds(Integer tenantId);
 
     /**
      * 获取学员云教练活动金额

+ 4 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CooperationOrganDao.java

@@ -2,13 +2,12 @@ package com.ym.mec.biz.dal.dao;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
-import com.ym.mec.biz.dal.dto.OrganFullJobResourceNumDto;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import org.apache.ibatis.annotations.Param;
 
+import com.ym.mec.biz.dal.dto.OrganFullJobResourceNumDto;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.common.dal.BaseDAO;
 
 public interface CooperationOrganDao extends BaseDAO<Integer, CooperationOrgan> {
@@ -31,14 +30,14 @@ public interface CooperationOrganDao extends BaseDAO<Integer, CooperationOrgan>
     List<Map<Integer, String>> queryNameByIds(String organIds);
 
 
-    List<OrganFullJobResourceNumDto> getOrganFullJobResourceNum();
+    List<OrganFullJobResourceNumDto> getOrganFullJobResourceNum(Integer tenantId);
 
     /**
      * 获取全部使用中合作单位
      *
      * @return
      */
-    List<CooperationOrgan> getAllCooperationOrgan();
+    List<CooperationOrgan> getAllCooperationOrgan(Integer tenantId);
 
     /**
      * 获取合作单位乐团的学校缴费

+ 20 - 18
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java

@@ -5,7 +5,9 @@ import com.ym.mec.biz.dal.dto.PracticeGroupsDto;
 import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.common.dal.BaseDAO;
+
 import org.apache.ibatis.annotations.Param;
+import org.junit.runners.Parameterized.Parameters;
 
 import java.util.Date;
 import java.util.List;
@@ -16,17 +18,17 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
 
     List<CourseScheduleEvaluate> findByClassGroupIds(@Param("classGroupIds") List<Integer> classGroupIds);
 
-    List<PracticeGroupsDto> getPracticeGroupsFree();
+    List<PracticeGroupsDto> getPracticeGroupsFree(Integer tenantId);
 
-    List<PracticeGroupsDto> getPracticeGroupsBuy();
+    List<PracticeGroupsDto> getPracticeGroupsBuy(Integer tenantId);
 
-    List<PracticeGroupsDto> getPracticeGroupsRenew();
+    List<PracticeGroupsDto> getPracticeGroupsRenew(Integer tenantId);
 
-    List<PracticeGroupsDto> getHasReportNums();
+    List<PracticeGroupsDto> getHasReportNums(Integer tenantId);
 
-    List<PracticeGroupsDto> getOrganPracticeGroups();
+    List<PracticeGroupsDto> getOrganPracticeGroups(Integer tenantId);
 
-    List<PracticeGroupsDto> getOrganMoney();
+    List<PracticeGroupsDto> getOrganMoney(Integer tenantId);
 
     /**
      * @param expiredDate:
@@ -35,7 +37,7 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
      * @author Joburgess
      * @date 2020/2/28
      */
-    List<CourseScheduleEvaluate> findExpiredDateBeforeReport(@Param("expiredDate") Date expiredDate);
+    List<CourseScheduleEvaluate> findExpiredDateBeforeReport(@Param("expiredDate") Date expiredDate,@Param("tenantId") Integer tenantId);
 
     /**
      * 根据课程组id获取报告列表
@@ -67,7 +69,7 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
      * @param teacherId
      * @return
      */
-    List<CourseScheduleEvaluate> getNeedPostReports(@Param("teacherId") Integer teacherId);
+    List<CourseScheduleEvaluate> getNeedPostReports(@Param("teacherId") Integer teacherId, @Param("tenantId") Integer tenantId);
 
     /**
      * 批量插入报告
@@ -100,35 +102,35 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
      * @param type
      * @return
      */
-    List<PracticeGroupsDto> getMonthOrganMoney(@Param("type") OrderTypeEnum type, @Param("startTime") Date startTime);
+    List<PracticeGroupsDto> getMonthOrganMoney(@Param("type") OrderTypeEnum type, @Param("startTime") Date startTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取当月新成交金额,人数
      *
      * @return
      */
-    List<PracticeGroupsDto> getOrganNewPracticeGroupsOfMonth(@Param("type") OrderTypeEnum type, @Param("startTime") Date startTime);
+    List<PracticeGroupsDto> getOrganNewPracticeGroupsOfMonth(@Param("type") OrderTypeEnum type, @Param("startTime") Date startTime, @Param("tenantId") Integer tenantId);
 
     /**
      * 获取分部体验人数(去除禁止)
      *
      * @return
      */
-    List<Practice4OrganDto> getTryNums();
+    List<Practice4OrganDto> getTryNums(Integer tenantId);
 
     /**
      * 网管课体验人数
      *
      * @return
      */
-    List<Practice4OrganDto> getPracticeTryNums();
+    List<Practice4OrganDto> getPracticeTryNums(Integer tenantId);
 
     /**
      * vip课体验人数
      *
      * @return
      */
-    List<Practice4OrganDto> getVipTryNums();
+    List<Practice4OrganDto> getVipTryNums(Integer tenantId);
 
     /**
      * 网管课转化人数
@@ -136,7 +138,7 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
      * @param classDate
      * @return
      */
-    List<Practice4OrganDto> getPracticeBuyNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate);
+    List<Practice4OrganDto> getPracticeBuyNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate, @Param("tenantId") Integer tenantId);
 
     /**
      * VIP课转化人数
@@ -144,7 +146,7 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
      * @param classDate
      * @return
      */
-    List<Practice4OrganDto> getVipBuyNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate);
+    List<Practice4OrganDto> getVipBuyNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate, @Param("tenantId") Integer tenantId);
 
     /**
      * 网管课和vip课同事存在的人数
@@ -153,18 +155,18 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
      * @param endDate
      * @return
      */
-    List<Practice4OrganDto> getPracticeAndVipNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate);
+    List<Practice4OrganDto> getPracticeAndVipNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate, @Param("tenantId") Integer tenantId);
 
     /**
      * 禁止中vip和网管同时存在人数
      *
      * @return
      */
-    List<Practice4OrganDto> getPracticeAndVipTryNums();
+    List<Practice4OrganDto> getPracticeAndVipTryNums(Integer tenantId);
 
     /**
      * 获取所有的体验人数
      * @return
      */
-    List<Practice4OrganDto> getAllTryNums();
+    List<Practice4OrganDto> getAllTryNums(Integer tenantId);
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ChargeType.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.common.entity.BaseEntity;
 
 import io.swagger.annotations.ApiModelProperty;
 
@@ -11,7 +12,7 @@ import java.util.List;
 /**
  * 对应数据库表(charge_type):
  */
-public class ChargeType {
+public class ChargeType extends BaseEntity {
 
 	/**  */
 	@ApiModelProperty(value = "收费类型编号",required = false)

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

@@ -25,13 +25,6 @@ public interface CloudTeacherOrderService extends BaseService<Long, CloudTeacher
 
 
     /**
-     * 检测云教练是否开始生效,乐团上课后开始生效
-     *
-     * @return
-     */
-    Boolean checkCloudOrderStart();
-
-    /**
      * 将生效的云教练订单加入
      *
      * @param cloudTeacherOrder

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

@@ -2698,7 +2698,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         if (!CollectionUtils.isEmpty(teacherAttendances)) {
             teacherAttendanceDao.batchInsert(teacherAttendances);
         }
-        cloudTeacherOrderService.checkCloudOrderStart();
         imUserFriendService.refreshGroupImUserFriend(termCourseDetail.getMusicGroupId(),MUSIC);
     }
 
@@ -3850,8 +3849,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             if (!CollectionUtils.isEmpty(groups)) {
                 params.put("groups", groups);
             }
-            List<Integer> studentClassGroupIds = classGroupDao.findClassGroupIdsByStudent(queryInfo.getSearch());
-            List<Integer> teacherClassGroupIds = classGroupDao.findClassGroupIdsByTeacher(queryInfo.getSearch());
+            List<Integer> studentClassGroupIds = classGroupDao.findClassGroupIdsByStudent(queryInfo.getSearch(), queryInfo.getTenantId());
+            List<Integer> teacherClassGroupIds = classGroupDao.findClassGroupIdsByTeacher(queryInfo.getSearch(), queryInfo.getTenantId());
             studentClassGroupIds.addAll(teacherClassGroupIds);
             if (!CollectionUtils.isEmpty(studentClassGroupIds)) {
                 params.put("classGroupIds", studentClassGroupIds);

+ 0 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudTeacherOrderServiceImpl.java

@@ -66,19 +66,6 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
 	}
 
     @Override
-    public Boolean checkCloudOrderStart() {
-        List<CloudTeacherOrder> cloudTeacherOrders = cloudTeacherOrderDao.getNoStartCloudTeacherOrder();
-        List<String> musicGroupIds = cloudTeacherOrders.stream().map(CloudTeacherOrder::getMusicGroupId).collect(Collectors.toList());
-        List<CourseSchedule> musicGroupsHasStartCourseNum = courseScheduleDao.getMusicGroupsHasStartCourseNum(musicGroupIds);
-        Set<String> musicGroupHasStartCourse = musicGroupsHasStartCourseNum.stream().map(CourseSchedule::getMusicGroupId).collect(Collectors.toSet());
-        for (CloudTeacherOrder cloudTeacherOrder : cloudTeacherOrders) {
-            if (!musicGroupHasStartCourse.contains(cloudTeacherOrder.getMusicGroupId())) continue;
-            addStudentCloudTeacher(cloudTeacherOrder);
-        }
-        return true;
-    }
-
-    @Override
     @Transactional(rollbackFor = Exception.class)
     public CloudTeacher addStudentCloudTeacher(CloudTeacherOrder cloudTeacherOrder) {
         Date nowDate = new Date();

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

@@ -16,8 +16,10 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.redis.service.RedisCache;
 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.date.DateUtil;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
@@ -126,7 +128,8 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
 
     @Override
     public List<CourseScheduleEvaluate> getNeedPostList(Integer teacherId) {
-        return courseScheduleEvaluateDao.getNeedPostReports(teacherId);
+        Integer tenantId = TenantContextHolder.getTenantId();
+        return courseScheduleEvaluateDao.getNeedPostReports(teacherId, tenantId);
     }
 
     @Override
@@ -209,7 +212,8 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
 
     @Override
     public void pushNeedPostReport() {
-        List<CourseScheduleEvaluate> needPostReports = courseScheduleEvaluateDao.getNeedPostReports(null);
+        Integer tenantId = TenantContextHolder.getTenantId();
+        List<CourseScheduleEvaluate> needPostReports = courseScheduleEvaluateDao.getNeedPostReports(null, tenantId);
         if (needPostReports.size() == 0) {
             return;
         }

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

@@ -62,7 +62,7 @@ public class OperatingReportServiceImpl extends BaseServiceImpl<Integer, Operati
             throw new BizException("请配置全职资源公摊金额");
         }
         BigDecimal fullJobFee = new BigDecimal(configValue);
-        List<OrganFullJobResourceNumDto> organFullJobResources = cooperationOrganDao.getOrganFullJobResourceNum();
+        List<OrganFullJobResourceNumDto> organFullJobResources = cooperationOrganDao.getOrganFullJobResourceNum(tenantId);
         for (OrganFullJobResourceNumDto organFullJobResource : organFullJobResources) {
             OperatingReport operatingReport = new OperatingReport();
             operatingReport.setOrganId(organFullJobResource.getOrganId());
@@ -78,7 +78,7 @@ public class OperatingReportServiceImpl extends BaseServiceImpl<Integer, Operati
             organOperating.put(organ.getId(), operatingReport);
         }
         //1.3 合作单位的全职资源分摊费用
-        List<CooperationOrgan> allCooperationOrgan = cooperationOrganDao.getAllCooperationOrgan();
+        List<CooperationOrgan> allCooperationOrgan = cooperationOrganDao.getAllCooperationOrgan(tenantId);
         for (CooperationOrgan cooperationOrgan : allCooperationOrgan) {
             OperatingReport operatingReport = new OperatingReport();
             operatingReport.setOrganId(cooperationOrgan.getOrganId());

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

@@ -23,6 +23,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.redis.service.RedisCache;
 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.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
@@ -4613,8 +4614,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if (StringUtils.isBlank(pushType)) {
             throw new BizException("请指定推送类型:JIGUANG、SMS、ALL");
         }
+        Integer tenantId = TenantContextHolder.getTenantId();
 
-        List<CourseScheduleEvaluate> reports = courseScheduleEvaluateDao.findExpiredDateBeforeReport(expiredDate);
+        List<CourseScheduleEvaluate> reports = courseScheduleEvaluateDao.findExpiredDateBeforeReport(expiredDate, tenantId);
 
         if (CollectionUtils.isEmpty(reports)) {
             return;

+ 6 - 5
mec-biz/src/main/resources/config/mybatis/ActivityApplyStudentTypeMapper.xml

@@ -11,6 +11,7 @@
 		<result column="new_student_" property="newStudent" />
 		<result column="member_flag_" property="memberFlag" />
 		<result column="activity_id_" property="activityId" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -20,13 +21,13 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="ActivityApplyStudentType">
-		SELECT * FROM activity_apply_student_type ORDER BY id_
+		SELECT * FROM activity_apply_student_type where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ActivityApplyStudentType" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO activity_apply_student_type (new_student_,member_flag_,activity_id_)
-		VALUES(#{newStudent},#{memberFlag},#{activityId})
+		INSERT INTO activity_apply_student_type (new_student_,member_flag_,activity_id_,tenant_id_)
+		VALUES(#{newStudent},#{memberFlag},#{activityId},#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -47,11 +48,11 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ActivityApplyStudentType" parameterType="map">
-		SELECT * FROM activity_apply_student_type ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM activity_apply_student_type where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM activity_apply_student_type
+		SELECT COUNT(*) FROM activity_apply_student_type where tenant_id_ = #{tenantId}
 	</select>
 </mapper>

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

@@ -36,6 +36,7 @@
 		<result column="enable_" property="enable" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -45,7 +46,7 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="ActivityPlan">
-		SELECT * FROM activity_plan ORDER BY id_
+		SELECT * FROM activity_plan where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
@@ -54,12 +55,12 @@
 					   courses_end_time_,apply_to_student_type_,max_buy_num_,course_arranging_type_,
 					   course_type_,category_id_,single_course_time_,min_course_num_,max_course_num_,
 					   discount_,full_minus_course_times_,give_course_type_,give_category_id_,give_course_num_,
-					   member_rank_id_,member_time_,salary_settlement_json_,del_flag_,enable_,create_time_,update_time_)
+					   member_rank_id_,member_time_,salary_settlement_json_,del_flag_,enable_,create_time_,update_time_,tenant_id_)
 					   VALUES(#{organId},#{name},#{description},#{type},#{startTime},#{endTime},#{coursesStartTime},
 							  #{coursesEndTime},#{applyToStudentType},#{maxBuyNum},#{courseArrangingType},#{courseType},
 							  #{categoryId},#{singleCourseTime},#{minCourseNum},#{maxCourseNum},#{discount},
 							  #{fullMinusCourseTimes},#{giveCourseType},#{giveCategoryId},#{giveCourseNum},
-							  #{memberRankId},#{memberTime},#{salarySettlementJson},#{delFlag},#{enable},#{createTime},#{updateTime})
+							  #{memberRankId},#{memberTime},#{salarySettlementJson},#{delFlag},#{enable},#{createTime},#{updateTime},#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -152,7 +153,7 @@
 		<if test="type != null">
 		type_ = #{type},
 		</if>
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -162,11 +163,11 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ActivityPlan" parameterType="map">
-		SELECT * FROM activity_plan ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM activity_plan where tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM activity_plan
+		SELECT COUNT(*) FROM activity_plan where tenant_id_ = #{tenantId}
 	</select>
 </mapper>

+ 21 - 24
mec-biz/src/main/resources/config/mybatis/ActivityUserMapperAdjustLogMapper.xml

@@ -19,6 +19,7 @@
 		<result column="activity_user_mapper_id_" property="activityUserMapperId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -28,21 +29,21 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="ActivityUserMapperAdjustLog">
-		SELECT * FROM activity_user_mapper_adjust_log ORDER BY id_
+		SELECT * FROM activity_user_mapper_adjust_log where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ActivityUserMapperAdjustLog" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO activity_user_mapper_adjust_log (operator_id_,operator_name_,activity_id_,
-		                                             course_num_,give_course_num_,memo_,user_id_,create_time_,update_time_,type_,activity_user_mapper_id_)
-		VALUES(#{operatorId},#{operatorName},#{activityId},#{courseNum},#{giveCourseNum},#{memo},#{userId},NOW(),NOW(),#{type},#{activityUserMapperId})
+		                                             course_num_,give_course_num_,memo_,user_id_,create_time_,update_time_,type_,activity_user_mapper_id_,tenant_id_)
+		VALUES(#{operatorId},#{operatorName},#{activityId},#{courseNum},#{giveCourseNum},#{memo},#{userId},NOW(),NOW(),#{type},#{activityUserMapperId},#{tenantId})
 	</insert>
 	<insert id="batchInsert">
 		INSERT INTO activity_user_mapper_adjust_log (operator_id_,operator_name_,activity_id_,course_num_,
-		                                             give_course_num_,memo_,user_id_,create_time_,update_time_,type_,activity_user_mapper_id_)
+		                                             give_course_num_,memo_,user_id_,create_time_,update_time_,type_,activity_user_mapper_id_,tenant_id_)
 		VALUES
 		<foreach collection="logs" separator="," item="bean">
-			(#{bean.operatorId},#{bean.operatorName},#{bean.activityId},#{bean.courseNum},#{bean.giveCourseNum},#{bean.memo},#{bean.userId},NOW(),NOW(),#{bean.type},#{bean.activityUserMapperId})
+			(#{bean.operatorId},#{bean.operatorName},#{bean.activityId},#{bean.courseNum},#{bean.giveCourseNum},#{bean.memo},#{bean.userId},NOW(),NOW(),#{bean.type},#{bean.activityUserMapperId},#{bean.tenantId})
 		</foreach>
 	</insert>
 
@@ -71,7 +72,7 @@
 		activity_id_ = #{activityId},
 		</if>
 		update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -81,29 +82,25 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ActivityUserMapperAdjustLog" parameterType="map">
-		SELECT * FROM activity_user_mapper_adjust_log
-		<where>
-			<if test="userId != null">
-				AND user_id_ = #{userId}
-			</if>
-			<if test="activityId != null">
-				AND activity_id_ = #{activityId}
-			</if>
-		</where>
+		SELECT * FROM activity_user_mapper_adjust_log where tenant_id_ = #{tenantId}
+		<if test="userId != null">
+			AND user_id_ = #{userId}
+		</if>
+		<if test="activityId != null">
+			AND activity_id_ = #{activityId}
+		</if>
 		ORDER BY id_ DESC
 		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM activity_user_mapper_adjust_log
-		<where>
-			<if test="userId != null">
-				AND user_id_ = #{userId}
-			</if>
-			<if test="activityId != null">
-				AND activity_id_ = #{activityId}
-			</if>
-		</where>
+		SELECT COUNT(*) FROM activity_user_mapper_adjust_log where tenant_id_ = #{tenantId}
+		<if test="userId != null">
+			AND user_id_ = #{userId}
+		</if>
+		<if test="activityId != null">
+			AND activity_id_ = #{activityId}
+		</if>
 	</select>
 </mapper>

+ 21 - 24
mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml

@@ -30,6 +30,7 @@
 		<result column="cut_memo_" property="cutMemo" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -39,7 +40,7 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="ActivityUserMapper">
-		SELECT * FROM activity_user_mapper ORDER BY id_
+		SELECT * FROM activity_user_mapper where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
@@ -47,23 +48,23 @@
 		INSERT INTO activity_user_mapper (activity_id_,user_id_,vip_flag_,give_vip_flag_,
 		                                  practice_flag_,give_practice_flag_,member_flag_,give_member_flag_,create_time_,update_time_,payment_order_id_,
 										  vip_group_id_,give_vip_group_id_,practice_group_id_,give_practice_group_id_,return_fee_,
-		                                  member_order_id_,give_member_order_id_,teacher_id_,actual_price_,add_memo_,cut_memo_)
+		                                  member_order_id_,give_member_order_id_,teacher_id_,actual_price_,add_memo_,cut_memo_,tenant_id_)
 		                                  VALUES(#{activityId},#{userId},#{vipFlag},#{giveVipFlag},#{practiceFlag},
 		                                         #{givePracticeFlag},#{memberFlag},#{giveMemberFlag},NOW(),NOW(),#{paymentOrderId},#{vipGroupId},
 		                                         #{giveVipGroupId},#{practiceGroupId},#{givePracticeGroupId},#{returnFee},
-		                                         #{memberOrderId},#{giveMemberOrderId},#{teacherId},#{actualPrice},#{addMemo},#{cutMemo})
+		                                         #{memberOrderId},#{giveMemberOrderId},#{teacherId},#{actualPrice},#{addMemo},#{cutMemo},#{tenantId})
 	</insert>
     <insert id="batchInsert">
 		INSERT INTO activity_user_mapper (activity_id_,user_id_,vip_flag_,give_vip_flag_,
 		practice_flag_,give_practice_flag_,member_flag_,give_member_flag_,create_time_,update_time_,payment_order_id_,
 		vip_group_id_,give_vip_group_id_,practice_group_id_,give_practice_group_id_,return_fee_,member_order_id_,
-		                                  give_member_order_id_,teacher_id_,actual_price_,add_memo_,cut_memo_)
+		                                  give_member_order_id_,teacher_id_,actual_price_,add_memo_,cut_memo_,tenant_id_)
 		VALUES
 		<foreach collection="activityUserMappers" item="item" separator=",">
 			(#{item.activityId},#{item.userId},#{item.vipFlag},#{item.giveVipFlag},#{item.practiceFlag},
 			#{item.givePracticeFlag},#{item.memberFlag},#{item.giveMemberFlag},NOW(),NOW(),#{item.paymentOrderId},#{item.vipGroupId},
 			#{item.giveVipGroupId},#{item.practiceGroupId},#{item.givePracticeGroupId},#{item.returnFee},
-			 #{item.memberOrderId},#{item.giveMemberOrderId},#{item.teacherId},#{item.actualPrice},#{item.addMemo},#{item.cutMemo})
+			 #{item.memberOrderId},#{item.giveMemberOrderId},#{item.teacherId},#{item.actualPrice},#{item.addMemo},#{item.cutMemo},#{item.tenantId})
 		</foreach>
 	</insert>
 
@@ -132,7 +133,7 @@
 				give_member_flag_ = #{giveMemberFlag},
 			</if>
 			update_time_ = NOW()
-		</set>WHERE id_ = #{id}
+		</set>WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	<update id="use">
 		UPDATE activity_user_mapper SET
@@ -165,30 +166,26 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ActivityUserMapper" parameterType="map">
-		SELECT * FROM activity_user_mapper
-		<where>
-			<if test="userId != null">
-				AND user_id_ = #{userId}
-			</if>
-			<if test="activityId != null">
-				AND activity_id_ = #{activityId}
-			</if>
-		</where>
+		SELECT * FROM activity_user_mapper where tenant_id_ = #{tenantId}
+		<if test="userId != null">
+			AND user_id_ = #{userId}
+		</if>
+		<if test="activityId != null">
+			AND activity_id_ = #{activityId}
+		</if>
 		ORDER BY id_ DESC
 		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM activity_user_mapper
-		<where>
-			<if test="userId != null">
-				AND user_id_ = #{userId}
-			</if>
-			<if test="activityId != null">
-				AND activity_id_ = #{activityId}
-			</if>
-		</where>
+		SELECT COUNT(*) FROM activity_user_mapper where tenant_id_ = #{tenantId}
+		<if test="userId != null">
+			AND user_id_ = #{userId}
+		</if>
+		<if test="activityId != null">
+			AND activity_id_ = #{activityId}
+		</if>
 	</select>
     <select id="findByStudentIdList" resultMap="ActivityUserMapper">
 		SELECT * FROM activity_user_mapper

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

@@ -14,6 +14,7 @@
         <result column="course_form_" property="courseForm"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+		<result column="tenant_id_" property="tenantId" />
         <collection property="subjects" ofType="com.ym.mec.biz.dal.entity.Subject">
             <result property="id" column="subject_id_"/>
             <result property="name" column="subject_name_"/>
@@ -27,14 +28,14 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="ChargeType">
-		SELECT * FROM charge_type WHERE del_flag_ = 0 ORDER BY id_
+		SELECT * FROM charge_type WHERE del_flag_ = 0 and tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ChargeType" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO charge_type (id_,name_,description_,course_form_,create_time_,update_time_)
-        VALUES(#{id},#{name},#{description},#{courseForm},now(),now())
+        INSERT INTO charge_type (id_,name_,description_,course_form_,create_time_,update_time_,tenant_id_)
+        VALUES(#{id},#{name},#{description},#{courseForm},now(),now(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -57,7 +58,7 @@
                 name_ = #{name},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -71,12 +72,13 @@
         FROM (SELECT * FROM charge_type WHERE del_flag_ = 0 <include refid="global.limit"/>) ct
         LEFT JOIN charge_type_subject_mapper ctsm ON ct.id_ = ctsm.charge_type_id_
         LEFT JOIN `subject` s ON ctsm.subject_id_ = s.id_
+        where tenant_id_ = #{tenantId}
         ORDER BY ct.update_time_
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM charge_type WHERE del_flag_ = 0
+		SELECT COUNT(*) FROM charge_type WHERE del_flag_ = 0 and tenant_id_ = #{tenantId}
 	</select>
     <select id="queryNameByIds" resultType="java.util.Map" parameterType="list">
         SELECT id_ `key`,name_ `value` FROM charge_type WHERE FIND_IN_SET(id_,#{chargeTypeIds})

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

@@ -12,6 +12,7 @@
 		<result column="course_fee_" property="courseFee" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -21,7 +22,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="chargeTypeOrganizationFee">
-		SELECT * FROM charge_type_organization_fee
+		SELECT * FROM charge_type_organization_fee where tenant_id_ = #{tenantId}
 		ORDER BY id_
 	</select>
 
@@ -29,8 +30,8 @@
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeOrganizationFee"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO charge_type_organization_fee
-		(id_,charge_type_id_,organ_id_,course_fee_,create_time_,update_time_)
-		VALUES(#{id},#{chargeTypeId},#{organId},#{courseFee},NOW(),NOW())
+		(id_,charge_type_id_,organ_id_,course_fee_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{chargeTypeId},#{organId},#{courseFee},NOW(),NOW(),#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -50,7 +51,7 @@
 				update_time_ = #{updateTime},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -64,13 +65,14 @@
 		FROM charge_type_organization_fee ctof
 		LEFT JOIN organization o ON o.id_ = ctof.organ_id_
 		LEFT JOIN charge_type ct ON ctof.charge_type_id_ = ct.id_
+		where tenant_id_ = #{tenantId}
 		ORDER BY ctof.create_time_ DESC
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM charge_type_organization_fee
+		SELECT COUNT(*) FROM charge_type_organization_fee where tenant_id_ = #{tenantId}
 	</select>
 
     <select id="findByOrganId" resultMap="chargeTypeOrganizationFee">

+ 10 - 13
mec-biz/src/main/resources/config/mybatis/ChargeTypeSubjectMapperMapper.xml

@@ -17,6 +17,7 @@
         <result column="deposit_fee_" property="depositFee"/>
         <result column="fee_" property="fee"/>
         <result column="goods_discount_rate_" property="goodsDiscountRate"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -29,7 +30,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="ChargeTypeSubjectMapper">
         SELECT *
-        FROM charge_type_subject_mapper
+        FROM charge_type_subject_mapper where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -37,20 +38,20 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO charge_type_subject_mapper (charge_type_id_, subject_id_, kit_group_purchase_type_, deposit_fee_,
-                                                fee_, goods_discount_rate_, create_time_, update_time_)
+                                                fee_, goods_discount_rate_, create_time_, update_time_,tenant_id_)
         VALUES (#{chargeTypeId}, #{subjectId},
                 #{kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{depositFee},
-                #{fee}, #{goodsDiscountRate}, now(), now())
+                #{fee}, #{goodsDiscountRate}, now(), now(),#{tenantId})
     </insert>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO charge_type_subject_mapper
-        (charge_type_id_,subject_id_,kit_group_purchase_type_,deposit_fee_,fee_,goods_discount_rate_,create_time_,update_time_)
+        (charge_type_id_,subject_id_,kit_group_purchase_type_,deposit_fee_,fee_,goods_discount_rate_,create_time_,update_time_,tenant_id_)
         VALUES
         <foreach collection="list" item="item" separator=",">
-            (#{item.chargeTypeId},#{item.subjectId},#{item.kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.depositFee},#{item.fee},#{item.goodsDiscountRate},now(),now())
+            (#{item.chargeTypeId},#{item.subjectId},#{item.kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.depositFee},#{item.fee},#{item.goodsDiscountRate},now(),now(),#{item.tenantId})
         </foreach>
     </insert>
 
@@ -81,7 +82,7 @@
                 update_time_ = NOW(),
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <update id="batchUpdate" parameterType="java.util.List">
@@ -111,7 +112,7 @@
                     update_time_ = NOW(),
                 </if>
             </set>
-            WHERE id_ = #{item.id}
+            WHERE id_ = #{item.id} tenant_id_ = #{item.tenantId}
         </foreach>
     </update>
 
@@ -130,30 +131,26 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ChargeTypeSubjectMapper" parameterType="map">
-        SELECT * FROM charge_type_subject_mapper 
-        <where>
+        SELECT * FROM charge_type_subject_mapper where  tenant_id_ = #{tenantId}
         	<if test="chargeTypeId != null">
         		and charge_type_id_ = #{chargeTypeId}
         	</if>
         	<if test="subjectId != null">
         		and subject_id_ = #{subjectId}
         	</if>
-        </where>
         ORDER BY id_ desc
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-        SELECT COUNT(*) FROM charge_type_subject_mapper
-        <where>
+        SELECT COUNT(*) FROM charge_type_subject_mapper where tenant_id_ = #{tenantId}
         	<if test="chargeTypeId != null">
         		and charge_type_id_ = #{chargeTypeId}
         	</if>
         	<if test="subjectId != null">
         		and subject_id_ = #{subjectId}
         	</if>
-        </where>
     </select>
 
     <!-- 根据收费类型获取乐团乐器折扣 -->

+ 6 - 5
mec-biz/src/main/resources/config/mybatis/ChildrenDayDegreeDetailDao.xml

@@ -14,6 +14,7 @@
         <result column="order_id_" property="orderId"/>
         <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="ChildrenDayDegreeDetail">
@@ -31,9 +32,9 @@
         <!--@mbg.generated-->
         insert into children_day_degree_detail (reserve_id_, user_id_, type_, subject_id_, level_, price_,
         status_,order_id_,
-        create_time_, update_time)
+        create_time_, update_time,tenant_id_)
         values (#{reserveId}, #{userId}, #{type}, #{subjectId}, #{level}, #{price}, #{status},#{orderId},
-        #{createTime}, #{updateTime})
+        #{createTime}, #{updateTime},#{tenantId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail">
         <!--@mbg.generated-->
@@ -70,7 +71,7 @@
                 update_time = #{updateTime},
             </if>
         </set>
-        where id_ = #{id}
+        where id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <select id="getByUserIdAndStatus" resultMap="ChildrenDayDegreeDetail">
@@ -82,12 +83,12 @@
 
     <insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
         INSERT INTO children_day_degree_detail
-        (reserve_id_, user_id_, type_, subject_id_, level_, price_,status_,order_id_,create_time_,update_time)
+        (reserve_id_, user_id_, type_, subject_id_, level_, price_,status_,order_id_,create_time_,update_time,tenant_id_)
         VALUE
         <foreach collection="details" item="detail" separator=",">
             (#{detail.reserveId}, #{detail.userId}, #{detail.type}, #{detail.subjectId}, #{detail.level},
             #{detail.price}, #{detail.status},#{detail.orderId},
-            now(),now())
+            now(),now(),#{detail.tenantId})
         </foreach>
     </insert>
 

+ 6 - 5
mec-biz/src/main/resources/config/mybatis/ChildrenDayDegreeInfoDao.xml

@@ -19,6 +19,7 @@
         <result column="order_id_" property="orderId"/>
         <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="ChildrenDayDegreeInfo">
@@ -39,10 +40,10 @@
         <!--@mbg.generated-->
         insert into children_day_degree_info (reserve_id_, user_id_, subject_id_, grade_level_, grade_price_,
         theory_level_,theory_price_, vip_1v1_price_, vip_1v2_price_, theory_course_price_, total_amount_,order_id_,
-        create_time_, update_time_)
+        create_time_, update_time_,tenant_id_)
         values (#{reserveId}, #{userId}, #{subjectId}, #{gradeLevel}, #{gradePrice}, #{theoryLevel},
         #{theoryPrice}, #{vip1v1Price}, #{vip1v2Price}, #{theoryCoursePrice}, #{totalAmount},#{orderId},
-        NOW(), NOW())
+        NOW(), NOW(),#{tenantId})
     </insert>
 
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo">
@@ -92,19 +93,19 @@
                 update_time_ = NOW(),
             </if>
         </set>
-        where id_ = #{id}
+        where id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ChildrenDayDegreeInfo" parameterType="map">
-        SELECT * FROM children_day_degree_info
+        SELECT * FROM children_day_degree_info where tenant_id_ = #{tenantId}
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM children_day_degree_info
+        FROM children_day_degree_info where tenant_id_ = #{tenantId}
     </select>
 
     <select id="getPayedUser" resultType="java.lang.Integer">

+ 9 - 5
mec-biz/src/main/resources/config/mybatis/ChildrenDayReserveMapper.xml

@@ -12,6 +12,7 @@
         <result column="is_send_msg_" property="isSendMsg" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <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="ChildrenDayReserve">
@@ -29,9 +30,9 @@
             useGeneratedKeys="true">
         <!--@mbg.generated-->
         insert into children_day_reserve (user_id_, organ_id_, cooperation_organ_id_, music_group_id_, is_reserve_,
-        create_time_, update_time_)
+        create_time_, update_time_,tenant_id_)
         values (#{userId}, #{organId}, #{cooperationOrganId}, #{musicGroupId},
-        #{isReserve,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},NOW(), NOW())
+        #{isReserve,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},NOW(), NOW(),#{tenantId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChildrenDayReserve">
         <!--@mbg.generated-->
@@ -62,19 +63,19 @@
                 update_time_ = #{updateTime},
             </if>
         </set>
-        where id_ = #{id}
+        where id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ChildrenDayReserve" parameterType="map">
-        SELECT * FROM children_day_reserve
+        SELECT * FROM children_day_reserve where tenant_id_ = #{tenantId}
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM children_day_reserve
+        FROM children_day_reserve where tenant_id_ = #{tenantId}
     </select>
     <resultMap id="ChildrenStatisticsDtoMap" type="com.ym.mec.biz.dal.dto.ChildrenStatisticsDto">
         <result property="buyMusicTheoryAmount" column="buy_music_theory_amount_"/>
@@ -255,6 +256,9 @@
                 AND (cdr.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE
                 CONCAT('%',#{search},'%'))
             </if>
+            <if test="tenantId != null">
+                AND cdr.tenant_id_ = #{tenantId}
+            </if>
             <if test="isReserve != null">
                 AND cdr.is_reserve_ = #{isReserve}
             </if>

+ 47 - 11
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -24,6 +24,7 @@
         <result column="img_" property="img"/>
         <result column="memo_" property="memo"/>
         <result column="current_class_times_" property="currentClassTimes"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.ClassGroup4Teacher" id="ClassGroup4Teacher">
@@ -66,6 +67,7 @@
             <if test="img!=null">img_,</if>
             <if test="memo!=null">memo_,</if>
             <if test="delFlag!=null">del_flag_,</if>
+            <if test="tenantId!=null">tenant_id_,</if>
         </trim>
         VALUES
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -84,6 +86,7 @@
             <if test="img!=null">#{img},</if>
             <if test="memo!=null">#{memo},</if>
             <if test="delFlag!=null">#{delFlag},</if>
+            <if test="tenantId!=null">#{tenantId},</if>
         </trim>
     </insert>
 
@@ -103,7 +106,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="ClassGroup">
         SELECT *
-        FROM class_group
+        FROM class_group where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -151,7 +154,7 @@
                 del_flag_ = #{delFlag},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -169,6 +172,9 @@
         	<if test="id != null">
 				and id_ = #{id}
 			</if>
+        	<if test="tenantId != null">
+				and tenant_id_ = #{tenantId}
+			</if>
         	<if test="type != null">
 				and type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
@@ -196,6 +202,9 @@
         	<if test="id != null">
 				and id_ = #{id}
 			</if>
+        	<if test="tenantId != null">
+				and tenant_id_ = #{tenantId}
+			</if>
         	<if test="type != null">
 				and type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
@@ -339,6 +348,9 @@
             <if test="userId != null">
                 AND cgsm.user_id_ = #{userId}
             </if>
+            <if test="tenantId != null">
+                AND cgsm.tenant_id_ = #{tenantId}
+            </if>
             <if test="search != null and search != ''">
                 AND (cg.name_ LIKE CONCAT('%',#{search},'%') OR cg.group_name_ LIKE CONCAT('%',#{search},'%') OR mg.name_ LIKE CONCAT('%',#{search},'%'))
             </if>
@@ -357,6 +369,9 @@
             <if test="userId != null">
                 AND cgsm.user_id_ = #{userId}
             </if>
+            <if test="tenantId != null">
+                AND cgsm.tenant_id_ = #{tenantId}
+            </if>
             <if test="search != null and search != ''">
                 AND cg.name_ LIKE CONCAT('%',#{search},'%')
             </if>
@@ -374,6 +389,9 @@
             <if test="userId != null">
                 AND cgsm.user_id_ = #{userId}
             </if>
+            <if test="tenantId != null">
+                AND cgsm.tenant_id_ = #{tenantId}
+            </if>
             <if test="search != null and search != ''">
                 AND cg.name_ LIKE CONCAT('%',#{search},'%')
             </if>
@@ -391,6 +409,9 @@
             <if test="userId != null">
                 AND cgsm.user_id_ = #{userId}
             </if>
+            <if test="tenantId != null">
+                AND cgsm.tenant_id_ = #{tenantId}
+            </if>
             <if test="search != null and search != ''">
                 AND cg.name_ LIKE CONCAT('%',#{search},'%')
             </if>
@@ -431,6 +452,9 @@
             <if test="userId != null">
                 AND spo.user_id_ = #{userId}
             </if>
+            <if test="tenantId != null">
+                AND spo.tenant_id_ = #{tenantId}
+            </if>
             <if test="type != null">
                 AND spo.type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
@@ -455,6 +479,9 @@
             <if test="userId != null">
                 AND spo.user_id_ = #{userId}
             </if>
+            <if test="tenantId != null">
+                AND spo.tenant_id_ = #{tenantId}
+            </if>
             <if test="type != null">
                 AND spo.type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
@@ -834,6 +861,9 @@
             <if test="musicGroupId != null">
                 AND cg.music_group_id_ = #{musicGroupId}
             </if>
+            <if test="tenantId != null">
+                AND cg.tenant_id_ = #{tenantId}
+            </if>
         </where>
     </sql>
 
@@ -864,6 +894,9 @@
             <if test="isSettlement == 1">
                 AND csts.settlement_time_ IS NOT NULL
             </if>
+            <if test="tenantId != null">
+                AND cg.tenant_id_ = #{tenantId}
+            </if>
         </where>
     </sql>
     <resultMap id="MusicGroupCourseScheduleDto" type="com.ym.mec.biz.dal.dto.MusicGroupCourseScheduleDto">
@@ -1227,7 +1260,7 @@
         FROM class_group cg
         LEFT JOIN class_group_student_mapper cgsm ON cg.id_ = cgsm.class_group_id_
         LEFT JOIN sys_user su ON su.id_ = cgsm.user_id_
-        WHERE su.id_ IS NOT NULL
+        WHERE su.id_ IS NOT NULL and cg.tenant_id_ = #{tenantId}
     </select>
 
     <select id="queryTeacherGroup" resultMap="ImGroupModelMap">
@@ -1235,7 +1268,7 @@
         FROM class_group cg
         LEFT JOIN class_group_teacher_mapper cgtm ON cg.id_ = cgtm.class_group_id_
         LEFT JOIN sys_user su ON su.id_ = cgtm.user_id_
-        WHERE su.id_ IS NOT NULL
+        WHERE su.id_ IS NOT NULL and cg.tenant_id_ = #{tenantId}
     </select>
     <resultMap id="ImUserModelMap" type="com.ym.mec.common.entity.ImUserModel">
         <result property="name" column="real_name_"/>
@@ -1245,7 +1278,7 @@
     <select id="queryImUser" resultMap="ImUserModelMap">
         SELECT su.id_,su.real_name_,su.avatar_ head_url_
         FROM sys_user su
-        WHERE su.id_ IS NOT NULL
+        WHERE su.id_ IS NOT NULL and su.tenant_id_ = #{tenantId}
     </select>
     <select id="findByGroupAndType" resultMap="ClassGroup">
         SELECT * FROM class_group WHERE music_group_id_=#{groupId} AND group_type_=#{groupType} LIMIT 1
@@ -1305,7 +1338,7 @@
                     del_flag_ = #{classGroup.delFlag},
                 </if>
             </set>
-            WHERE id_ = #{classGroup.id}
+            WHERE id_ = #{classGroup.id} and tenant_id_ = #{classGroup.tenantId}
         </foreach>
     </update>
     <update id="updateGroupName">
@@ -1366,6 +1399,9 @@
             <if test="classGroupType!=null">
                 AND cg.type_=#{classGroupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
+            <if test="tenantId != null">
+                AND cg.tenant_id_=#{tenantId}
+            </if>
         </where>
     </sql>
     <select id="superFindClassGroups" resultMap="SuperClassGroupInfo">
@@ -1390,7 +1426,7 @@
         FROM
             class_group_student_mapper cgsm
             LEFT JOIN sys_user su ON cgsm.user_id_ = su.id_
-        WHERE su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_=#{search}
+        WHERE (su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_=#{search}) and cgsm.tenant_id_ = #{tenantId}
     </select>
     <select id="findClassGroupIdsByTeacher" resultType="int">
         SELECT
@@ -1398,10 +1434,7 @@
         FROM
             class_group_teacher_mapper cgtm
             LEFT JOIN sys_user su ON cgtm.user_id_ = su.id_
-        WHERE su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.id_=#{search}
-    </select>
-    <select id="countClassNumByType" resultType="java.lang.Integer">
-        SELECT COUNT(id_) FROM class_group WHERE type_ IN ('HIGH','HIGH_ONLINE') AND del_flag_ = '0'
+        WHERE (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.id_=#{search}) and cgtm.tenant_id_ = #{tenantId}
     </select>
 
     <select id="findClassGroupSubjectNameMaps" resultType="java.util.Map">
@@ -1478,6 +1511,9 @@
             <if test="educationUserId != null">
                 AND mg.educational_teacher_id_ = #{educationUserId}
             </if>
+            <if test="tenant_id_  != null">
+                AND cg.tenant_id_ = #{tenantId}
+            </if>
             <if test="search != null and search != ''">
                 AND (cg.id_ LIKE CONCAT('%',#{search},'%') OR cg.name_ LIKE CONCAT('%',#{search},'%') OR mg.name_ LIKE CONCAT('%',#{search},'%') OR cg.music_group_id_ LIKE CONCAT('%',#{search},'%'))
             </if>

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

@@ -11,6 +11,7 @@
         <result column="class_group_id_" property="classGroupId"/>
         <result column="sub_class_group_id_" property="subClassGroupId"/>
         <result column="create_time_" property="createTime"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -21,7 +22,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="ClassGroupRelation">
         SELECT *
-        FROM class_group_relation
+        FROM class_group_relation where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -33,8 +34,8 @@
         SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
         </selectKey>
         -->
-        INSERT INTO class_group_relation (id_,class_group_id_,sub_class_group_id_,create_time_)
-        VALUES(#{id},#{classGroupId},#{subClassGroupId},now())
+        INSERT INTO class_group_relation (id_,class_group_id_,sub_class_group_id_,create_time_,tenant_id_)
+        VALUES(#{id},#{classGroupId},#{subClassGroupId},now(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -61,21 +62,21 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ClassGroupRelation" parameterType="map">
-        SELECT * FROM class_group_relation ORDER BY id_
+        SELECT * FROM class_group_relation where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM class_group_relation
+        FROM class_group_relation where tenant_id_ = #{tenantId}
     </select>
 
     <!-- 班级关系批量插入 -->
     <insert id="classGroupRelationsInsert" parameterType="java.util.List">
-        INSERT INTO class_group_relation (class_group_id_,sub_class_group_id_,create_time_) VALUES
+        INSERT INTO class_group_relation (class_group_id_,sub_class_group_id_,create_time_,tenant_id_) VALUES
         <foreach collection="classGroupRelationList" item="item" index="index" separator=",">
-            (#{item.classGroupId},#{item.subClassGroupId},now())
+            (#{item.classGroupId},#{item.subClassGroupId},now(),#{item.tenantId})
         </foreach>
     </insert>
 

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

@@ -16,6 +16,7 @@
         <result column="update_time_" property="updateTime"/>
         <result column="username_" property="userName"/>
         <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
 
     <resultMap id="ClassGroupStudentInfoDto" type="com.ym.mec.biz.dal.dto.ClassGroupStudentInfoDto" extends="ClassGroupStudentMapper">
@@ -30,14 +31,14 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="ClassGroupStudentMapper">
-		SELECT * FROM class_group_student_mapper ORDER BY id_
+		SELECT * FROM class_group_student_mapper where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ClassGroupStudentMapper" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-        INSERT INTO class_group_student_mapper (id_,group_type_,music_group_id_,class_group_id_,user_id_,status_,create_time_,update_time_)
-        VALUES(#{id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{classGroupId},#{userId},#{status},now(),now())
+        INSERT INTO class_group_student_mapper (id_,group_type_,music_group_id_,class_group_id_,user_id_,status_,create_time_,update_time_,tenant_id_)
+        VALUES(#{id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{classGroupId},#{userId},#{status},now(),now(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -97,21 +98,21 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ClassGroupStudentMapper" parameterType="map">
-        SELECT * FROM class_group_student_mapper ORDER BY id_
+        SELECT * FROM class_group_student_mapper where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM class_group_student_mapper
+		SELECT COUNT(*) FROM class_group_student_mapper where tenant_id_ = #{tenantId}
 	</select>
 
     <!-- 班级学生批量插入 -->
     <insert id="classGroupStudentsInsert" parameterType="java.util.List">
-        INSERT INTO class_group_student_mapper (group_type_,music_group_id_,class_group_id_,user_id_,status_,create_time_)
+        INSERT INTO class_group_student_mapper (group_type_,music_group_id_,class_group_id_,user_id_,status_,create_time_,tenant_id_)
         VALUE
         <foreach collection="classGroupStudentMapperList" item="item" index="index" separator=",">
-            (#{item.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.musicGroupId},#{item.classGroupId},#{item.userId},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now())
+            (#{item.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.musicGroupId},#{item.classGroupId},#{item.userId},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),#{item.tenantId})
         </foreach>
     </insert>
     
@@ -492,6 +493,9 @@
             <if test="classGroupId!=null">
                 AND cgsm.class_group_id_=#{classGroupId}
             </if>
+            <if test="tenantId!=null">
+                AND cgsm.tenant_id_=#{tenantId}
+            </if>
         </where>
     </select>
     <select id="findGroupStudents" resultMap="ClassGroupStudentMapper">
@@ -509,6 +513,9 @@
             <if test="status!=null">
                 AND status_=#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
+            <if test="tenantId!=null">
+                AND cgsm.tenant_id_=#{tenantId}
+            </if>
         </where>
     </select>
     <select id="getStudentEducationalTeachers" resultType="com.ym.mec.biz.dal.dto.StudentEduTeacherDto">
@@ -611,6 +618,9 @@
             <if test="musicGroupId != null">
                 AND music_group_id_ = #{musicGroupId}
             </if>
+            <if test="tenantId!=null">
+                AND tenant_id_=#{tenantId}
+            </if>
         </where>
     </sql>
     <select id="getStudentClassGroupBishopTeacherMap" resultType="com.ym.mec.biz.dal.dto.BaseMapDto">
@@ -635,6 +645,9 @@
                 #{studentId}
             </foreach>
         </if>
+        <if test="tenantId!=null">
+            AND cgsm.tenant_id_=#{tenantId}
+        </if>
     </select>
 
     <select id="getLessThenThreeClassGroupIds" resultType="java.lang.Long">

+ 15 - 8
mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherMapperMapper.xml

@@ -15,6 +15,7 @@
         <result column="salary_" property="salary"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
 
     <resultMap id="ClassGroupTeacherMapDto" type="com.ym.mec.biz.dal.dto.ClassGroupTeacherMapDto" extends="ClassGroupTeacherMapper">
@@ -30,7 +31,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="ClassGroupTeacherMapper">
         SELECT *
-        FROM class_group_teacher_mapper
+        FROM class_group_teacher_mapper where tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -38,9 +39,9 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper"
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         INSERT INTO class_group_teacher_mapper
-        (group_type_,music_group_id_,class_group_id_,teacher_role_,user_id_,salary_,create_time_,update_time_)
+        (group_type_,music_group_id_,class_group_id_,teacher_role_,user_id_,salary_,create_time_,update_time_,tenant_id_)
         VALUES(#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},
-               #{classGroupId},#{teacherRole},#{userId},#{salary},NOW(),NOW())
+               #{classGroupId},#{teacherRole},#{userId},#{salary},NOW(),NOW(),#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -69,7 +70,7 @@
                 music_group_id_ = #{musicGroupId},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <update id="updateTeacher">
@@ -92,23 +93,23 @@
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ClassGroupTeacherMapper"
             parameterType="map">
-        SELECT * FROM class_group_teacher_mapper ORDER BY id_
+        SELECT * FROM class_group_teacher_mapper where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM class_group_teacher_mapper
+        FROM class_group_teacher_mapper where tenant_id_ = #{tenantId}
     </select>
 
     <!-- 批量插入班级老师 -->
     <insert id="classGroupTeachersInsert" parameterType="java.util.List">
         INSERT INTO class_group_teacher_mapper
-        (id_,group_type_,music_group_id_,class_group_id_,teacher_role_,user_id_,salary_,create_time_,update_time_)
+        (id_,group_type_,music_group_id_,class_group_id_,teacher_role_,user_id_,salary_,create_time_,update_time_,tenant_id_)
         VALUE
         <foreach collection="classGroupTeacherMapperList" item="item" index="index" separator=",">
-            (#{item.id},#{item.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.musicGroupId},#{item.classGroupId},#{item.teacherRole},#{item.userId},#{item.salary},NOW(),NOW())
+            (#{item.id},#{item.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.musicGroupId},#{item.classGroupId},#{item.teacherRole},#{item.userId},#{item.salary},NOW(),NOW(),#{item.tenantId})
         </foreach>
     </insert>
 
@@ -151,6 +152,9 @@
             <if test="musicGroupId != null">
                 AND ct.music_group_id_=#{musicGroupId}
             </if>
+            <if test="tenantId != null">
+                AND ct.tenant_id_=#{tenantId}
+            </if>
         </where>
     </select>
 
@@ -239,6 +243,9 @@
             <if test="musicGroupId != null">
                 AND music_group_id_ = #{musicGroupId}
             </if>
+            <if test="tenantId != null">
+                AND tenant_id_ = #{tenantId}
+            </if>
         </where>
     </sql>
 </mapper>

+ 10 - 3
mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherSalaryMapper.xml

@@ -12,6 +12,7 @@
     <result column="online_classes_salary_" jdbcType="DECIMAL" property="onlineClassesSalary" />
     <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
+	<result column="tenant_id_" property="tenantId" />
   </resultMap>
   <select id="get" parameterType="java.lang.Long" resultMap="ClassGroupTeacherSalary">
      select * from class_group_teacher_salary where id_ = #{id}
@@ -53,6 +54,9 @@
       <if test="updateTime != null">
         update_time_,
       </if>
+      <if test="tenantId != null">
+        tenant_id_,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="groupType != null">
@@ -82,6 +86,9 @@
       <if test="updateTime != null">
         NOW(),
       </if>
+      <if test="tenantId != null">
+        #{tenantId},
+      </if>
     </trim>
   </insert>
   <update id="update" parameterType="com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary">
@@ -111,7 +118,7 @@
       </if>
       update_time_ = NOW()
     </set>
-    where id_ = #{id,jdbcType=BIGINT}
+    where id_ = #{id,jdbcType=BIGINT} and tenant_id_ = #{tenantId}
   </update>
     <update id="updateTeacher">
       UPDATE class_group_teacher_salary SET user_id_ = #{teacherId},update_time_ = NOW()
@@ -119,13 +126,13 @@
     </update>
     <!-- 分页查询 -->
   <select id="queryPage" resultMap="ClassGroupTeacherSalary" parameterType="map">
-    SELECT * FROM class_group_teacher_salary ORDER BY id_
+    SELECT * FROM class_group_teacher_salary where tenant_id_ = #{tenantId} ORDER BY id_
     <include refid="global.limit"/>
   </select>
 
   <!-- 查询当前表的总记录数 -->
   <select id="queryCount" resultType="int">
-    SELECT COUNT(*) FROM class_group_teacher_salary
+    SELECT COUNT(*) FROM class_group_teacher_salary where tenant_id_ = #{tenant_id_}
   </select>
 
   <!-- 获取乐团老师课酬配置表 -->

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

@@ -12,6 +12,7 @@
         <result column="version_" property="version"/>
         <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="CloudTeacher">
@@ -28,8 +29,8 @@
             useGeneratedKeys="true">
         <!--@mbg.generated-->
         insert into cloud_teacher (student_id_, level_, start_time_, end_time_, version_, create_time_,
-        update_time_)
-        values (#{studentId}, #{level}, #{startTime}, #{endTime}, #{version}, NOW(),NOW())
+        update_time_,tenant_id_)
+        values (#{studentId}, #{level}, #{startTime}, #{endTime}, #{version}, NOW(),NOW(),#{tenantId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.CloudTeacher">
         <!--@mbg.generated-->
@@ -53,25 +54,25 @@
             update_time_ = NOW(),
             version_ = version_+1
         </set>
-        where id_ = #{id} AND version_ = #{version}
+        where id_ = #{id} AND version_ = #{version} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="CloudTeacher">
         SELECT *
-        FROM cloud_teacher
+        FROM cloud_teacher where tenant_id_ = #{tenantId}
     </select>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="CloudTeacher" parameterType="map">
-        SELECT * FROM cloud_teacher
+        SELECT * FROM cloud_teacher where tenant_id_ = #{tenantId}
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM cloud_teacher
+        FROM cloud_teacher where tenant_id_ = #{tenantId}
     </select>
 
     <select id="getByStudentId" resultMap="CloudTeacher">

+ 16 - 6
mec-biz/src/main/resources/config/mybatis/CloudTeacherOrderMapper.xml

@@ -22,6 +22,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="music_group_id_" property="musicGroupId"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
     
     <resultMap type="com.ym.mec.biz.dal.dto.CloudTeacherOrderDto" id="CloudTeacherOrderDto">
@@ -59,9 +60,9 @@
             useGeneratedKeys="true">
         <!--@mbg.generated-->
         insert into cloud_teacher_order (organ_id_,student_id_, type_, level_, time_, amount_, refund_amount_, status_,
-        order_id_,start_time_,end_time_,remark_, create_time_, update_time_,music_group_id_,active_remark_)
+        order_id_,start_time_,end_time_,remark_, create_time_, update_time_,music_group_id_,active_remark_,tenant_id_)
         values (#{organId},#{studentId}, #{type},#{level}, #{time}, #{amount}, #{refundAmount},
-        #{status},#{orderId},#{startTime},#{endTime}, #{remark}, NOW(), NOW(),#{musicGroupId},#{activeRemark})
+        #{status},#{orderId},#{startTime},#{endTime}, #{remark}, NOW(), NOW(),#{musicGroupId},#{activeRemark},#{tenantId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.CloudTeacherOrder">
         <!--@mbg.generated-->
@@ -112,13 +113,13 @@
             version_ = version_+1,
             update_time_ = NOW(),
         </set>
-        where id_ = #{id} AND version_ = #{version}
+        where id_ = #{id} AND version_ = #{version} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="CloudTeacherOrder">
         SELECT *
-        FROM cloud_teacher_order
+        FROM cloud_teacher_order where tenant_id_ = #{tenantId}
     </select>
 
     <!-- 分页查询 -->
@@ -133,6 +134,9 @@
         <if test="studentId != null">
         	and cto.student_id_ = #{studentId}
         </if>
+        <if test="tenantId != null">
+        	and cto.tenant_id_ = #{tenantId}
+        </if>
         order by spo.pay_time_ desc,spo.id_ desc
         <include refid="global.limit"/>
     </select>
@@ -148,13 +152,16 @@
         <if test="studentId != null">
         	and cto.student_id_ = #{studentId}
         </if>
+        <if test="tenantId != null">
+        	and cto.tenant_id_ = #{tenantId}
+        </if>
         order by cto.create_time_ desc
     </select>
 
     <select id="getNoStartCloudTeacherOrder" resultMap="CloudTeacherOrder">
         SELECT cto.*
         FROM cloud_teacher_order cto
-        WHERE cto.status_ = 1
+        WHERE cto.status_ = 1 and cto.tenant_id_ = #{tenantId}
     </select>
 
     <select id="getStudentCloudTeacherOrders" resultMap="CloudTeacherOrder">
@@ -262,7 +269,7 @@
         </if>
     </select>
     <select id="getStudentIds" resultType="java.lang.Integer">
-        SELECT DISTINCT student_id_ FROM cloud_teacher_order WHERE active_remark_ IS NULL AND status_ != 0
+        SELECT DISTINCT student_id_ FROM cloud_teacher_order WHERE active_remark_ IS NULL AND status_ != 0 and tenant_id_ = #{tenantId}
     </select>
     <select id="queryActiveAmountMap" resultType="java.util.Map">
         SELECT student_id_ 'key',SUM(amount_) 'value' FROM cloud_teacher_order
@@ -293,6 +300,9 @@
             <if test="teacherId != null">
                 AND st.teacher_id_ = #{teacherId}
             </if>
+            <if test="tenantId != null">
+                AND cto.tenant_id_ = #{tenantId}
+            </if>
             <if test="remarkType != null and remarkType != ''">
                 AND cto.remark_ = #{remarkType}
             </if>

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

@@ -11,6 +11,7 @@
 		<result column="mobile_no_" property="mobileNo" />
 		<result column="job_" property="job" />
 		<result column="create_time_" property="createTime" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -22,7 +23,7 @@
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="CooperationOrganLinkman">
 		SELECT * FROM
-		cooperation_organ_linkman ORDER BY id_
+		cooperation_organ_linkman where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -31,16 +32,16 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO cooperation_organ_linkman
-		(id_,cooperation_organ_id_,linkman_,mobile_no_,job_,create_time_)
-		VALUES(#{id},#{cooperationOrganId},#{linkman},#{mobileNo},#{job},#{createTime})
+		(id_,cooperation_organ_id_,linkman_,mobile_no_,job_,create_time_,tenant_id_)
+		VALUES(#{id},#{cooperationOrganId},#{linkman},#{mobileNo},#{job},#{createTime},#{tenantId})
 	</insert>
 	
 	<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO cooperation_organ_linkman
-		(id_,cooperation_organ_id_,linkman_,mobile_no_,job_,create_time_)
+		(id_,cooperation_organ_id_,linkman_,mobile_no_,job_,create_time_,tenant_id_)
 		VALUES
 		<foreach collection="list" item="item" separator=",">
-		(#{item.id},#{item.cooperationOrganId},#{item.linkman},#{item.mobileNo},#{item.job},#{item.createTime})
+		(#{item.id},#{item.cooperationOrganId},#{item.linkman},#{item.mobileNo},#{item.job},#{item.createTime},#{itemm.tenantId})
 		</foreach>
 	</insert>
 
@@ -67,7 +68,7 @@
 				create_time_ = #{createTime},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.CooperationOrganLinkman">
@@ -93,7 +94,7 @@
 					create_time_ = #{cooperationOrganLinkman.createTime},
 				</if>
 			</set>
-			WHERE id_ = #{cooperationOrganLinkman.id}
+			WHERE id_ = #{cooperationOrganLinkman.id} and tenant_id_ = #{cooperationOrganLinkman.tenantId}
         </foreach>
 	</update>
 
@@ -104,13 +105,13 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="CooperationOrganLinkman" parameterType="map">
-		SELECT * FROM cooperation_organ_linkman ORDER BY id_
+		SELECT * FROM cooperation_organ_linkman where tenant_id_ = #{tenantId} ORDER BY id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM cooperation_organ_linkman
+		SELECT COUNT(*) FROM cooperation_organ_linkman where tenant_id_ = #{tenantId}
 	</select>
 	
 	<select id="queryByCooperationOrganId" resultMap="CooperationOrganLinkman">

+ 10 - 6
mec-biz/src/main/resources/config/mybatis/CooperationOrganMapper.xml

@@ -20,6 +20,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="full_job_resource_" property="fullJobResource"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.CooperationOrgan" id="ExtCooperationOrgan" extends="CooperationOrgan">
@@ -42,7 +43,7 @@
     <select id="findAll" resultMap="CooperationOrgan">
         SELECT *
         FROM cooperation_organ
-        WHERE del_flag_ != 1
+        WHERE del_flag_ != 1 and tenant_id_ = #{tenantId}
         ORDER BY id_
     </select>
 
@@ -51,10 +52,10 @@
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         INSERT INTO cooperation_organ
         (id_, name_, linkman_, job_, mobile_no_, address_, organ_id_, create_time_, update_time_, ownership_type_,
-         is_enable_, full_job_resource_,education_user_id_)
+         is_enable_, full_job_resource_,education_user_id_,tenant_id_)
         VALUES (#{id}, #{name}, #{linkman}, #{job}, #{mobileNo}, #{address}, #{organId}, now(), now(),
                 #{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{isEnable},
-                #{fullJobResource},#{educationUserId})
+                #{fullJobResource},#{educationUserId},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -95,7 +96,7 @@
                 is_enable_ = #{isEnable},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -133,6 +134,9 @@
             <if test="isEnable != null">
                 AND co.is_enable_ = #{isEnable}
             </if>
+            <if test="tenantId != null">
+                AND co.tenant_id_ = #{tenantId}
+            </if>
             <if test="fullJobResource != null">
                 AND co.full_job_resource_ = #{fullJobResource}
             </if>
@@ -165,7 +169,7 @@
         SELECT organ_id_ organId, COUNT(*) num
         FROM cooperation_organ
         WHERE full_job_resource_ = 1
-          AND del_flag_ = 0
+          AND del_flag_ = 0 and tenant_id_ = #{tenantId}
         GROUP BY organ_id_
     </select>
 
@@ -173,7 +177,7 @@
     <select id="getAllCooperationOrgan" resultMap="CooperationOrgan">
         SELECT *
         FROM cooperation_organ
-        WHERE del_flag_ = 0
+        WHERE del_flag_ = 0 and tenant_id_ = #{tenantId}
     </select>
 
     <!-- 获取合作单位乐团的的学校缴费 -->

+ 16 - 5
mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml

@@ -20,6 +20,7 @@
 		<result column="completed_num_" property="completedNum" />
 		<result column="expect_num_" property="expectNum" />
 		<result column="expiry_date_" property="expiryDate" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 
 	<resultMap type="com.ym.mec.biz.dal.dto.CourseHomeworkListDto" id="CourseHomeworkDto">
@@ -53,16 +54,16 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="CourseHomework">
-		SELECT * FROM course_homework ORDER BY id_
+		SELECT * FROM course_homework where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseHomework" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO course_homework (group_type_,course_schedule_id_,attachments_,
-		                             title_,content_,create_time_,update_time_,music_group_id_,class_group_id_,completed_num_,expect_num_,expiry_date_)
+		                             title_,content_,create_time_,update_time_,music_group_id_,class_group_id_,completed_num_,expect_num_,expiry_date_,tenant_id_)
 		VALUES(#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 		       #{courseScheduleId},#{attachments},#{title},#{content},now(),now(),#{musicGroupId},
-		       #{classGroupId},#{completedNum},#{expectNum},#{expiryDate})
+		       #{classGroupId},#{completedNum},#{expectNum},#{expiryDate},#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -102,7 +103,7 @@
 			</if>
 			update_time_ = NOW()
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -125,6 +126,9 @@
 			<if test="userId != null">
 				and cs.actual_teacher_id_ = #{userId}
 			</if>
+			<if test="tenantId != null">
+				and ch.tenant_id_ = #{tenantId}
+			</if>
 		</where>
 	</sql>
 	
@@ -154,6 +158,7 @@
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM course_homework
+		<include refid="queryCondition"/>
 	</select>
 
 	<resultMap id="teacherHomeworkListDto" type="com.ym.mec.biz.dal.dto.TeacherHomeworkListDto">
@@ -204,6 +209,9 @@
 			<if test="classGroupId!=null">
 				AND ch.class_group_id_=#{classGroupId}
 			</if>
+			<if test="tenantId != null">
+				AND ch.tenant_id_=#{tenantId}
+			</if>
 			<if test="createTime!=null">
 				AND DATE_FORMAT(class_date_, '%Y-%m')=DATE_FORMAT(#{createTime}, '%Y-%m')
 			</if>
@@ -220,6 +228,9 @@
 			<if test="classGroupId!=null">
 				AND ch.class_group_id_=#{classGroupId}
 			</if>
+			<if test="tenantId != null">
+				AND ch.tenant_id_=#{tenantId}
+			</if>
 			<if test="createTime!=null">
 				AND DATE_FORMAT(class_date_, '%Y-%m')=DATE_FORMAT(#{createTime}, '%Y-%m')
 			</if>
@@ -299,7 +310,7 @@
 	</select>
 	<sql id="queryHomePageSql">
 		<where>
-			cs.group_type_ = #{groupType}
+			cs.group_type_ = #{groupType} and cs.tenant_id_ = #{tenantId}
 			<if test="organId != null">
 				AND FIND_IN_SET(cs.organ_id_,#{organId})
 			</if>

+ 8 - 4
mec-biz/src/main/resources/config/mybatis/CourseHomeworkTemplateMapper.xml

@@ -17,6 +17,7 @@
                 typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="subject_id_" property="subjectId"/>
         <result column="subject_name_" property="subjectName"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -26,7 +27,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="CourseHomeworkTemplate">
-		SELECT * FROM course_homework_template ORDER BY id_
+		SELECT * FROM course_homework_template where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -38,8 +39,8 @@
         </selectKey>
         -->
         INSERT INTO course_homework_template
-        (id_,name_,content_,create_time_,update_time_,class_group_type_,subject_id_)
-        VALUES(#{id},#{name},#{content},now(),now(),#{classGroupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subjectId})
+        (id_,name_,content_,create_time_,update_time_,class_group_type_,subject_id_,tenant_id_)
+        VALUES(#{id},#{name},#{content},now(),now(),#{classGroupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subjectId},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -65,7 +66,7 @@
                 name_ = #{name},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -85,6 +86,9 @@
             <if test="classType != null and classType!=''">
                 and class_group_type_ = #{classType}
             </if>
+            <if test="tenantId != null">
+                and cht.tenant_id_ = #{tenantId}
+            </if>
         </where>
     </sql>
 

+ 6 - 5
mec-biz/src/main/resources/config/mybatis/CourseScheduleComplaintsMapper.xml

@@ -19,6 +19,7 @@
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="score_" property="score" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -28,7 +29,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="CourseScheduleComplaints">
-		SELECT * FROM course_schedule_complaints ORDER BY id_
+		SELECT * FROM course_schedule_complaints where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -38,7 +39,7 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
 		</selectKey>
 		-->
-		INSERT INTO course_schedule_complaints (id_,user_id_,course_schedule_id_,reason_,status_,wf_process_id_,wf_order_id_,create_time_,update_time_,teacher_liability_ratio_,student_liability_ratio_,score_) VALUES(#{id},#{userId},#{courseScheduleId},#{reason},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{wfProcessId},#{wfOrderId},now(),now(),#{teacherLiabilityRatio},#{studentLiabilityRatio},#{score})
+		INSERT INTO course_schedule_complaints (id_,user_id_,course_schedule_id_,reason_,status_,wf_process_id_,wf_order_id_,create_time_,update_time_,teacher_liability_ratio_,student_liability_ratio_,score_,tenant_id_) VALUES(#{id},#{userId},#{courseScheduleId},#{reason},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{wfProcessId},#{wfOrderId},now(),now(),#{teacherLiabilityRatio},#{studentLiabilityRatio},#{score},#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -78,7 +79,7 @@
 			<if test="score != null">
 				score_ = #{score},
 			</if>
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -97,12 +98,12 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="CourseScheduleComplaints" parameterType="map">
-		SELECT * FROM course_schedule_complaints WHERE score_ &lt;= 2 ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM course_schedule_complaints WHERE score_ &lt;= 2 and tenant_id_ = #{tenantId} ORDER BY id_ <include refid="global.limit"/>
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM course_schedule_complaints
+		SELECT COUNT(*) FROM course_schedule_complaints WHERE score_ &lt;= 2 and tenant_id_ = #{tenantId}
 	</select>
     <select id="findByUserAndCourse" resultMap="CourseScheduleComplaints">
 		SELECT * FROM course_schedule_complaints WHERE user_id_=#{userId} AND course_schedule_id_=#{courseScheduleId}

+ 24 - 5
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -26,6 +26,7 @@
         <result column="student_id_list_" jdbcType="VARCHAR" property="studentIdList"/>
         <result column="group_name_" jdbcType="VARCHAR" property="groupName"/>
         <result column="status_" jdbcType="TINYINT" property="status"/>
+		<result column="tenant_id_" property="tenantId" />
     </resultMap>
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleEvaluate" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
@@ -33,14 +34,14 @@
                                               song_, times_, total_minutes_,
                                               teaching_material_, teacher_id_, item_, comment_, create_time_,
                                               update_time_,
-                                              student_id_list_, version_, status_)
+                                              student_id_list_, version_, status_, tenant_id_)
         values (#{musicGroupId,jdbcType=VARCHAR}, #{classGroupId,jdbcType=INTEGER}, #{courseScheduleId,jdbcType=BIGINT},
                 #{musicTheory,jdbcType=VARCHAR}, #{song,jdbcType=VARCHAR}, #{times,jdbcType=INTEGER}, #{totalMinutes},
                 #{teachingMaterial,jdbcType=VARCHAR},
                 #{teacherId,jdbcType=INTEGER}, #{item,jdbcType=VARCHAR}, #{comment,jdbcType=LONGVARCHAR},
                 #{createTime,jdbcType=TIMESTAMP},
                 #{updateTime,jdbcType=TIMESTAMP}, #{studentIdList}, #{version,jdbcType=INTEGER},
-                #{status,jdbcType=TINYINT})
+                #{status,jdbcType=TINYINT},#{tenantId})
     </insert>
 
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleEvaluate">
@@ -92,7 +93,7 @@
                 update_time_ = #{updateTime}
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <select id="get" resultMap="CourseScheduleEvaluate">
@@ -138,6 +139,7 @@
         WHERE group_status_ != 'LOCK'
           AND group_status_ != 'CANCEL'
           AND type_='FREE'
+          and tenant_id_ = #{tenantId}
         GROUP BY organ_id_
     </select>
 
@@ -148,6 +150,7 @@
         WHERE group_status_ != 'LOCK'
           AND group_status_ != 'CANCEL'
           AND buy_months_ >= 1
+          and tenant_id_ = #{tenantId}
         GROUP BY organ_id_
     </select>
 
@@ -159,6 +162,7 @@
             AND pg.type_='FREE'
             AND pg.group_status_ != 'LOCK'
             AND cse.status_ = 1
+          and cse.tenant_id_ = #{tenantId}
         GROUP BY pg.organ_id_
     </select>
 
@@ -173,6 +177,7 @@
           AND cs.del_flag_ = 0
           AND pg.type_='FREE'
           AND pg.group_status_ != 'LOCK'
+          and cs.tenant_id_ = #{tenantId}
         GROUP BY cs.class_group_id_, pg.organ_id_
     </select>
 
@@ -182,12 +187,14 @@
         FROM student_payment_order
         WHERE group_type_ = 'PRACTICE'
           AND status_ = 'SUCCESS'
+          and tenant_id_ = #{tenantId}
         GROUP BY organ_id_
     </select>
     <select id="findExpiredDateBeforeReport" resultMap="CourseScheduleEvaluate">
         SELECT *
         FROM course_schedule_evaluate
         WHERE status_ = 1
+          and tenant_id_ = #{tenantId}
           AND create_time_ &lt;= #{expiredDate}
           AND (is_pushed_ = 0 OR is_pushed_ IS NULL)
     </select>
@@ -223,6 +230,7 @@
         LEFT JOIN practice_group pg on cse.music_group_id_ = pg.id_
         LEFT JOIN sys_user su ON pg.student_id_=su.id_
         WHERE status_= 0
+          and tenant_id_ = #{tenantId}
         <if test="teacherId != null">
             AND cse.teacher_id_ = #{teacherId}
         </if>
@@ -233,7 +241,7 @@
         INSERT INTO course_schedule_evaluate (music_group_id_, class_group_id_, course_schedule_id_, music_theory_,
         song_,teaching_material_, teacher_id_, item_, comment_, create_time_,update_time_,student_id_list_, version_,
         status_,
-        times_,total_minutes_)
+        times_,total_minutes_,tenant_id_)
         VALUE
         <foreach collection="list" item="evaluate" separator=",">
             (#{evaluate.musicGroupId,jdbcType=VARCHAR}, #{evaluate.classGroupId,jdbcType=INTEGER},
@@ -244,7 +252,7 @@
             #{evaluate.comment,jdbcType=LONGVARCHAR}, #{evaluate.createTime,jdbcType=LONGVARCHAR},
             #{evaluate.updateTime,jdbcType=LONGVARCHAR}, #{evaluate.studentIdList},
             #{evaluate.version,jdbcType=INTEGER}, #{evaluate.status,jdbcType=TINYINT},
-            #{evaluate.times,jdbcType=INTEGER},#{evaluate.totalMinutes,jdbcType=INTEGER})
+            #{evaluate.times,jdbcType=INTEGER},#{evaluate.totalMinutes,jdbcType=INTEGER},#{evaluate.tenantId})
         </foreach>
     </insert>
 
@@ -271,6 +279,7 @@
           AND group_status_ != 'CANCEL'
           AND buy_months_ >= 1
           AND be_renew_group_id_ >= 1
+          and tenant_id_ = #{tenantId}
         GROUP BY organ_id_
     </select>
 
@@ -281,6 +290,7 @@
         WHERE type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
           AND create_time_ >= #{startTime}
           AND status_ = 'SUCCESS'
+          and tenant_id_ = #{tenantId}
         GROUP BY organ_id_
     </select>
 
@@ -295,6 +305,7 @@
         WHERE group_status_ != 'LOCK'
         AND group_status_ != 'CANCEL'
         AND buy_months_ >= 1
+        and tenant_id_ = #{tenantId}
         <if test="type==@com.ym.mec.biz.dal.enums.OrderTypeEnum@PRACTICE_GROUP_BUY">
             <![CDATA[ AND be_renew_group_id_ IS NULL AND create_time_ < #{startTime} ]]>
         </if>
@@ -327,6 +338,7 @@
         WHERE pg.group_status_ IN ('NORMAL', 'FINISH')
           AND s.operating_tag_ = 1
           AND pg.type_='FREE'
+          and pg.tenant_id_ = #{tenantId}
         GROUP BY pg.organ_id_
     </select>
 
@@ -338,6 +350,7 @@
         WHERE pg.group_status_ IN ('NORMAL', 'FINISH')
           AND pg.buy_months_ >= 1
           AND s.operating_tag_ = 0
+          and pg.tenant_id_ = #{tenantId}
         GROUP BY pg.organ_id_
     </select>
 
@@ -352,6 +365,7 @@
           AND vg.id_ >= 1
           AND (cs.is_lock_ IS NULL OR cs.is_lock_ = 0)
           AND s.operating_tag_ = 0
+          and cssp.tenant_id_ = #{tenantId}
         GROUP BY vg.organ_id_
     </select>
 
@@ -367,6 +381,7 @@
           AND cs.id_ >= 1
           AND (cs.is_lock_ IS NULL OR cs.is_lock_ = 0)
           AND s.operating_tag_ = 0
+          and pg.tenant_id_ = #{tenantId}
         GROUP BY pg.organ_id_
     </select>
 
@@ -382,6 +397,7 @@
         AND cs.teach_mode_ = 'ONLINE'
         AND (cs.is_lock_ IS NULL OR cs.is_lock_=0)
         AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
+          and cssp.tenant_id_ = #{tenantId}
         GROUP BY su.organ_id_
     </select>
 
@@ -399,6 +415,7 @@
         <if test="endDate != null">
             <![CDATA[AND CONCAT(cs.class_date_, ' ', cs.end_class_time_) < #{endDate}]]>
         </if>
+          and cssp.tenant_id_ = #{tenantId}
         AND pg.buy_months_ >= 1
         GROUP BY pg.organ_id_
     </select>
@@ -424,6 +441,7 @@
             <![CDATA[AND CONCAT(vcs.class_date_, ' ', vcs.end_class_time_) < #{endDate}
             AND CONCAT(pcs.class_date_, ' ', pcs.end_class_time_) < #{endDate}]]>
         </if>
+          and pg.tenant_id_ = #{tenantId}
         AND pg.buy_months_ >= 1
         GROUP BY pg.organ_id_
     </select>
@@ -435,6 +453,7 @@
                  LEFT JOIN sys_user su ON su.id_ = s.user_id_
         WHERE s.operating_tag_ = 1
           AND su.organ_id_ > 0
+          and s.tenant_id_ = #{tenantId}
           AND su.user_type_ LIKE '%STUDENT%'
         GROUP BY su.organ_id_
     </select>

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

@@ -181,7 +181,7 @@
     <!-- 全查询 -->
     <select id="findAll" resultMap="CourseSchedule">
         SELECT <include refid="resultSql"/>
-        FROM course_schedule cs
+        FROM course_schedule cs where tenant_id_ = #{tenantId}
         ORDER BY cs.id_
     </select>
 
@@ -222,9 +222,6 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseSchedule">
         UPDATE course_schedule
         <set>
-            <if test="tenantId != null">
-                tenant_id_ = #{tenantId},
-            </if>
             <if test="validEndTime != null">
                 valid_end_time_ = #{validEndTime},
             </if>
@@ -299,7 +296,7 @@
             </if>
             update_time_ = NOW()
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -392,14 +389,14 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="CourseSchedule" parameterType="map">
-        SELECT * FROM course_schedule ORDER BY id_
+        SELECT * FROM course_schedule where tenant_id_ = #{tenantId} ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM course_schedule
+        FROM course_schedule where tenant_id_ = #{tenantId}
     </select>
 
     <resultMap type="com.ym.mec.biz.dal.dto.TeacherAttendanceDto" id="TeacherAttendanceViewUtilEntity">

+ 0 - 6
mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java

@@ -6,8 +6,6 @@ import org.springframework.web.bind.annotation.GetMapping;
 import com.ym.mec.common.config.FeignConfiguration;
 import com.ym.mec.task.fallback.TaskRemoteServiceFallback;
 
-import java.util.Date;
-
 @FeignClient(name = "web-server", contextId = "TaskRemoteService", configuration = { FeignConfiguration.class }, fallback = TaskRemoteServiceFallback.class)
 public interface TaskRemoteService {
 
@@ -188,10 +186,6 @@ public interface TaskRemoteService {
 	@GetMapping("task/salaryMarkNew")
 	void salaryMarkNew();
 
-	//乐团云教练订单
-	@GetMapping("task/checkCloudOrderStart")
-	void checkCloudOrderStart();
-
 	//同步即时通讯聊天记录
 	@GetMapping("task/syncImHistoryMessageTask")
     void syncImHistoryMessageTask();

+ 0 - 5
mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java

@@ -233,11 +233,6 @@ public class TaskRemoteServiceFallback implements TaskRemoteService {
 		logger.error("大雅基本工资标记失败");
 	}
 
-	@Override
-	public void checkCloudOrderStart() {
-		logger.error("乐团云教练订单生效处理失败");
-	}
-
     @Override
     public void syncImHistoryMessageTask() {
 		logger.error("同步即时通讯聊天记录失败");

+ 12 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/page/QueryInfo.java

@@ -7,6 +7,8 @@
  */
 package com.ym.mec.common.page;
 
+import com.ym.mec.common.tenant.TenantContextHolder;
+
 /**
  * 查询对象基类
  */
@@ -29,6 +31,8 @@ public class QueryInfo {
 	private String order = "DESC";
 	
 	private String search;
+
+	private Integer tenantId = TenantContextHolder.getTenantId();
 	
 	public String getSearch() {
 		return search;
@@ -85,4 +89,12 @@ public class QueryInfo {
 	public void setOrder(String order) {
 		this.order = order;
 	}
+
+	public Integer getTenantId() {
+		return tenantId;
+	}
+
+	public void setTenantId(Integer tenantId) {
+		this.tenantId = tenantId;
+	}
 }

+ 69 - 49
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.student.controller;
 
-import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
-import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -46,45 +44,65 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.dao.ChildrenDayDegreeDetailDao;
+import com.ym.mec.biz.dal.dao.CourseScheduleEvaluateDao;
+import com.ym.mec.biz.dal.dao.DegreeRegistrationDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.OrganizationDao;
+import com.ym.mec.biz.dal.dao.ReplacementInstrumentActivityDao;
+import com.ym.mec.biz.dal.dao.StudentGoodsSellDao;
+import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
+import com.ym.mec.biz.dal.dao.SysCouponCodeDao;
+import com.ym.mec.biz.dal.dao.VipGroupActivityDao;
+import com.ym.mec.biz.dal.dto.CloudTeacherOrderDto;
+import com.ym.mec.biz.dal.dto.LuckStatisDto;
+import com.ym.mec.biz.dal.dto.OrderStatisDto;
+import com.ym.mec.biz.dal.dto.Practice4OrganDto;
+import com.ym.mec.biz.dal.dto.PracticeGroupStatisDto;
+import com.ym.mec.biz.dal.dto.PracticeGroupsDto;
+import com.ym.mec.biz.dal.dto.StudentPaymentOrderDto;
+import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
+import com.ym.mec.biz.dal.dto.VipBuyResultDto;
+import com.ym.mec.biz.dal.entity.DegreeRegistration;
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.LuckDrawCount;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.Organization;
+import com.ym.mec.biz.dal.entity.SellOrder;
+import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.TenantPaymentOrder;
 import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
-import com.ym.mec.biz.service.*;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
+import com.ym.mec.biz.service.CloudTeacherOrderService;
+import com.ym.mec.biz.service.LuckDrawCountService;
+import com.ym.mec.biz.service.MusicGroupService;
+import com.ym.mec.biz.service.SellOrderService;
+import com.ym.mec.biz.service.SporadicChargeInfoService;
+import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
+import com.ym.mec.biz.service.StudentPaymentOrderService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.TenantPaymentOrderService;
+import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.adapay.ConfigInit;
 import com.ym.mec.thirdparty.adapay.Payment;
 import com.ym.mec.thirdparty.yqpay.Msg;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpStatus;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.DigestUtils;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.net.URLEncoder;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
 
 @RequestMapping("studentOrder")
 @Api(tags = "订单回调")
@@ -538,17 +556,18 @@ public class StudentOrderController extends BaseController {
     @GetMapping("/getPracticeGroupStatis")
     public HttpResponseResult getPracticeGroupStatis() {
         List<Organization> organs = organizationDao.findAllOrgans();
-        List<PracticeGroupsDto> hasReportNums = courseScheduleEvaluateDao.getHasReportNums();
-        List<PracticeGroupsDto> organMoneys = courseScheduleEvaluateDao.getOrganMoney();
-        List<PracticeGroupsDto> organPracticeGroups = courseScheduleEvaluateDao.getOrganPracticeGroups();
-        List<PracticeGroupsDto> practiceGroupsFrees = courseScheduleEvaluateDao.getPracticeGroupsFree();
-        List<PracticeGroupsDto> practiceGroupsBuys = courseScheduleEvaluateDao.getPracticeGroupsBuy();
-        List<PracticeGroupsDto> practiceGroupsRenews = courseScheduleEvaluateDao.getPracticeGroupsRenew();
+        Integer tenantId = TenantContextHolder.getTenantId();
+        List<PracticeGroupsDto> hasReportNums = courseScheduleEvaluateDao.getHasReportNums(tenantId);
+        List<PracticeGroupsDto> organMoneys = courseScheduleEvaluateDao.getOrganMoney(tenantId);
+        List<PracticeGroupsDto> organPracticeGroups = courseScheduleEvaluateDao.getOrganPracticeGroups(tenantId);
+        List<PracticeGroupsDto> practiceGroupsFrees = courseScheduleEvaluateDao.getPracticeGroupsFree(tenantId);
+        List<PracticeGroupsDto> practiceGroupsBuys = courseScheduleEvaluateDao.getPracticeGroupsBuy(tenantId);
+        List<PracticeGroupsDto> practiceGroupsRenews = courseScheduleEvaluateDao.getPracticeGroupsRenew(tenantId);
 
         Date startTime = DateUtil.getFirstDayOfMonth(new Date());
 
-        List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY, startTime);
-        List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW, startTime);
+        List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY, startTime, tenantId);
+        List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW, startTime, tenantId);
 
         //List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getOrganNewPracticeGroupsOfMonth(OrderTypeEnum.PRACTICE_GROUP_BUY,startTime);
         //List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getOrganNewPracticeGroupsOfMonth(OrderTypeEnum.PRACTICE_GROUP_RENEW,startTime);
@@ -682,38 +701,39 @@ public class StudentOrderController extends BaseController {
     public HttpResponseResult getPracticeStatis() {
         Date nowDate = new Date();
         List<Organization> organs = organizationDao.findAllOrgans();
+        Integer tenantId = TenantContextHolder.getTenantId();
         //除去禁止的体验人数
 //        List<Practice4OrganDto> organTryNums = courseScheduleEvaluateDao.getTryNums();
 //        List<Practice4OrganDto> organPracticeTryNums = courseScheduleEvaluateDao.getPracticeTryNums();
 //        List<Practice4OrganDto> organVipTryNums = courseScheduleEvaluateDao.getVipTryNums();
 //        List<Practice4OrganDto> organPracticeAndVipTryNums = courseScheduleEvaluateDao.getPracticeAndVipTryNums();
-        List<Practice4OrganDto> allTryNums = courseScheduleEvaluateDao.getAllTryNums();
+        List<Practice4OrganDto> allTryNums = courseScheduleEvaluateDao.getAllTryNums(tenantId);
 
-        List<Practice4OrganDto> practiceBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(nowDate, null);
-        List<Practice4OrganDto> vipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(nowDate, null);
+        List<Practice4OrganDto> practiceBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(nowDate, null, tenantId);
+        List<Practice4OrganDto> vipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(nowDate, null, tenantId);
 
-        List<Practice4OrganDto> practiceAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(nowDate, null);
+        List<Practice4OrganDto> practiceAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(nowDate, null, tenantId);
         Date startTime = DateUtil.getFirstDayOfMonth(nowDate);
         Date endTime = DateUtil.addMonths(startTime, 1);
 
 
         //当月新增网管课人数
-        List<PracticeGroupsDto> monthOrganPracticeBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY, startTime);
+        List<PracticeGroupsDto> monthOrganPracticeBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY, startTime, tenantId);
         //当月新增VIP人数
-        List<PracticeGroupsDto> monthOrganVipBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.SMALL_CLASS_TO_BUY, startTime);
+        List<PracticeGroupsDto> monthOrganVipBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.SMALL_CLASS_TO_BUY, startTime, tenantId);
         //当月续费人数
-        List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW, startTime);
+        List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW, startTime, tenantId);
 
         //本月总人数
-        List<Practice4OrganDto> nowMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(startTime, endTime);
-        List<Practice4OrganDto> nowMonthVipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(startTime, endTime);
-        List<Practice4OrganDto> nowMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(startTime, endTime);
+        List<Practice4OrganDto> nowMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(startTime, endTime, tenantId);
+        List<Practice4OrganDto> nowMonthVipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(startTime, endTime, tenantId);
+        List<Practice4OrganDto> nowMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(startTime, endTime, tenantId);
 
         //上月总人数
         Date lastMonthStartTime = DateUtil.addMonths(startTime, -1);
-        List<Practice4OrganDto> lastMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(lastMonthStartTime, startTime);
-        List<Practice4OrganDto> lastMonthVipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(lastMonthStartTime, startTime);
-        List<Practice4OrganDto> lastMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(lastMonthStartTime, startTime);
+        List<Practice4OrganDto> lastMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(lastMonthStartTime, startTime, tenantId);
+        List<Practice4OrganDto> lastMonthVipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(lastMonthStartTime, startTime, tenantId);
+        List<Practice4OrganDto> lastMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(lastMonthStartTime, startTime, tenantId);
 
         List<Practice4OrganDto> practice4Organs = new ArrayList<>();
         for (Organization organ : organs) {

+ 0 - 19
mec-task/src/main/java/com/ym/mec/task/jobs/CloudTeacherOrderTask.java

@@ -1,19 +0,0 @@
-package com.ym.mec.task.jobs;
-
-import com.ym.mec.task.TaskRemoteService;
-import com.ym.mec.task.core.BaseTask;
-import com.ym.mec.task.core.TaskException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class CloudTeacherOrderTask extends BaseTask {
-
-	@Autowired
-	private TaskRemoteService taskRemoteService;
-
-	@Override
-	public void execute() throws TaskException {
-		taskRemoteService.checkCloudOrderStart();
-	}
-}

+ 0 - 6
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -450,12 +450,6 @@ public class TaskController extends BaseController {
 		}
 	}
 
-	//处理未生效的乐团云教练订单
-	@GetMapping("/checkCloudOrderStart")
-	public void checkCloudOrderStart(){
-		cloudTeacherOrderService.checkCloudOrderStart();
-	}
-
 	//历史异常数据记录
 	@GetMapping("/indexErrDataRecordTask")
 	public void indexErrDataRecordTask(String date){