CompanyVoiceRoboticCallLogAddwxMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.CompanyVoiceRoboticCallLogAddwxMapper">
  6. <resultMap type="CompanyVoiceRoboticCallLogAddwx" id="CompanyVoiceRoboticCallLogAddwxResult">
  7. <result property="logId" column="log_id" />
  8. <result property="roboticId" column="robotic_id" />
  9. <result property="wxClientId" column="wx_client_id" />
  10. <result property="runTime" column="run_time" />
  11. <result property="runParam" column="run_param" />
  12. <result property="result" column="result" />
  13. <result property="status" column="status" />
  14. <result property="createTime" column="create_time" />
  15. <result property="companyId" column="company_id" />
  16. <result property="wxAccountId" column="wx_account_id" />
  17. <result property="isWeCom" column="is_we_com" />
  18. </resultMap>
  19. <sql id="selectCompanyVoiceRoboticCallLogAddwxVo">
  20. select log_id, robotic_id, wx_client_id, run_time, run_param, result, status, create_time, company_id, wx_account_id,is_we_com from company_voice_robotic_call_log_addwx
  21. </sql>
  22. <select id="selectCompanyVoiceRoboticCallLogAddwxList" parameterType="CompanyVoiceRoboticCallLogAddwx" resultMap="CompanyVoiceRoboticCallLogAddwxResult">
  23. <include refid="selectCompanyVoiceRoboticCallLogAddwxVo"/>
  24. <where>
  25. <if test="roboticId != null "> and robotic_id = #{roboticId}</if>
  26. <if test="wxClientId != null "> and wx_client_id = #{wxClientId}</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="companyId != null "> and company_id = #{companyId}</if>
  32. <if test="wxAccountId != null "> and wx_account_id = #{wxAccountId}</if>
  33. <if test="isWeCom != null "> and is_we_com = #{isWeCom}</if>
  34. </where>
  35. </select>
  36. <select id="selectCompanyVoiceRoboticCallLogAddwxByLogId" parameterType="Long" resultMap="CompanyVoiceRoboticCallLogAddwxResult">
  37. <include refid="selectCompanyVoiceRoboticCallLogAddwxVo"/>
  38. where log_id = #{logId}
  39. </select>
  40. <insert id="insertCompanyVoiceRoboticCallLogAddwx" parameterType="CompanyVoiceRoboticCallLogAddwx" useGeneratedKeys="true" keyProperty="logId">
  41. insert into company_voice_robotic_call_log_addwx
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="roboticId != null">robotic_id,</if>
  44. <if test="wxClientId != null">wx_client_id,</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. <if test="companyId != null">company_id,</if>
  51. <if test="wxAccountId != null">wx_account_id,</if>
  52. <if test="isWeCom != null">is_we_com,</if>
  53. </trim>
  54. <trim prefix="values (" suffix=")" suffixOverrides=",">
  55. <if test="roboticId != null">#{roboticId},</if>
  56. <if test="wxClientId != null">#{wxClientId},</if>
  57. <if test="runTime != null">#{runTime},</if>
  58. <if test="runParam != null">#{runParam},</if>
  59. <if test="result != null">#{result},</if>
  60. <if test="status != null">#{status},</if>
  61. <if test="createTime != null">#{createTime},</if>
  62. <if test="companyId != null">#{companyId},</if>
  63. <if test="wxAccountId != null">#{wxAccountId},</if>
  64. <if test="isWeCom != null">#{isWeCom},</if>
  65. </trim>
  66. </insert>
  67. <update id="updateCompanyVoiceRoboticCallLogAddwx" parameterType="CompanyVoiceRoboticCallLogAddwx">
  68. update company_voice_robotic_call_log_addwx
  69. <trim prefix="SET" suffixOverrides=",">
  70. <if test="roboticId != null">robotic_id = #{roboticId},</if>
  71. <if test="wxClientId != null">wx_client_id = #{wxClientId},</if>
  72. <if test="runTime != null">run_time = #{runTime},</if>
  73. <if test="runParam != null">run_param = #{runParam},</if>
  74. <if test="result != null">result = #{result},</if>
  75. <if test="status != null">status = #{status},</if>
  76. <if test="createTime != null">create_time = #{createTime},</if>
  77. <if test="companyId != null">company_id = #{companyId},</if>
  78. <if test="wxAccountId != null">wx_account_id = #{wxAccountId},</if>
  79. <if test="isWeCom != null">is_we_com = #{isWeCom},</if>
  80. </trim>
  81. where log_id = #{logId}
  82. </update>
  83. <delete id="deleteCompanyVoiceRoboticCallLogAddwxByLogId" parameterType="Long">
  84. delete from company_voice_robotic_call_log_addwx where log_id = #{logId}
  85. </delete>
  86. <delete id="deleteCompanyVoiceRoboticCallLogAddwxByLogIds" parameterType="String">
  87. delete from company_voice_robotic_call_log_addwx where log_id in
  88. <foreach item="logId" collection="array" open="(" separator="," close=")">
  89. #{logId}
  90. </foreach>
  91. </delete>
  92. <select id="listByCustomerIdAndRoboticId" parameterType="CompanyVoiceRoboticCallLogAddwx" resultType="com.fs.company.vo.CompanyVoiceRoboticCallLogAddwxVO">
  93. select
  94. t1.*,
  95. t2.wx_nick_name as wxAccountName,
  96. t3.nick_name as wxClientName,
  97. t4.company_name as companyName,
  98. t5.nick_name as companyUserName
  99. from company_voice_robotic_call_log_addwx t1
  100. left join company_wx_account t2 on t1.wx_account_id = t2.id
  101. left join company_wx_client t3 on t3.id = t1.wx_client_id
  102. left join company t4 on t4.company_id = t2.company_id
  103. left join company_user t5 on t5.user_id = t2.company_user_id
  104. where 1=1
  105. <if test="roboticId != null "> and t1.robotic_id = #{roboticId}</if>
  106. <if test="wxClientId != null "> and t1.wx_client_id = #{wxClientId}</if>
  107. <if test="isWeCom != null "> and t1.is_we_com = #{isWeCom}</if>
  108. </select>
  109. <select id="listByCustomerId" resultType="com.fs.company.vo.CompanyVoiceRoboticCallLogAddwxVO">
  110. select
  111. t1.*,
  112. t2.wx_nick_name as wxAccountName,
  113. t3.nick_name as wxClientName,
  114. t4.company_name as companyName,
  115. t5.nick_name as companyUserName
  116. from company_voice_robotic_call_log_addwx t1
  117. left join company_wx_account t2 on t1.wx_account_id = t2.id
  118. left join company_wx_client t3 on t3.id = t1.wx_client_id
  119. left join company t4 on t4.company_id = t2.company_id
  120. left join company_user t5 on t5.user_id = t2.company_user_id
  121. where 1=1
  122. <if test="wxclientIds != null ">
  123. and t1.wx_client_id in
  124. <foreach item='item' index='index' collection='wxclientIds' open='(' separator=',' close=')'>
  125. #{item}
  126. </foreach>
  127. </if>
  128. <if test="isWeCom != null "> and t1.is_we_com = #{isWeCom}</if>
  129. </select>
  130. </mapper>