CcCallTaskMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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.aicall.mapper.CcCallTaskMapper">
  6. <resultMap type="CcCallTask" id="CcCallTaskResult">
  7. <result property="batchId" column="batch_id" />
  8. <result property="groupId" column="group_id" />
  9. <result property="batchName" column="batch_name" />
  10. <result property="ifcall" column="ifcall" />
  11. <result property="rate" column="rate" />
  12. <result property="threadNum" column="thread_num" />
  13. <result property="createtime" column="createtime" />
  14. <result property="executing" column="executing" />
  15. <result property="stopTime" column="stop_time" />
  16. <result property="userid" column="userid" />
  17. <result property="gatewayId" column="gateway_id" />
  18. <result property="taskType" column="task_type" />
  19. <result property="voiceCode" column="voice_code" />
  20. <result property="voiceSource" column="voice_source" />
  21. <result property="avgRingTimeLen" column="avg_ring_time_len" />
  22. <result property="avgCallTalkTimeLen" column="avg_call_talk_time_len" />
  23. <result property="avgCallEndProcessTimeLen" column="avg_call_end_process_time_len" />
  24. <result property="callNodeNo" column="call_node_no" />
  25. <result property="llmAccountId" column="llm_account_id" />
  26. <result property="playTimes" column="play_times" />
  27. <result property="asrProvider" column="asr_provider" />
  28. <result property="aiTransferType" column="ai_transfer_type" />
  29. <result property="aiTransferData" column="ai_transfer_data" />
  30. <result property="autoStop" column="auto_stop" />
  31. <result property="ivrId" column="ivr_id" />
  32. </resultMap>
  33. <sql id="selectCcCallTaskVo">
  34. select batch_id, group_id, batch_name, ifcall, rate, thread_num, createtime, executing, stop_time, userid, task_type, gateway_id, voice_code, voice_source, avg_ring_time_len, avg_call_talk_time_len, avg_call_end_process_time_len, call_node_no, llm_account_id, play_times, asr_provider, ai_transfer_type, ai_transfer_data, auto_stop, ivr_id from cc_call_task
  35. </sql>
  36. <select id="selectCcCallTaskList" parameterType="CcCallTask" resultMap="CcCallTaskResult">
  37. <include refid="selectCcCallTaskVo"/>
  38. <where>
  39. <if test="batchId != null "> and batch_id = #{batchId}</if>
  40. <if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
  41. <if test="batchName != null and batchName != ''"> and batch_name like concat('%', #{batchName}, '%')</if>
  42. <if test="ifcall != null "> and ifcall = #{ifcall}</if>
  43. <if test="taskType != null "> and task_type = #{taskType}</if>
  44. <if test="gatewayId != null "> and gateway_id = #{gatewayId}</if>
  45. <if test="voiceCode != null and voiceCode != ''"> and voice_code = #{voiceCode}</if>
  46. <if test="voiceSource != null and voiceSource != ''"> and voice_source = #{voiceSource}</if>
  47. <if test="llmAccountId != null"> and llm_account_id = #{llmAccountId}</if>
  48. <if test="params.createTimeStart != null and params.createTimeStart != ''"><!-- 开始时间检索 -->
  49. AND createtime &gt;= #{params.createTimeStart}
  50. </if>
  51. <if test="params.createTimeEnd != null and params.createTimeEnd != ''"><!-- 结束时间检索 -->
  52. AND createtime &lt;= #{params.createTimeEnd}
  53. </if>
  54. <if test="asrProvider != null and asrProvider != ''" > and asr_provider = #{asrProvider}</if>
  55. <if test="aiTransferType != null and aiTransferType != ''" > and ai_transfer_type = #{aiTransferType}</if>
  56. <if test="aiTransferData != null and aiTransferData != ''" > and ai_transfer_data = #{aiTransferData}</if>
  57. </where>
  58. order by batch_id desc
  59. </select>
  60. <select id="selectCcCallTaskByBatchId" parameterType="Long" resultMap="CcCallTaskResult">
  61. <include refid="selectCcCallTaskVo"/>
  62. where batch_id = #{batchId}
  63. </select>
  64. <insert id="insertCcCallTask" parameterType="CcCallTask" useGeneratedKeys="true" keyProperty="batchId">
  65. insert into cc_call_task
  66. <trim prefix="(" suffix=")" suffixOverrides=",">
  67. <if test="groupId != null and groupId != ''">group_id,</if>
  68. <if test="batchName != null and batchName != ''">batch_name,</if>
  69. <if test="ifcall != null">ifcall,</if>
  70. <if test="rate != null">rate,</if>
  71. <if test="threadNum != null">thread_num,</if>
  72. <if test="createtime != null">createtime,</if>
  73. <if test="executing != null">executing,</if>
  74. <if test="stopTime != null">stop_time,</if>
  75. <if test="userid != null and userid != ''">userid,</if>
  76. <if test="taskType != null">task_type,</if>
  77. <if test="gatewayId != null">gateway_id,</if>
  78. <if test="voiceCode != null and voiceCode != ''">voice_code,</if>
  79. <if test="voiceSource != null and voiceSource != ''">voice_source,</if>
  80. <if test="avgRingTimeLen != null">avg_ring_time_len,</if>
  81. <if test="avgCallTalkTimeLen != null">avg_call_talk_time_len,</if>
  82. <if test="avgCallEndProcessTimeLen != null">avg_call_end_process_time_len,</if>
  83. <if test="callNodeNo != null">call_node_no,</if>
  84. <if test="llmAccountId != null">llm_account_id,</if>
  85. <if test="playTimes != null">play_times,</if>
  86. <if test="asrProvider != null and asrProvider != ''">asr_provider,</if>
  87. <if test="aiTransferType != null and aiTransferType != ''">ai_transfer_type,</if>
  88. <if test="aiTransferData != null and aiTransferData != ''">ai_transfer_data,</if>
  89. <if test="autoStop != null ">auto_stop,</if>
  90. <if test="ivrId != null and ivrId != ''">ivr_id,</if>
  91. </trim>
  92. <trim prefix="values (" suffix=")" suffixOverrides=",">
  93. <if test="groupId != null and groupId != ''">#{groupId},</if>
  94. <if test="batchName != null and batchName != ''">#{batchName},</if>
  95. <if test="ifcall != null">#{ifcall},</if>
  96. <if test="rate != null">#{rate},</if>
  97. <if test="threadNum != null">#{threadNum},</if>
  98. <if test="createtime != null">#{createtime},</if>
  99. <if test="executing != null">#{executing},</if>
  100. <if test="stopTime != null">#{stopTime},</if>
  101. <if test="userid != null and userid != ''">#{userid},</if>
  102. <if test="taskType != null">#{taskType},</if>
  103. <if test="gatewayId != null">#{gatewayId},</if>
  104. <if test="voiceCode != null and voiceCode != ''">#{voiceCode},</if>
  105. <if test="voiceSource != null and voiceSource != ''">#{voiceSource},</if>
  106. <if test="avgRingTimeLen != null">#{avgRingTimeLen},</if>
  107. <if test="avgCallTalkTimeLen != null">#{avgCallTalkTimeLen},</if>
  108. <if test="avgCallEndProcessTimeLen != null">#{avgCallEndProcessTimeLen},</if>
  109. <if test="callNodeNo != null">#{callNodeNo},</if>
  110. <if test="llmAccountId != null">#{llmAccountId},</if>
  111. <if test="playTimes != null">#{playTimes},</if>
  112. <if test="asrProvider != null and asrProvider != ''">#{asrProvider},</if>
  113. <if test="aiTransferType != null and aiTransferType != ''">#{aiTransferType},</if>
  114. <if test="aiTransferData != null and aiTransferData != ''">#{aiTransferData},</if>
  115. <if test="autoStop != null ">#{autoStop},</if>
  116. <if test="ivrId != null and ivrId != ''">#{ivrId},</if>
  117. </trim>
  118. </insert>
  119. <update id="updateCcCallTask" parameterType="CcCallTask">
  120. update cc_call_task
  121. <trim prefix="SET" suffixOverrides=",">
  122. <if test="groupId != null and groupId != ''">group_id = #{groupId},</if>
  123. <if test="batchName != null and batchName != ''">batch_name = #{batchName},</if>
  124. <if test="ifcall != null">ifcall = #{ifcall},</if>
  125. <if test="rate != null">rate = #{rate},</if>
  126. <if test="threadNum != null">thread_num = #{threadNum},</if>
  127. <if test="createtime != null">createtime = #{createtime},</if>
  128. <if test="executing != null">executing = #{executing},</if>
  129. <if test="stopTime != null">stop_time = #{stopTime},</if>
  130. <if test="userid != null and userid != ''">userid = #{userid},</if>
  131. <if test="gatewayId != null">gateway_id = #{gatewayId},</if>
  132. <if test="taskType != null">task_type = #{taskType},</if>
  133. <if test="voiceCode != null and voiceCode != ''">voice_code = #{voiceCode},</if>
  134. <if test="voiceSource != null and voiceSource != ''">voice_source = #{voiceSource},</if>
  135. <if test="avgRingTimeLen != null">avg_ring_time_len = #{avgRingTimeLen},</if>
  136. <if test="avgCallTalkTimeLen != null">avg_call_talk_time_len = #{avgCallTalkTimeLen},</if>
  137. <if test="avgCallEndProcessTimeLen != null">avg_call_end_process_time_len = #{avgCallEndProcessTimeLen},</if>
  138. <if test="callNodeNo != null">call_node_no = #{callNodeNo},</if>
  139. <if test="llmAccountId != null">llm_account_id = #{llmAccountId},</if>
  140. <if test="playTimes != null">play_times = #{playTimes},</if>
  141. <if test="asrProvider != null and asrProvider != ''">asr_provider = #{asrProvider},</if>
  142. <if test="aiTransferType != null and aiTransferType != ''">ai_transfer_type = #{aiTransferType},</if>
  143. <if test="aiTransferData != null and aiTransferData != ''">ai_transfer_data = #{aiTransferData},</if>
  144. <if test="autoStop != null ">auto_stop = #{autoStop},</if>
  145. <if test="ivrId != null and ivrId != ''">ivr_id = #{ivrId},</if>
  146. </trim>
  147. where batch_id = #{batchId}
  148. </update>
  149. <delete id="deleteCcCallTaskByBatchId" parameterType="Long">
  150. delete from cc_call_task where batch_id = #{batchId}
  151. </delete>
  152. <delete id="deleteCcCallTaskByBatchIds" parameterType="String">
  153. delete from cc_call_task where batch_id in
  154. <foreach item="batchId" collection="array" open="(" separator="," close=")">
  155. #{batchId}
  156. </foreach>
  157. </delete>
  158. <select id="selectCcCallTaskByBatchName" resultMap="CcCallTaskResult">
  159. <include refid="selectCcCallTaskVo"/>
  160. where batch_name = #{batchName} and task_type = #{taskType}
  161. </select>
  162. <insert id="bakCallTaskByBatchId" parameterType="Long">
  163. insert into his_cc_call_task select * from cc_call_task where batch_id = #{batchId}
  164. </insert>
  165. </mapper>