|
@@ -1,7 +1,7 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.fs.qw.mapper.QwUserVoiceLogMapper">
|
|
|
|
|
|
<resultMap type="QwUserVoiceLog" id="QwUserVoiceLogResult">
|
|
@@ -19,13 +19,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<resultMap type="com.fs.qw.vo.QwUserVoiceLogTotalVo" id="QwUserVoiceLogVoTotalResult">
|
|
|
<result property="id" column="id" />
|
|
|
- <result property="qwUserId" column="qw_user_id" />
|
|
|
+ <result property="corpId" column="corp_id" />
|
|
|
<result property="duration" column="duration" />
|
|
|
<result property="connectCount" column="connectCount" />
|
|
|
<result property="noConnectCount" column="noConnectCount" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
<association property="qwUser" javaType="com.fs.qw.domain.QwUser" autoMapping="true">
|
|
|
- <id column="qw_uer_id" property="qwUserId"></id>
|
|
|
+ <id column="qw_user_id" property="qwUserId"></id>
|
|
|
<result column="qw_user_name" property="qwUserName"></result>
|
|
|
</association>
|
|
|
</resultMap>
|
|
@@ -86,19 +87,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectQwUserVoiceLogTotalList" resultMap="QwUserVoiceLogVoTotalResult">
|
|
|
|
|
|
SELECT
|
|
|
- SUM(duration) duration,qu.qw_user_name,
|
|
|
+ SUM(duration) duration,qu.qw_user_name,uvl.corp_id,qu.qw_user_id,uvl.company_user_id,
|
|
|
COUNT(CASE WHEN uvl.status=1 THEN 1 END) AS connectCount,
|
|
|
COUNT(CASE WHEN uvl.status=2 THEN 1 END) AS noConnectCount
|
|
|
FROM qw_user_voice_log uvl
|
|
|
LEFT JOIN qw_user qu ON uvl.qw_user_id = qu.id
|
|
|
- where uvl.company_id = #{companyId}
|
|
|
- <if test="qwUserName != null ">and qu.qw_user_name like concat(#{qwUserName}, '%')</if>
|
|
|
- <if test="beginTime != null and endTime != null">
|
|
|
- AND date_format(uvl.create_time,'%Y-%m-%d') >= #{beginTime}
|
|
|
- AND date_format(uvl.create_time,'%Y-%m-%d') <= #{endTime}
|
|
|
+ <where>
|
|
|
+ <if test="companyId != null ">and uvl.company_id = #{companyId}</if>
|
|
|
+ <if test="companyUserId != null ">and uvl.company_user_id = #{companyUserId}</if>
|
|
|
+ <if test="qwUserName != null ">and qu.qw_user_name like concat(#{qwUserName}, '%')</if>
|
|
|
+ <if test="beginTime != null and endTime != null">
|
|
|
+ AND date_format(uvl.create_time,'%Y-%m-%d') >= #{beginTime}
|
|
|
+ AND date_format(uvl.create_time,'%Y-%m-%d') <= #{endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="qwUserId != null">
|
|
|
+ group by qu.qw_user_id,uvl.corp_id,uvl.qw_user_id
|
|
|
+ </if>
|
|
|
+ <if test="qwUserId == null">
|
|
|
+ group by qu.company_user_id
|
|
|
</if>
|
|
|
-
|
|
|
- group by qu.qw_user_name
|
|
|
|
|
|
</select>
|
|
|
|
|
@@ -115,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="companyId != null">company_id,</if>
|
|
|
<if test="companyUserId != null">company_user_id,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="extId != null">#{extId},</if>
|
|
|
<if test="qwUserId != null">#{qwUserId},</if>
|
|
@@ -126,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="companyId != null">#{companyId},</if>
|
|
|
<if test="companyUserId != null">#{companyUserId},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateQwUserVoiceLog" parameterType="QwUserVoiceLog">
|