QwSopTempVoiceMapper.xml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.sop.mapper.QwSopTempVoiceMapper">
  6. <resultMap type="QwSopTempVoice" id="QwSopTempVoiceResult">
  7. <result property="id" column="id" />
  8. <result property="qwUserId" column="qw_user_id" />
  9. <result property="tempId" column="temp_id" />
  10. <result property="ruleId" column="rule_id" />
  11. <result property="contentId" column="content_id" />
  12. <result property="voiceTxt" column="voice_txt" />
  13. <result property="voiceUrl" column="voice_url" />
  14. <result property="createTime" column="create_time" />
  15. </resultMap>
  16. <sql id="selectQwSopTempVoiceVo">
  17. select id, qw_user_id, temp_id, rule_id, content_id, voice_txt, voice_url, create_time from qw_sop_temp_voice
  18. </sql>
  19. <select id="selectQwSopTempVoiceList" parameterType="QwSopTempVoice" resultMap="QwSopTempVoiceResult">
  20. <include refid="selectQwSopTempVoiceVo"/>
  21. <where>
  22. <if test="qwUserId != null and qwUserId != ''"> and qw_user_id = #{qwUserId}</if>
  23. <if test="tempId != null and tempId != ''"> and temp_id = #{tempId}</if>
  24. <if test="ruleId != null "> and rule_id = #{ruleId}</if>
  25. <if test="contentId != null "> and content_id = #{contentId}</if>
  26. <if test="voiceTxt != null and voiceTxt != ''"> and voice_txt = #{voiceTxt}</if>
  27. <if test="voiceUrl != null and voiceUrl != ''"> and voice_url = #{voiceUrl}</if>
  28. </where>
  29. </select>
  30. <select id="selectQwSopTempVoiceById" parameterType="Long" resultMap="QwSopTempVoiceResult">
  31. <include refid="selectQwSopTempVoiceVo"/>
  32. where id = #{id}
  33. </select>
  34. <select id="listVoice" resultType="com.fs.sop.domain.QwSopTempVoice">
  35. select * from qw_sop_temp_voice where temp_id = #{tempId} and company_user_id in
  36. <foreach collection="salesIds" item="item" separator="," open="(" close=")">#{item}</foreach>
  37. </select>
  38. <select id="getVoice" resultType="com.fs.sop.domain.QwSopTempVoice">
  39. select a.* from qw_sop_temp_voice a
  40. where a.company_user_id = #{companyUserId}
  41. and a.company_id = #{companyId}
  42. and a.temp_id = #{tempId}
  43. and a.rule_id = #{rulesId}
  44. </select>
  45. <select id="listVoiceTemp" resultType="com.fs.sop.domain.QwSopTempVoice">
  46. select * from qw_sop_temp_voice a where a.temp_id = #{tempId} and a.day_id =#{dayId}
  47. </select>
  48. <select id="getVoiceByText" resultType="com.fs.sop.domain.QwSopTempVoice">
  49. select a.* from qw_sop_temp_voice a
  50. where a.company_user_id = #{companyUserId}
  51. and a.voice_txt in <foreach collection="textList" item="txt" open="(" close=")" separator=",">#{txt}</foreach>
  52. </select>
  53. <select id="selectAllByUserIds" resultType="com.fs.sop.domain.QwSopTempVoice">
  54. select * from qw_sop_temp_voice a
  55. where a.company_user_id in <foreach collection="userIdList" open="(" separator="," close=")" item="item">#{item}</foreach>
  56. </select>
  57. <insert id="insertQwSopTempVoice" parameterType="QwSopTempVoice" useGeneratedKeys="true" keyProperty="id">
  58. insert into qw_sop_temp_voice
  59. <trim prefix="(" suffix=")" suffixOverrides=",">
  60. <if test="companyUserId != null">company_user_id,</if>
  61. <if test="companyId != null">company_id,</if>
  62. <if test="tempId != null">temp_id,</if>
  63. <if test="ruleId != null">rule_id,</if>
  64. <if test="contentId != null">content_id,</if>
  65. <if test="voiceTxt != null">voice_txt,</if>
  66. <if test="voiceUrl != null">voice_url,</if>
  67. <if test="createTime != null">create_time,</if>
  68. <if test="duration != null">duration,</if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="companyUserId != null">#{companyUserId},</if>
  72. <if test="companyId != null">#{companyId},</if>
  73. <if test="tempId != null">#{tempId},</if>
  74. <if test="ruleId != null">#{ruleId},</if>
  75. <if test="contentId != null">#{contentId},</if>
  76. <if test="voiceTxt != null">#{voiceTxt},</if>
  77. <if test="voiceUrl != null">#{voiceUrl},</if>
  78. <if test="createTime != null">#{createTime},</if>
  79. <if test="duration != null">#{duration},</if>
  80. </trim>
  81. </insert>
  82. <insert id="insertBatch">
  83. INSERT INTO qw_sop_temp_voice (temp_id, company_user_id, day_id, company_id, content_id, rule_id, voice_txt, voice_url, duration)
  84. VALUES
  85. <foreach collection="list" item="item" separator=",">
  86. (#{item.tempId}, #{item.companyUserId}, #{item.dayId}, #{item.companyId}, #{item.contentId}, #{item.ruleId}, #{item.voiceTxt}, #{item.voiceUrl}, #{item.duration})
  87. </foreach>
  88. </insert>
  89. <update id="updateQwSopTempVoice" parameterType="QwSopTempVoice">
  90. update qw_sop_temp_voice
  91. <trim prefix="SET" suffixOverrides=",">
  92. <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
  93. <if test="tempId != null">temp_id = #{tempId},</if>
  94. <if test="ruleId != null">rule_id = #{ruleId},</if>
  95. <if test="contentId != null">content_id = #{contentId},</if>
  96. <if test="voiceTxt != null">voice_txt = #{voiceTxt},</if>
  97. <if test="voiceUrl != null">voice_url = #{voiceUrl},</if>
  98. <if test="createTime != null">create_time = #{createTime},</if>
  99. </trim>
  100. where id = #{id}
  101. </update>
  102. <delete id="deleteQwSopTempVoiceById" parameterType="Long">
  103. delete from qw_sop_temp_voice where id = #{id}
  104. </delete>
  105. <delete id="deleteQwSopTempVoiceByIds" parameterType="String">
  106. delete from qw_sop_temp_voice where id in
  107. <foreach item="id" collection="array" open="(" separator="," close=")">
  108. #{id}
  109. </foreach>
  110. </delete>
  111. <delete id="remove">
  112. delete from qw_sop_temp_voice a where a.temp_id = #{tempId} and a.day_id =#{dayId}
  113. </delete>
  114. <select id="selectQwSopTempVoiceByCompanyUserIdAndVoiceTxt" resultType="com.fs.sop.domain.QwSopTempVoice">
  115. select qw_user_id qwUserId,voice_url voiceUrl,voice_txt voiceTxt,user_voice_url userVoiceUrl,company_user_id companyUserId,
  116. record_type recordType,duration from qw_sop_temp_voice where company_user_id = #{companyUserId} and voice_txt = #{voiceTxt}
  117. </select>
  118. <select id="selectQwSopTempVoiceByCompanyUserIdAndQwUserId" resultType="com.fs.sop.domain.QwSopTempVoice">
  119. select id,company_user_id companyUserId,voice_url voiceUrl,voice_txt voiceTxt,duration
  120. from qw_sop_temp_voice
  121. where company_user_id = #{companyUserId} and qw_user_id = #{qwUserId}
  122. and voice_url is not null
  123. limit 1
  124. </select>
  125. <select id="selectQwSopTempVoiceListLimit" resultType="com.fs.sop.domain.QwSopTempVoice">
  126. select id,voice_txt voiceTxt,company_user_id companyUserId,voice_url voiceUrl,duration,record_type recordType,
  127. user_voice_url userVoiceUrl from qw_sop_temp_voice
  128. where record_type = #{recordType} and company_user_id is not null
  129. order by date_format(create_time,'%y%m%d') desc,company_user_id desc limit 10
  130. </select>
  131. <select id="selectQwSopTempVoiceByIdAndUserVoiceUrl" resultType="com.fs.sop.domain.QwSopTempVoice">
  132. select id,company_user_id companyUserId from qw_sop_temp_voice where id = #{id} and record_type in (0,1,2) limit 1
  133. </select>
  134. <select id="selectQwSopTempVoiceNewList" resultType="com.fs.sop.domain.QwSopTempVoice">
  135. select id,voice_txt voiceTxt,company_user_id companyUserId,voice_url voiceUrl,duration,record_type recordType,
  136. user_voice_url userVoiceUrl from qw_sop_temp_voice
  137. <where>
  138. <if test="companyUserId != null"> and company_user_id = #{companyUserId}</if>
  139. <if test="recordType != null"> and record_type = #{recordType}</if>
  140. </where>
  141. order by update_time desc,id desc
  142. </select>
  143. </mapper>