CompanyVoiceRoboticCallLogMapper.xml 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.company.mapper.CompanyVoiceRoboticCallLogMapper">
  6. <resultMap type="CompanyVoiceRoboticCallLog" id="CompanyVoiceRoboticCallLogResult">
  7. <result property="logId" column="log_id" />
  8. <result property="roboticId" column="robotic_id" />
  9. <result property="callerId" column="caller_id" />
  10. <result property="runFunction" column="run_function" />
  11. <result property="runTime" column="run_time" />
  12. <result property="runParam" column="run_param" />
  13. <result property="result" column="result" />
  14. <result property="status" column="status" />
  15. <result property="createTime" column="create_time" />
  16. </resultMap>
  17. <sql id="selectCompanyVoiceRoboticCallLogVo">
  18. select log_id, robotic_id, caller_id, wx_client_id, run_function, run_time, run_param, result, status,create_time from company_voice_robotic_call_log
  19. </sql>
  20. <select id="selectCompanyVoiceRoboticCallLogList" parameterType="CompanyVoiceRoboticCallLog" resultMap="CompanyVoiceRoboticCallLogResult">
  21. <include refid="selectCompanyVoiceRoboticCallLogVo"/>
  22. <where>
  23. <if test="roboticId != null "> and robotic_id = #{roboticId}</if>
  24. <if test="callerId != null "> and caller_id = #{callerId}</if>
  25. <if test="wxClientId != null "> and wx_client_id = #{wxClientId}</if>
  26. <if test="runFunction != null and runFunction != ''"> and run_function = #{runFunction}</if>
  27. <if test="runTime != null "> and run_time = #{runTime}</if>
  28. <if test="runParam != null and runParam != ''"> and run_param = #{runParam}</if>
  29. <if test="result != null and result != ''"> and result = #{result}</if>
  30. <if test="status != null "> and status = #{status}</if>
  31. <if test="createTime != null "> and create_time = #{createTime}</if>
  32. </where>
  33. </select>
  34. <select id="selectCompanyVoiceRoboticCallLogByLogId" parameterType="Long" resultMap="CompanyVoiceRoboticCallLogResult">
  35. <include refid="selectCompanyVoiceRoboticCallLogVo"/>
  36. where log_id = #{logId}
  37. </select>
  38. <insert id="insertCompanyVoiceRoboticCallLog" parameterType="CompanyVoiceRoboticCallLog" useGeneratedKeys="true" keyProperty="logId">
  39. insert into company_voice_robotic_call_log
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="roboticId != null">robotic_id,</if>
  42. <if test="callerId != null">caller_id,</if>
  43. <if test="wxClientId != null">wx_client_id,</if>
  44. <if test="runFunction != null">run_function,</if>
  45. <if test="runTime != null">run_time,</if>
  46. <if test="runParam != null">run_param,</if>
  47. <if test="result != null">result,</if>
  48. <if test="status != null">status,</if>
  49. <if test="createTime != null">create_time,</if>
  50. </trim>
  51. <trim prefix="values (" suffix=")" suffixOverrides=",">
  52. <if test="roboticId != null">#{roboticId},</if>
  53. <if test="callerId != null">#{callerId},</if>
  54. <if test="wxClientId != null">#{wxClientId},</if>
  55. <if test="runFunction != null">#{runFunction},</if>
  56. <if test="runTime != null">#{runTime},</if>
  57. <if test="runParam != null">#{runParam},</if>
  58. <if test="result != null">#{result},</if>
  59. <if test="status != null">#{status},</if>
  60. <if test="createTime != null">#{createTime},</if>
  61. </trim>
  62. </insert>
  63. <update id="updateCompanyVoiceRoboticCallLog" parameterType="CompanyVoiceRoboticCallLog">
  64. update company_voice_robotic_call_log
  65. <trim prefix="SET" suffixOverrides=",">
  66. <if test="roboticId != null">robotic_id = #{roboticId},</if>
  67. <if test="callerId != null">caller_id = #{callerId},</if>
  68. <if test="wxClientId != null">wx_client_id = #{wxClientId},</if>
  69. <if test="runFunction != null">run_function = #{runFunction},</if>
  70. <if test="runTime != null">run_time = #{runTime},</if>
  71. <if test="runParam != null">run_param = #{runParam},</if>
  72. <if test="result != null">result = #{result},</if>
  73. <if test="status != null">status = #{status},</if>
  74. </trim>
  75. where log_id = #{logId}
  76. </update>
  77. <delete id="deleteCompanyVoiceRoboticCallLogByLogId" parameterType="Long">
  78. delete from company_voice_robotic_call_log where log_id = #{logId}
  79. </delete>
  80. <delete id="deleteCompanyVoiceRoboticCallLogByLogIds" parameterType="String">
  81. delete from company_voice_robotic_call_log where log_id in
  82. <foreach item="logId" collection="array" open="(" separator="," close=")">
  83. #{logId}
  84. </foreach>
  85. </delete>
  86. <select id="selectNoResultLogByCallees" parameterType="com.fs.company.domain.CompanyVoiceRoboticCallees" resultType="CompanyVoiceRoboticCallLog">
  87. select * from company_voice_robotic_call_log where robotic_id = #{callees.roboticId} And caller_id = #{callees.id} And status = 1
  88. </select>
  89. </mapper>