ConversationDetailMapper.xml
4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.mindworkplate.mapper.ConversationDetailMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.model.ConversationDetail">
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="batch_id" property="batchId" jdbcType="INTEGER"/>
<result column="role" property="role" jdbcType="VARCHAR"/>
<result column="system_time" property="systemTime" jdbcType="VARCHAR"/>
<result column="recordings_id" property="recordingsId" jdbcType="INTEGER"/>
<result column="offset" property="offset" jdbcType="BIGINT"/>
<result column="duration" property="duration" jdbcType="BIGINT"/>
<result column="merged_offset" property="mergedOffset" jdbcType="BIGINT"/>
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP"/>
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR"/>
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP"/>
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR"/>
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="cn.com.glsx.dj.mindworkplate.model.ConversationDetail"
extends="BaseResultMap">
<!--
WARNING - @mbg.generated
-->
<result column="content" property="content" jdbcType="LONGVARCHAR"/>
</resultMap>
<resultMap id="cdDtoResultMap" type="cn.com.glsx.dj.mindworkplate.dto.ConversationDetailDTO"
extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, batch_id, role, system_time, recordings_id, offset, duration, merged_offset, created_by, created_date,
updated_by, updated_date, deleted_flag
</sql>
<select id="page" parameterType="cn.com.glsx.dj.mindworkplate.dto.ConversationDetailRequestDTO" resultMap="cdDtoResultMap">
select * from inspection_conversation_detail cd
<where>
cd.deleted_flag = 'N'
and cd.batch_id = #{batchId}
<if test="offset != null">
and cd.offset = #{offset}
</if>
<if test="duration != null">
and cd.duration = #{duration}
</if>
<if test="content != null and content != ''">
and cd.content like concat('%', #{content}, '%')
</if>
<if test="role != null and role != ''">
and cd.role = #{role}
</if>
</where>
order by cd.system_time asc
</select>
<update id="updateBatchId">
update inspection_conversation_detail
set batch_id = #{batch.id}
where recordings_id in
<foreach collection="recordingIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and system_time >= #{batch.startTime} and system_time <= #{batch.endTime}
</update>
<select id="listByBatchId" resultMap="BaseResultMap">
select cd.*
from inspection_conversation_detail cd
where cd.deleted_flag = 'N'
and cd.batch_id = #{batchId}
order by cd.id asc
</select>
<select id="getConversionDetailByBadgeId" resultType="cn.com.glsx.dj.mindworkplate.dto.DefenceIdRequestDTO$Detail">
select content,
merged_offset as `time`,
role,
merged_offset as mergedOffset
from inspection_conversation_detail
where deleted_flag = 'N'
and batch_id = #{id}
order by system_time
</select>
<select id="conversationDetailById" parameterType="cn.com.glsx.dj.mindworkplate.dto.ConversationDetailRequestDTO" resultMap="cdDtoResultMap">
select cd.*,ca.id as conversationDetailAppealId from inspection_conversation_detail cd
left join inspection_conversation_detail_appeal ca on cd.id=ca.conversation_detail_id
where
cd.deleted_flag = 'N'
and cd.batch_id = #{batchId}
order by cd.system_time asc
</select>
<select id="conversationDetailByBatchIds" parameterType="cn.com.glsx.dj.mindworkplate.dto.ConversationDetailRequestDTO" resultMap="cdDtoResultMap">
select cd.*,ca.id as conversationDetailAppealId from inspection_conversation_detail cd
left join inspection_conversation_detail_appeal ca on cd.id=ca.conversation_detail_id
where
cd.deleted_flag = 'N'
and cd.batch_id in
<foreach collection="batchIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
order by cd.system_time asc
</select>
</mapper>