Browse Source

话题模块重构

傅行帆 6 years ago
parent
commit
a5b03b631b

+ 8
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionLike.java View File

7
 
7
 
8
     private Integer communityId;
8
     private Integer communityId;
9
 
9
 
10
-    private Integer taUserId;
10
+    private Integer taUserVerifyId;
11
 
11
 
12
     private Integer transactionId;
12
     private Integer transactionId;
13
 
13
 
32
     public void setCommunityId(Integer communityId) {
32
     public void setCommunityId(Integer communityId) {
33
         this.communityId = communityId;
33
         this.communityId = communityId;
34
     }
34
     }
35
-
36
-    public Integer getTaUserId() {
37
-        return taUserId;
35
+    
36
+    public Integer getTaUserVerifyId() {
37
+        return taUserVerifyId;
38
     }
38
     }
39
-
40
-    public void setTaUserId(Integer taUserId) {
41
-        this.taUserId = taUserId;
39
+    
40
+    public void setTaUserVerifyId(Integer taUserVerifyId) {
41
+        this.taUserVerifyId = taUserVerifyId;
42
     }
42
     }
43
-
43
+    
44
     public Integer getTransactionId() {
44
     public Integer getTransactionId() {
45
         return transactionId;
45
         return transactionId;
46
     }
46
     }

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java View File

603
         ResponseBean response = new ResponseBean();
603
         ResponseBean response = new ResponseBean();
604
         TpTransactionLike tpTransactionLike = JSONObject.parseObject(paramets, TpTransactionLike.class);
604
         TpTransactionLike tpTransactionLike = JSONObject.parseObject(paramets, TpTransactionLike.class);
605
         tpTransactionLike.setCommunityId(userElement.getCommunityId());
605
         tpTransactionLike.setCommunityId(userElement.getCommunityId());
606
-        tpTransactionLike.setTaUserId(userElement.getId());
606
+        tpTransactionLike.setTaUserVerifyId(userElement.getUserVerifyId());
607
         tpTransactionLike.setCreateDate(new Date());
607
         tpTransactionLike.setCreateDate(new Date());
608
-        TpTransactionLike isUser = tpTransactionLikeMapper.getinvitationId(tpTransactionLike.getTransactionId(), userElement.getCommunityId(), userElement.getId());
608
+        TpTransactionLike isUser = tpTransactionLikeMapper.getinvitationId(tpTransactionLike.getTransactionId(), userElement.getCommunityId(), userElement.getUserVerifyId());
609
         if (null != isUser) {
609
         if (null != isUser) {
610
             response.addError("您已点赞或踩");
610
             response.addError("您已点赞或踩");
611
             return response;
611
             return response;

+ 11
- 11
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionLikeMapper.xml View File

4
   <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransactionLike" >
4
   <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransactionLike" >
5
     <id column="id" property="id" jdbcType="INTEGER" />
5
     <id column="id" property="id" jdbcType="INTEGER" />
6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
-    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
7
+    <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER" />
8
     <result column="transaction_id" property="transactionId" jdbcType="INTEGER" />
8
     <result column="transaction_id" property="transactionId" jdbcType="INTEGER" />
9
     <result column="like_status" property="likeStatus" jdbcType="VARCHAR" />
9
     <result column="like_status" property="likeStatus" jdbcType="VARCHAR" />
10
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
10
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
11
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
12
   </resultMap>
12
   </resultMap>
13
   <sql id="Base_Column_List" >
13
   <sql id="Base_Column_List" >
14
-    id, community_id, ta_user_id, transaction_id, like_status, create_date, update_date
14
+    id, community_id, ta_user_verify_id, transaction_id, like_status, create_date, update_date
15
   </sql>
15
   </sql>
16
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
16
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
17
     select 
17
     select 
24
     where id = #{id,jdbcType=INTEGER}
24
     where id = #{id,jdbcType=INTEGER}
25
   </delete>
25
   </delete>
26
   <insert id="insert" parameterType="com.community.huiju.model.TpTransactionLike" >
26
   <insert id="insert" parameterType="com.community.huiju.model.TpTransactionLike" >
27
-    insert into tp_transaction_like (id, community_id, ta_user_id, 
27
+    insert into tp_transaction_like (id, community_id, ta_user_verify_id,
28
       transaction_id, like_status, create_date, 
28
       transaction_id, like_status, create_date, 
29
       update_date)
29
       update_date)
30
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER}, 
30
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserVerifyId,jdbcType=INTEGER},
31
       #{transactionId,jdbcType=INTEGER}, #{likeStatus,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
31
       #{transactionId,jdbcType=INTEGER}, #{likeStatus,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
32
       #{updateDate,jdbcType=TIMESTAMP})
32
       #{updateDate,jdbcType=TIMESTAMP})
33
   </insert>
33
   </insert>
40
       <if test="communityId != null" >
40
       <if test="communityId != null" >
41
         community_id,
41
         community_id,
42
       </if>
42
       </if>
43
-      <if test="taUserId != null" >
44
-        ta_user_id,
43
+      <if test="taUserVerifyId != null" >
44
+        ta_user_verify_id,
45
       </if>
45
       </if>
46
       <if test="transactionId != null" >
46
       <if test="transactionId != null" >
47
         transaction_id,
47
         transaction_id,
63
       <if test="communityId != null" >
63
       <if test="communityId != null" >
64
         #{communityId,jdbcType=INTEGER},
64
         #{communityId,jdbcType=INTEGER},
65
       </if>
65
       </if>
66
-      <if test="taUserId != null" >
67
-        #{taUserId,jdbcType=INTEGER},
66
+      <if test="taUserVerifyId != null" >
67
+        #{taUserVerifyId,jdbcType=INTEGER},
68
       </if>
68
       </if>
69
       <if test="transactionId != null" >
69
       <if test="transactionId != null" >
70
         #{transactionId,jdbcType=INTEGER},
70
         #{transactionId,jdbcType=INTEGER},
86
       <if test="communityId != null" >
86
       <if test="communityId != null" >
87
         community_id = #{communityId,jdbcType=INTEGER},
87
         community_id = #{communityId,jdbcType=INTEGER},
88
       </if>
88
       </if>
89
-      <if test="taUserId != null" >
90
-        ta_user_id = #{taUserId,jdbcType=INTEGER},
89
+      <if test="taUserVerifyId != null" >
90
+        ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
91
       </if>
91
       </if>
92
       <if test="transactionId != null" >
92
       <if test="transactionId != null" >
93
         transaction_id = #{transactionId,jdbcType=INTEGER},
93
         transaction_id = #{transactionId,jdbcType=INTEGER},
107
   <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTransactionLike" >
107
   <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTransactionLike" >
108
     update tp_transaction_like
108
     update tp_transaction_like
109
     set community_id = #{communityId,jdbcType=INTEGER},
109
     set community_id = #{communityId,jdbcType=INTEGER},
110
-      ta_user_id = #{taUserId,jdbcType=INTEGER},
110
+      ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
111
       transaction_id = #{transactionId,jdbcType=INTEGER},
111
       transaction_id = #{transactionId,jdbcType=INTEGER},
112
       like_status = #{likeStatus,jdbcType=VARCHAR},
112
       like_status = #{likeStatus,jdbcType=VARCHAR},
113
       create_date = #{createDate,jdbcType=TIMESTAMP},
113
       create_date = #{createDate,jdbcType=TIMESTAMP},

+ 2
- 19
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml View File

291
       #{reportReasonId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},#{createDate,jdbcType=TIMESTAMP})
291
       #{reportReasonId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},#{createDate,jdbcType=TIMESTAMP})
292
   </insert>
292
   </insert>
293
     <select id="getUserTransactionList" resultMap="BaseResultMap">
293
     <select id="getUserTransactionList" resultMap="BaseResultMap">
294
-
295
         SELECT
294
         SELECT
296
         <include refid="Base_Column_List"/>
295
         <include refid="Base_Column_List"/>
297
         FROM
296
         FROM
298
         tp_transaction t
297
         tp_transaction t
299
-        WHERE t.create_user=#{id,jdbcType=INTEGER}
300
-        AND t.community_id=#{communityId,jdbcType=INTEGER}
301
-        UNION ALL
302
-        SELECT
303
-        <include refid="Base_Column_List"/>
304
-        FROM
305
-        tp_transaction t
306
-        INNER JOIN(SELECT
307
-        y.transaction_id
308
-        FROM
309
-        tp_transaction_reply y
310
-        LEFT JOIN tp_transaction t ON y.transaction_id = t.id
311
         WHERE
298
         WHERE
312
-        y.ta_user_id = #{id,jdbcType=INTEGER}
313
-        AND y.community_id = #{communityId,jdbcType=INTEGER}
314
-        AND y.transaction_id NOT IN ( SELECT t.id FROM tp_transaction t WHERE t.create_user = #{id,jdbcType=INTEGER} AND
315
-        t.community_id = #{communityId,jdbcType=INTEGER} )
316
-        GROUP BY
317
-        y.transaction_id) a ON a.transaction_id = t.id
299
+        t.community_id=#{communityId,jdbcType=INTEGER}
300
+        AND t.uuid = #{id} and t.uuid_type = 'app'
318
         order by create_date DESC
301
         order by create_date DESC
319
     </select>
302
     </select>
320
 </mapper>
303
 </mapper>