AiSipCallTaskMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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.aiSipCall.mapper.AiSipCallTaskMapper">
  6. <resultMap type="AiSipCallTask" id="AiSipCallTaskResult">
  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="executing" column="executing" />
  14. <result property="stopTime" column="stop_time" />
  15. <result property="userid" column="userid" />
  16. <result property="taskType" column="task_type" />
  17. <result property="gatewayId" column="gateway_id" />
  18. <result property="voiceCode" column="voice_code" />
  19. <result property="voiceSource" column="voice_source" />
  20. <result property="avgRingTimeLen" column="avg_ring_time_len" />
  21. <result property="avgCallTalkTimeLen" column="avg_call_talk_time_len" />
  22. <result property="avgCallEndProcessTimeLen" column="avg_call_end_process_time_len" />
  23. <result property="callNodeNo" column="call_node_no" />
  24. <result property="llmAccountId" column="llm_account_id" />
  25. <result property="playTimes" column="play_times" />
  26. <result property="asrProvider" column="asr_provider" />
  27. <result property="aiTransferType" column="ai_transfer_type" />
  28. <result property="aiTransferData" column="ai_transfer_data" />
  29. <result property="autoStop" column="auto_stop" />
  30. <result property="ivrId" column="ivr_id" />
  31. <result property="remoteBatchId" column="remote_batch_id" />
  32. <result property="createBy" column="create_by" />
  33. <result property="createTime" column="create_time" />
  34. <result property="updateBy" column="update_by" />
  35. <result property="updateTime" column="update_time" />
  36. <result property="companyId" column="company_id" />
  37. <result property="companyUserId" column="company_user_id" />
  38. <result property="status" column="status" />
  39. </resultMap>
  40. <sql id="selectAiSipCallTaskVo">
  41. select * from ai_sip_call_task
  42. </sql>
  43. <select id="selectAiSipCallTaskList" parameterType="AiSipCallTask" resultMap="AiSipCallTaskResult">
  44. <include refid="selectAiSipCallTaskVo"/>
  45. <where>
  46. <if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
  47. <if test="batchName != null and batchName != ''"> and batch_name like concat('%', #{batchName}, '%')</if>
  48. <if test="ifcall != null "> and ifcall = #{ifcall}</if>
  49. <if test="rate != null "> and rate = #{rate}</if>
  50. <if test="threadNum != null "> and thread_num = #{threadNum}</if>
  51. <if test="executing != null "> and executing = #{executing}</if>
  52. <if test="stopTime != null "> and stop_time = #{stopTime}</if>
  53. <if test="userid != null and userid != ''"> and userid = #{userid}</if>
  54. <if test="taskType != null "> and task_type = #{taskType}</if>
  55. <if test="gatewayId != null "> and gateway_id = #{gatewayId}</if>
  56. <if test="voiceCode != null and voiceCode != ''"> and voice_code = #{voiceCode}</if>
  57. <if test="voiceSource != null and voiceSource != ''"> and voice_source = #{voiceSource}</if>
  58. <if test="avgRingTimeLen != null "> and avg_ring_time_len = #{avgRingTimeLen}</if>
  59. <if test="avgCallTalkTimeLen != null "> and avg_call_talk_time_len = #{avgCallTalkTimeLen}</if>
  60. <if test="avgCallEndProcessTimeLen != null "> and avg_call_end_process_time_len = #{avgCallEndProcessTimeLen}</if>
  61. <if test="callNodeNo != null and callNodeNo != ''"> and call_node_no = #{callNodeNo}</if>
  62. <if test="llmAccountId != null "> and llm_account_id = #{llmAccountId}</if>
  63. <if test="playTimes != null "> and play_times = #{playTimes}</if>
  64. <if test="asrProvider != null and asrProvider != ''"> and asr_provider = #{asrProvider}</if>
  65. <if test="aiTransferType != null and aiTransferType != ''"> and ai_transfer_type = #{aiTransferType}</if>
  66. <if test="aiTransferData != null and aiTransferData != ''"> and ai_transfer_data = #{aiTransferData}</if>
  67. <if test="autoStop != null "> and auto_stop = #{autoStop}</if>
  68. <if test="ivrId != null and ivrId != ''"> and ivr_id = #{ivrId}</if>
  69. <if test="remoteBatchId != null "> and remote_batch_id = #{remoteBatchId}</if>
  70. <if test="createBy != null "> and create_by = #{createBy}</if>
  71. <if test="createTime != null "> and create_time = #{createTime}</if>
  72. <if test="updateBy != null "> and update_by = #{updateBy}</if>
  73. <if test="updateTime != null "> and update_time = #{updateTime}</if>
  74. <if test="companyId != null "> and company_id = #{companyId}</if>
  75. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  76. <if test="createTimeStart != null and createTimeStart != ''"> and create_time &gt;= #{createTimeStart}</if>
  77. <if test="createTimeEnd != null and createTimeEnd != ''"> and create_time &lt;= #{createTimeEnd}</if>
  78. <if test="status != null "> and status = #{status}</if>
  79. </where>
  80. order by create_time desc
  81. </select>
  82. <select id="selectAiSipCallTaskByBatchId" parameterType="Long" resultMap="AiSipCallTaskResult">
  83. <include refid="selectAiSipCallTaskVo"/>
  84. where batch_id = #{batchId}
  85. </select>
  86. <insert id="insertAiSipCallTask" parameterType="AiSipCallTask" useGeneratedKeys="true" keyProperty="batchId">
  87. insert into ai_sip_call_task
  88. <trim prefix="(" suffix=")" suffixOverrides=",">
  89. <if test="groupId != null and groupId != ''">group_id,</if>
  90. <if test="batchName != null and batchName != ''">batch_name,</if>
  91. <if test="ifcall != null">ifcall,</if>
  92. <if test="rate != null">rate,</if>
  93. <if test="threadNum != null">thread_num,</if>
  94. <if test="executing != null">executing,</if>
  95. <if test="stopTime != null">stop_time,</if>
  96. <if test="userid != null and userid != ''">userid,</if>
  97. <if test="taskType != null">task_type,</if>
  98. <if test="gatewayId != null">gateway_id,</if>
  99. <if test="voiceCode != null and voiceCode != ''">voice_code,</if>
  100. <if test="voiceSource != null and voiceSource != ''">voice_source,</if>
  101. <if test="avgRingTimeLen != null">avg_ring_time_len,</if>
  102. <if test="avgCallTalkTimeLen != null">avg_call_talk_time_len,</if>
  103. <if test="avgCallEndProcessTimeLen != null">avg_call_end_process_time_len,</if>
  104. <if test="callNodeNo != null and callNodeNo != ''">call_node_no,</if>
  105. <if test="llmAccountId != null">llm_account_id,</if>
  106. <if test="playTimes != null">play_times,</if>
  107. <if test="asrProvider != null">asr_provider,</if>
  108. <if test="aiTransferType != null and aiTransferType != ''">ai_transfer_type,</if>
  109. <if test="aiTransferData != null and aiTransferData != ''">ai_transfer_data,</if>
  110. <if test="autoStop != null">auto_stop,</if>
  111. <if test="ivrId != null">ivr_id,</if>
  112. <if test="remoteBatchId != null">remote_batch_id,</if>
  113. <if test="createBy != null">create_by,</if>
  114. <if test="createTime != null">create_time,</if>
  115. <if test="updateBy != null">update_by,</if>
  116. <if test="updateTime != null">update_time,</if>
  117. <if test="companyId != null">company_id,</if>
  118. <if test="companyUserId != null">company_user_id,</if>
  119. <if test="status != null">status,</if>
  120. </trim>
  121. <trim prefix="values (" suffix=")" suffixOverrides=",">
  122. <if test="groupId != null and groupId != ''">#{groupId},</if>
  123. <if test="batchName != null and batchName != ''">#{batchName},</if>
  124. <if test="ifcall != null">#{ifcall},</if>
  125. <if test="rate != null">#{rate},</if>
  126. <if test="threadNum != null">#{threadNum},</if>
  127. <if test="executing != null">#{executing},</if>
  128. <if test="stopTime != null">#{stopTime},</if>
  129. <if test="userid != null and userid != ''">#{userid},</if>
  130. <if test="taskType != null">#{taskType},</if>
  131. <if test="gatewayId != null">#{gatewayId},</if>
  132. <if test="voiceCode != null and voiceCode != ''">#{voiceCode},</if>
  133. <if test="voiceSource != null and voiceSource != ''">#{voiceSource},</if>
  134. <if test="avgRingTimeLen != null">#{avgRingTimeLen},</if>
  135. <if test="avgCallTalkTimeLen != null">#{avgCallTalkTimeLen},</if>
  136. <if test="avgCallEndProcessTimeLen != null">#{avgCallEndProcessTimeLen},</if>
  137. <if test="callNodeNo != null and callNodeNo != ''">#{callNodeNo},</if>
  138. <if test="llmAccountId != null">#{llmAccountId},</if>
  139. <if test="playTimes != null">#{playTimes},</if>
  140. <if test="asrProvider != null">#{asrProvider},</if>
  141. <if test="aiTransferType != null and aiTransferType != ''">#{aiTransferType},</if>
  142. <if test="aiTransferData != null and aiTransferData != ''">#{aiTransferData},</if>
  143. <if test="autoStop != null">#{autoStop},</if>
  144. <if test="ivrId != null">#{ivrId},</if>
  145. <if test="remoteBatchId != null">#{remoteBatchId},</if>
  146. <if test="createBy != null">#{createBy},</if>
  147. <if test="createTime != null">#{createTime},</if>
  148. <if test="updateBy != null">#{updateBy},</if>
  149. <if test="updateTime != null">#{updateTime},</if>
  150. <if test="companyId != null">#{companyId},</if>
  151. <if test="companyUserId != null">#{companyUserId},</if>
  152. <if test="status != null">#{status},</if>
  153. </trim>
  154. </insert>
  155. <update id="updateAiSipCallTask" parameterType="AiSipCallTask">
  156. update ai_sip_call_task
  157. <trim prefix="SET" suffixOverrides=",">
  158. <if test="groupId != null and groupId != ''">group_id = #{groupId},</if>
  159. <if test="batchName != null and batchName != ''">batch_name = #{batchName},</if>
  160. <if test="ifcall != null">ifcall = #{ifcall},</if>
  161. <if test="rate != null">rate = #{rate},</if>
  162. <if test="threadNum != null">thread_num = #{threadNum},</if>
  163. <if test="executing != null">executing = #{executing},</if>
  164. <if test="stopTime != null">stop_time = #{stopTime},</if>
  165. <if test="userid != null and userid != ''">userid = #{userid},</if>
  166. <if test="taskType != null">task_type = #{taskType},</if>
  167. <if test="gatewayId != null">gateway_id = #{gatewayId},</if>
  168. <if test="voiceCode != null and voiceCode != ''">voice_code = #{voiceCode},</if>
  169. <if test="voiceSource != null and voiceSource != ''">voice_source = #{voiceSource},</if>
  170. <if test="avgRingTimeLen != null">avg_ring_time_len = #{avgRingTimeLen},</if>
  171. <if test="avgCallTalkTimeLen != null">avg_call_talk_time_len = #{avgCallTalkTimeLen},</if>
  172. <if test="avgCallEndProcessTimeLen != null">avg_call_end_process_time_len = #{avgCallEndProcessTimeLen},</if>
  173. <if test="callNodeNo != null and callNodeNo != ''">call_node_no = #{callNodeNo},</if>
  174. <if test="llmAccountId != null">llm_account_id = #{llmAccountId},</if>
  175. <if test="playTimes != null">play_times = #{playTimes},</if>
  176. <if test="asrProvider != null">asr_provider = #{asrProvider},</if>
  177. <if test="aiTransferType != null and aiTransferType != ''">ai_transfer_type = #{aiTransferType},</if>
  178. <if test="aiTransferData != null and aiTransferData != ''">ai_transfer_data = #{aiTransferData},</if>
  179. <if test="autoStop != null">auto_stop = #{autoStop},</if>
  180. <if test="ivrId != null">ivr_id = #{ivrId},</if>
  181. <if test="remoteBatchId != null">remote_batch_id = #{remoteBatchId},</if>
  182. <if test="createBy != null">create_by = #{createBy},</if>
  183. <if test="createTime != null">create_time = #{createTime},</if>
  184. <if test="updateBy != null">update_by = #{updateBy},</if>
  185. <if test="updateTime != null">update_time = #{updateTime},</if>
  186. <if test="companyId != null">company_id = #{companyId},</if>
  187. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  188. <if test="status != null">status = #{status},</if>
  189. </trim>
  190. where batch_id = #{batchId}
  191. </update>
  192. <delete id="deleteAiSipCallTaskByBatchId" parameterType="Long">
  193. delete from ai_sip_call_task where batch_id = #{batchId}
  194. </delete>
  195. <delete id="deleteAiSipCallTaskByBatchIds" parameterType="String">
  196. delete from ai_sip_call_task where batch_id in
  197. <foreach item="batchId" collection="array" open="(" separator="," close=")">
  198. #{batchId}
  199. </foreach>
  200. </delete>
  201. </mapper>