QwSopTempVoiceMapper.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. </mapper>