yonge 3 years ago
parent
commit
e7e0a51399

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

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

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

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

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

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

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

@@ -1063,7 +1063,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		String configValue1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_CREATE_PAYMENT_CALENDER, tenantId);
 		if(StringUtils.isNotEmpty(configValue1)){
 			//获取关联的乐团列表
-			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIds);
+			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIds,tenantId);
 			String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
 			if(musicGroupIds.size() > 0){
 				List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,musicGroupIds);
@@ -1281,7 +1281,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 		if(!flag5){
 			//获取关联的乐团列表
-			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIdsStr);
+			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIdsStr,tenantId);
 			if(musicGroupIds.size() > 0){
 				String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
 				date = new Date();

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

@@ -9,6 +9,8 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;

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

@@ -39,6 +39,7 @@ import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 
@@ -639,7 +640,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		if(StringUtils.isNotBlank(organIdsStr)){
 			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
 		}
-		return musicGroupPaymentCalenderDetailDao.getNoPaymentStudentMusicGroups(organIds);
+		return musicGroupPaymentCalenderDetailDao.getNoPaymentStudentMusicGroups(organIds, TenantContextHolder.getTenantId());
 	}
 
 	@Override

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

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

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

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

+ 11 - 24
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

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

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

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

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

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

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

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

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

@@ -10,18 +10,19 @@
     <result column="original_amount_" jdbcType="TINYINT" property="originalAmount" />
     <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
   </resultMap>
   <sql id="Base_Column_List">
-    id_, activity_id_, calender_id_, optional_flag_,actual_amount_ ,original_amount_, create_time_, update_time_
+    id_, activity_id_, calender_id_, optional_flag_,actual_amount_ ,original_amount_, create_time_, update_time_,tenant_id_
   </sql>
 
   <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
           parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity">
-    insert into music_group_payment_calender_activity(activity_id_, calender_id_, optional_flag_, actual_amount_ ,original_amount_, create_time_, update_time_)
+    insert into music_group_payment_calender_activity(activity_id_, calender_id_, optional_flag_, actual_amount_ ,original_amount_, create_time_, update_time_,tenant_id_)
     values
     <foreach collection="calenderActivityList" item="entity" separator=",">
       (#{entity.activityId}, #{entity.calenderId}, #{entity.optionalFlag}, #{entity.actualAmount},
-      #{entity.originalAmount}, NOW(), NOW())
+      #{entity.originalAmount}, NOW(), NOW(),#{entity.tenantId})
     </foreach>
   </insert>
   <delete id="delByCalenderId">

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

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

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

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