|
@@ -3,9 +3,10 @@
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.slibra.business.mapper.TCallRecordMapper">
|
|
<mapper namespace="com.slibra.business.mapper.TCallRecordMapper">
|
|
-
|
|
|
|
|
|
+
|
|
<resultMap type="TCallRecord" id="TCallRecordResult">
|
|
<resultMap type="TCallRecord" id="TCallRecordResult">
|
|
<result property="id" column="id" />
|
|
<result property="id" column="id" />
|
|
|
|
+ <result property="sessionId" column="session_id" />
|
|
<result property="type" column="type" />
|
|
<result property="type" column="type" />
|
|
<result property="userId" column="user_id" />
|
|
<result property="userId" column="user_id" />
|
|
<result property="userName" column="user_name" />
|
|
<result property="userName" column="user_name" />
|
|
@@ -30,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTCallRecordVo">
|
|
<sql id="selectTCallRecordVo">
|
|
- select id, type, user_id, user_name, service_category, time_begin, time_end, times, category, status, phone, bussiness_type, url, remark, has_parsed, parsed_voice_content, del_flag, revision, create_by, create_time, update_by, update_time from t_call_record
|
|
|
|
|
|
+ select id, session_id, type, user_id, user_name, service_category, time_begin, time_end, times, category, status, phone, bussiness_type, url, remark, has_parsed, parsed_voice_content, del_flag, revision, create_by, create_time, update_by, update_time from t_call_record
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
@@ -38,10 +39,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<include refid="selectTCallRecordVo"/>
|
|
<include refid="selectTCallRecordVo"/>
|
|
where id = #{id} and del_flag = 0
|
|
where id = #{id} and del_flag = 0
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<insert id="insertTCallRecord" parameterType="TCallRecord" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="insertTCallRecord" parameterType="TCallRecord" useGeneratedKeys="true" keyProperty="id">
|
|
insert into t_call_record
|
|
insert into t_call_record
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="sessionId != null">session_id,</if>
|
|
<if test="type != null">type,</if>
|
|
<if test="type != null">type,</if>
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="userName != null">user_name,</if>
|
|
<if test="userName != null">user_name,</if>
|
|
@@ -65,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="sessionId != null">#{sessionId},</if>
|
|
<if test="type != null">#{type},</if>
|
|
<if test="type != null">#{type},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="userName != null">#{userName},</if>
|
|
<if test="userName != null">#{userName},</if>
|
|
@@ -92,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<update id="updateTCallRecord" parameterType="TCallRecord">
|
|
<update id="updateTCallRecord" parameterType="TCallRecord">
|
|
update t_call_record
|
|
update t_call_record
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="sessionId != null">session_id = #{sessionId},</if>
|
|
<if test="type != null">type = #{type},</if>
|
|
<if test="type != null">type = #{type},</if>
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
<if test="userName != null">user_name = #{userName},</if>
|
|
<if test="userName != null">user_name = #{userName},</if>
|
|
@@ -118,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
where id = #{id}
|
|
where id = #{id}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
<delete id="deleteTCallRecordById" parameterType="Long">
|
|
<delete id="deleteTCallRecordById" parameterType="Long">
|
|
update t_call_record set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
|
|
update t_call_record set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
|
|
@@ -136,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<include refid="selectTCallRecordVo"/>
|
|
<include refid="selectTCallRecordVo"/>
|
|
<where>
|
|
<where>
|
|
1 = 1
|
|
1 = 1
|
|
|
|
+ <if test="sessionId != null and sessionId != ''"> and session_id = #{sessionId}</if>
|
|
<if test="type != null "> and type = #{type}</if>
|
|
<if test="type != null "> and type = #{type}</if>
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
@@ -153,4 +158,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</where>
|
|
</where>
|
|
and del_flag = 0 order by id desc
|
|
and del_flag = 0 order by id desc
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="getBusinessTypeBySessionId" resultType="string">
|
|
|
|
+ SELECT
|
|
|
|
+ intent
|
|
|
|
+ FROM
|
|
|
|
+ botrecords
|
|
|
|
+ WHERE
|
|
|
|
+ `session` = #{sessionId}
|
|
|
|
+ LIMIT 1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getContentsBySessionId" resultType="string">
|
|
|
|
+ SELECT
|
|
|
|
+ contents
|
|
|
|
+ FROM
|
|
|
|
+ botrecords
|
|
|
|
+ WHERE
|
|
|
|
+ `session` = #{sessionId}
|
|
|
|
+ LIMIT 1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getAgentList" resultType="java.util.HashMap">
|
|
|
|
+ SELECT
|
|
|
|
+ user_id id,
|
|
|
|
+ user_name `name`
|
|
|
|
+ FROM
|
|
|
|
+ sys_user
|
|
|
|
+ WHERE
|
|
|
|
+ agent_num IS NOT NULL
|
|
|
|
+ AND agent_num != ''
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|