瀏覽代碼

add:意见反馈

yonge 3 年之前
父節點
當前提交
52d7f64ec5

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysSuggestion.java

@@ -1,13 +1,16 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.SuggestionType;
+import com.ym.mec.common.entity.BaseEntity;
+
 import io.swagger.annotations.ApiModelProperty;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
  * 对应数据库表(sys_suggestion):
  */
-public class SysSuggestion {
+public class SysSuggestion extends BaseEntity {
 
 	/** 编号 */
 	private Long id;

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

@@ -17,6 +17,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="client_type_" property="clientType"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -26,14 +27,14 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="SysSuggestion">
-		SELECT * FROM sys_suggestion ORDER BY id_
+		SELECT * FROM sys_suggestion where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysSuggestion" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO sys_suggestion (mobile_no_,title_,content_,user_id_,create_time_,client_type_,type_,url_)
-        VALUES(#{mobileNo},#{title},#{content},#{userId},now(),#{clientType},#{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{url})
+        INSERT INTO sys_suggestion (mobile_no_,title_,content_,user_id_,create_time_,client_type_,type_,url_,tenant_id_)
+        VALUES(#{mobileNo},#{title},#{content},#{userId},now(),#{clientType},#{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{url},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -62,7 +63,7 @@
                 type_ = #{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} ans tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -72,6 +73,7 @@
 
     <sql id="queryCondition">
         <where>
+        	ss.tenant_id_ = #{tenantId}
             <if test="type!=null">
                 AND ss.type_ = #{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -24,7 +24,7 @@ import javax.servlet.Filter;
 @EnableDiscoveryClient
 @EnableFeignClients("com.ym.mec")
 @MapperScan(basePackages = {"com.ym.mec.biz.**.dao", "com.yonge.datasource.dao"})
-@ComponentScan(basePackages = {"com.ym.mec", "com.yonge.log"})
+@ComponentScan(basePackages = {"com.ym.mec", "com.yonge.log", "com.yonge.datasource"})
 @Configuration
 @EnableSwagger2Doc
 @EnableAsync