|
@@ -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" >
|