傅行帆 6 år sedan
förälder
incheckning
6820e9c914

+ 26
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java Visa fil

@@ -38,6 +38,16 @@ public class TpMessage {
38 38
     private Integer updateUser;
39 39
 
40 40
     private Date updateDate;
41
+    
42
+    /**
43
+     * 工单状态
44
+     */
45
+    private String ticketStatus;
46
+    
47
+    /**
48
+     * 工单扭转自动添加的内容
49
+     */
50
+    private String content;
41 51
 
42 52
     public Integer getId() {
43 53
         return id;
@@ -182,4 +192,20 @@ public class TpMessage {
182 192
     public void setUpdateDate(Date updateDate) {
183 193
         this.updateDate = updateDate;
184 194
     }
195
+    
196
+    public String getTicketStatus() {
197
+        return ticketStatus;
198
+    }
199
+    
200
+    public void setTicketStatus(String ticketStatus) {
201
+        this.ticketStatus = ticketStatus;
202
+    }
203
+    
204
+    public String getContent() {
205
+        return content;
206
+    }
207
+    
208
+    public void setContent(String content) {
209
+        this.content = content;
210
+    }
185 211
 }

+ 34
- 9
CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml Visa fil

@@ -20,6 +20,8 @@
20 20
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
21 21
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
22 22
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
23
+    <result column="ticket_status" property="ticketStatus" jdbcType="VARCHAR" />
24
+    <result column="content" property="content" jdbcType="VARCHAR" />
23 25
   </resultMap>
24 26
   <sql id="Base_Column_List" >
25 27
     id, ticket_id,community_id, message_type, advice_type, model_type, uuid, uuid_type, source,
@@ -260,18 +262,41 @@
260 262
 
261 263
   <select id="getMessages" resultMap="BaseResultMap">
262 264
     SELECT
263
-      <include refid="Base_Column_List" />
265
+        t.id,
266
+        t.ticket_id,
267
+        t.community_id,
268
+        t.message_type,
269
+        t.advice_type,
270
+        t.model_type,
271
+        t.uuid,
272
+        t.uuid_type,
273
+        t.source,
274
+        t.message_content,
275
+        t.STATUS,
276
+        t.result,
277
+        t.meaasge_type_id,
278
+        t.read_status,
279
+        t.create_user,
280
+        t.create_date,
281
+        t.update_user,
282
+        t.update_date,
283
+        k.status,
284
+        r.content,
285
+        d.name as ticket_status
264 286
     FROM
265
-        tp_message
287
+        tp_message t
288
+    LEFT JOIN tp_ticket k on t.ticket_id = k.id  AND k.community_id = #{communityId,jdbcType=INTEGER}
289
+    LEFT JOIN tp_ticket_record r on t.ticket_id = r.ticket_id AND r.community_id = #{communityId,jdbcType=INTEGER}  AND k.status = r.status
290
+    LEFT JOIN sys_dictionary d on k.status = d.code AND d.group_id = ( SELECT id FROM sys_dictionary WHERE CODE = "ticket_status" )
266 291
     WHERE
267
-        uuid_type = 1
268
-        AND community_id = #{communityId,jdbcType=INTEGER}
269
-        AND uuid = #{userId,jdbcType=INTEGER}
270
-        AND STATUS = 1
271
-        AND advice_type = 1
272
-        AND model_type = #{modelType,jdbcType=INTEGER}
292
+        t.uuid_type = 1
293
+        AND t.community_id = #{communityId,jdbcType=INTEGER}
294
+        AND t.uuid = #{userId,jdbcType=INTEGER}
295
+        AND t.STATUS = 1
296
+        AND t.advice_type = 1
297
+        AND t.model_type = #{modelType,jdbcType=INTEGER}
273 298
     ORDER BY
274
-    create_date DESC
299
+    t.create_date DESC
275 300
   </select>
276 301
 
277 302
   <update id="updateReadStatus" parameterType="java.lang.Integer" >