zyp 1 周之前
父节点
当前提交
24ed4ef3fe
共有 1 个文件被更改,包括 64 次插入44 次删除
  1. 64 44
      fs-service/src/main/resources/mapper/sop/QwSopTempVoiceMapper.xml

+ 64 - 44
fs-service/src/main/resources/mapper/sop/QwSopTempVoiceMapper.xml

@@ -1,28 +1,29 @@
 <?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.sop.mapper.QwSopTempVoiceMapper">
 
     <resultMap type="QwSopTempVoice" id="QwSopTempVoiceResult">
         <result property="id"    column="id"    />
-        <result property="qwUserId"    column="qw_user_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
         <result property="tempId"    column="temp_id"    />
         <result property="ruleId"    column="rule_id"    />
         <result property="contentId"    column="content_id"    />
         <result property="voiceTxt"    column="voice_txt"    />
         <result property="voiceUrl"    column="voice_url"    />
+        <result property="userVoiceUrl"    column="user_voice_url"    />
+        <result property="recordType"    column="record_type"    />
         <result property="createTime"    column="create_time"    />
     </resultMap>
 
     <sql id="selectQwSopTempVoiceVo">
-        select id, qw_user_id, temp_id, rule_id, content_id, voice_txt, voice_url, create_time from qw_sop_temp_voice
+        select id,company_user_id, temp_id, rule_id, content_id, voice_txt, voice_url, create_time from qw_sop_temp_voice
     </sql>
 
     <select id="selectQwSopTempVoiceList" parameterType="QwSopTempVoice" resultMap="QwSopTempVoiceResult">
         <include refid="selectQwSopTempVoiceVo"/>
         <where>
-            <if test="qwUserId != null  and qwUserId != ''"> and qw_user_id = #{qwUserId}</if>
             <if test="tempId != null  and tempId != ''"> and temp_id = #{tempId}</if>
             <if test="ruleId != null "> and rule_id = #{ruleId}</if>
             <if test="contentId != null "> and content_id = #{contentId}</if>
@@ -32,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectQwSopTempVoiceById" parameterType="Long" resultMap="QwSopTempVoiceResult">
-        <include refid="selectQwSopTempVoiceVo"/>
+        select id,company_user_id,duration, temp_id, rule_id, content_id, voice_txt, voice_url,user_voice_url,record_type, create_time from qw_sop_temp_voice
         where id = #{id}
     </select>
     <select id="listVoice" resultType="com.fs.sop.domain.QwSopTempVoice">
@@ -42,9 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getVoice" resultType="com.fs.sop.domain.QwSopTempVoice">
         select a.* from qw_sop_temp_voice a
         where a.company_user_id = #{companyUserId}
-        and a.company_id = #{companyId}
-        and a.temp_id = #{tempId}
-        and a.rule_id = #{rulesId}
+          and a.company_id = #{companyId}
+          and a.temp_id = #{tempId}
+          and a.rule_id = #{rulesId}
     </select>
     <select id="listVoiceTemp" resultType="com.fs.sop.domain.QwSopTempVoice">
         select * from qw_sop_temp_voice a where a.temp_id = #{tempId} and a.day_id =#{dayId}
@@ -59,49 +60,98 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where a.company_user_id in <foreach collection="userIdList" open="(" separator="," close=")" item="item">#{item}</foreach>
     </select>
 
+    <select id="selectQwSopTempVoiceByIdAndText" resultType="com.fs.sop.domain.QwSopTempVoice">
+        select id,company_user_id companyUserId,voice_txt voiceTxt from qw_sop_temp_voice where id = #{id}
+                                                                                            and voice_txt = #{voiceTxt} and record_type in (0,1) limit 1
+    </select>
+    <select id="selectQwSopTempVoiceByIdAndUserVoiceUrl" resultType="com.fs.sop.domain.QwSopTempVoice">
+        select id,company_user_id companyUserId from qw_sop_temp_voice where id = #{id} and record_type in (0,1,2) limit 1
+    </select>
+    <select id="selectQwSopTempVoiceNewList" resultType="com.fs.sop.domain.QwSopTempVoice">
+        select id,voice_txt voiceTxt,company_user_id companyUserId,voice_url voiceUrl,duration,record_type recordType,
+        user_voice_url userVoiceUrl from qw_sop_temp_voice
+        <where>
+            <if test="companyUserId != null"> and company_user_id = #{companyUserId}</if>
+            <if test="recordType != null"> and record_type = #{recordType}</if>
+        </where>
+        order by update_time desc,id desc
+    </select>
+
+    <select id="selectQwSopTempVoiceByQwUserIds" resultMap="QwSopTempVoiceResult">
+        select * from qw_sop_temp_voice where record_type = 0 and qw_user_id in
+        <foreach item="qwUserId" collection="ids"  open="(" separator="," close=")">
+            #{qwUserId}
+        </foreach>
+    </select>
+    <select id="selectQwSopTempVoiceByCompanyUserIdAndVoiceTxt" resultType="com.fs.sop.domain.QwSopTempVoice">
+        select qw_user_id qwUserId,voice_url voiceUrl,voice_txt voiceTxt,user_voice_url userVoiceUrl,company_user_id companyUserId,
+               record_type recordType,duration from qw_sop_temp_voice where company_user_id = #{companyUserId} and voice_txt = #{voiceTxt}
+    </select>
+    <select id="selectQwSopTempVoiceByCompanyUserIdAndQwUserId" resultType="com.fs.sop.domain.QwSopTempVoice">
+        select id,company_user_id companyUserId,voice_url voiceUrl,voice_txt voiceTxt,duration
+        from qw_sop_temp_voice
+        where company_user_id = #{companyUserId} and qw_user_id = #{qwUserId}
+          and voice_url  is not null
+            limit 1
+    </select>
+    <select id="selectQwSopTempVoiceListLimit" resultType="com.fs.sop.domain.QwSopTempVoice">
+        select id,voice_txt voiceTxt,company_user_id companyUserId,voice_url voiceUrl,duration,record_type recordType,
+               user_voice_url userVoiceUrl from qw_sop_temp_voice
+        where record_type = #{recordType} and company_user_id is not null
+        order by date_format(create_time,'%y%m%d') desc,company_user_id desc limit 10
+    </select>
+
     <insert id="insertQwSopTempVoice" parameterType="QwSopTempVoice" useGeneratedKeys="true" keyProperty="id">
         insert into qw_sop_temp_voice
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="companyUserId != null">company_user_id,</if>
+            <if test="qwUserId != null">qw_user_id,</if>
             <if test="companyId != null">company_id,</if>
             <if test="tempId != null">temp_id,</if>
             <if test="ruleId != null">rule_id,</if>
             <if test="contentId != null">content_id,</if>
             <if test="voiceTxt != null">voice_txt,</if>
             <if test="voiceUrl != null">voice_url,</if>
+            <if test="userVoiceUrl != null">user_voice_url,</if>
             <if test="createTime != null">create_time,</if>
             <if test="duration != null">duration,</if>
-         </trim>
+            <if test="recordType != null">record_type,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="companyUserId != null">#{companyUserId},</if>
+            <if test="qwUserId != null">#{qwUserId},</if>
             <if test="companyId != null">#{companyId},</if>
             <if test="tempId != null">#{tempId},</if>
             <if test="ruleId != null">#{ruleId},</if>
             <if test="contentId != null">#{contentId},</if>
             <if test="voiceTxt != null">#{voiceTxt},</if>
             <if test="voiceUrl != null">#{voiceUrl},</if>
+            <if test="userVoiceUrl != null">#{userVoiceUrl},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="duration != null">#{duration},</if>
-         </trim>
+            <if test="recordType != null">#{recordType},</if>
+        </trim>
     </insert>
     <insert id="insertBatch">
-        INSERT INTO qw_sop_temp_voice (temp_id, company_user_id, day_id, company_id, content_id, rule_id, voice_txt, voice_url, duration)
+        INSERT INTO qw_sop_temp_voice (temp_id, company_user_id, day_id, company_id, content_id, rule_id, voice_txt, voice_url,record_type, duration)
         VALUES
         <foreach collection="list" item="item" separator=",">
-            (#{item.tempId}, #{item.companyUserId}, #{item.dayId}, #{item.companyId}, #{item.contentId}, #{item.ruleId}, #{item.voiceTxt}, #{item.voiceUrl}, #{item.duration})
+            (#{item.tempId}, #{item.companyUserId}, #{item.dayId}, #{item.companyId}, #{item.contentId}, #{item.ruleId}, #{item.voiceTxt}, #{item.voiceUrl}, #{item.recordType},#{item.duration})
         </foreach>
     </insert>
 
     <update id="updateQwSopTempVoice" parameterType="QwSopTempVoice">
         update qw_sop_temp_voice
         <trim prefix="SET" suffixOverrides=",">
-            <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
             <if test="tempId != null">temp_id = #{tempId},</if>
             <if test="ruleId != null">rule_id = #{ruleId},</if>
             <if test="contentId != null">content_id = #{contentId},</if>
             <if test="voiceTxt != null">voice_txt = #{voiceTxt},</if>
             <if test="voiceUrl != null">voice_url = #{voiceUrl},</if>
+            <if test="userVoiceUrl != null">user_voice_url = #{userVoiceUrl},</if>
+            <if test="recordType != null">record_type = #{recordType},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="duration != null">duration = #{duration},</if>
         </trim>
         where id = #{id}
     </update>
@@ -119,34 +169,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <delete id="remove">
         delete from qw_sop_temp_voice a where a.temp_id = #{tempId} and a.day_id =#{dayId}
     </delete>
-
-    <select id="selectQwSopTempVoiceByCompanyUserIdAndVoiceTxt" resultType="com.fs.sop.domain.QwSopTempVoice">
-        select qw_user_id qwUserId,voice_url voiceUrl,voice_txt voiceTxt,user_voice_url userVoiceUrl,company_user_id companyUserId,
-               record_type recordType,duration from qw_sop_temp_voice where company_user_id = #{companyUserId} and voice_txt = #{voiceTxt}
-    </select>
-    <select id="selectQwSopTempVoiceByCompanyUserIdAndQwUserId" resultType="com.fs.sop.domain.QwSopTempVoice">
-        select id,company_user_id companyUserId,voice_url voiceUrl,voice_txt voiceTxt,duration
-        from qw_sop_temp_voice
-        where company_user_id = #{companyUserId} and qw_user_id = #{qwUserId}
-          and voice_url  is not null
-            limit 1
-    </select>
-    <select id="selectQwSopTempVoiceListLimit" resultType="com.fs.sop.domain.QwSopTempVoice">
-        select id,voice_txt voiceTxt,company_user_id companyUserId,voice_url voiceUrl,duration,record_type recordType,
-               user_voice_url userVoiceUrl from qw_sop_temp_voice
-        where record_type = #{recordType} and company_user_id is not null
-        order by date_format(create_time,'%y%m%d') desc,company_user_id desc limit 10
-    </select>
-    <select id="selectQwSopTempVoiceByIdAndUserVoiceUrl" resultType="com.fs.sop.domain.QwSopTempVoice">
-        select id,company_user_id companyUserId from qw_sop_temp_voice where id = #{id} and record_type in (0,1,2) limit 1
-    </select>
-    <select id="selectQwSopTempVoiceNewList" resultType="com.fs.sop.domain.QwSopTempVoice">
-        select id,voice_txt voiceTxt,company_user_id companyUserId,voice_url voiceUrl,duration,record_type recordType,
-        user_voice_url userVoiceUrl from qw_sop_temp_voice
-        <where>
-            <if test="companyUserId != null"> and company_user_id = #{companyUserId}</if>
-            <if test="recordType != null"> and record_type = #{recordType}</if>
-        </where>
-        order by update_time desc,id desc
-    </select>
 </mapper>