yonge 3 лет назад
Родитель
Сommit
d4be2c733a

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

@@ -2,12 +2,13 @@ package com.ym.mec.biz.dal.entity;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import com.ym.mec.common.entity.BaseEntity;
 import com.ym.mec.common.enums.BaseEnum;
 
 /**
  * 对应数据库表(tenant_entry_activites):
  */
-public class TenantEntryActivities {
+public class TenantEntryActivities extends BaseEntity {
 
 	public enum SuitableUser implements BaseEnum<String, SuitableUser> {
 		NEW("NEW", "新手"), ALL("ALL", "全部");

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

@@ -21,10 +21,12 @@
 		<result column="del_flag_" property="delFlag" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 	
 	<sql id="queryCondition">
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="startDate != null">
 				and (start_date_ &lt;= #{startDate} and end_date_ &gt;= #{startDate})
 			</if>
@@ -45,7 +47,7 @@
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="TenantEntryActivities">
 		SELECT * FROM
-		tenant_entry_activities ORDER BY id_
+		tenant_entry_activities where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -54,8 +56,8 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO tenant_entry_activities
-		(id_,name_,cover_img_,detail_,suitable_user_,tag_,total_price_,discount_price_,purchase_minutes_,give_minutes_,start_date_,end_date_,condition_,del_flag_,create_time_,update_time_)
-		VALUES(#{id},#{name},#{coverImg},#{detail},#{suitableUser, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{tag},#{totalPrice},#{discountPrice},#{purchaseMinutes},#{giveMinutes},#{startDate},#{endDate},#{condition},#{delFlag},#{createTime},#{updateTime})
+		(id_,name_,cover_img_,detail_,suitable_user_,tag_,total_price_,discount_price_,purchase_minutes_,give_minutes_,start_date_,end_date_,condition_,del_flag_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{name},#{coverImg},#{detail},#{suitableUser, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{tag},#{totalPrice},#{discountPrice},#{purchaseMinutes},#{giveMinutes},#{startDate},#{endDate},#{condition},#{delFlag},#{createTime},#{updateTime},#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -111,7 +113,7 @@
 				discount_price_ = #{discountPrice},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->