CustomerInfoFeedbackMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.ygj.yuemum.dao.customer.CustomerInfoFeedbackDao" >
  4. <!--获取所有数据-->
  5. <select id="selectByPageNumSize" resultType="com.ygj.yuemum.domain.customer.CustomerInfoFeedback" parameterType="com.ygj.yuemum.domain.customer.dto.CustomerInfoFeedbackDto">
  6. SELECT
  7. id,
  8. fb_date,
  9. source_channel,
  10. fb_customer_phone,
  11. branche_name,
  12. fb_type,
  13. create_person,
  14. in_charge_person,
  15. customer_manager,
  16. entry_date,
  17. edc_date,
  18. fb_wechat_number,
  19. fb_customer_name,
  20. fb_remarks,
  21. it_on,
  22. convenient_time,
  23. communication_content,
  24. user_feedback,
  25. store
  26. FROM
  27. customer_info_feedback
  28. where 1=1
  29. <if test="id != null and id !=''">
  30. and id = #{id}
  31. </if>
  32. <if test="start_fb_date != null and start_fb_date !=''">
  33. and fb_Date &gt;= #{start_fb_date}
  34. </if>
  35. <if test="end_fb_date != null and end_fb_date !=''">
  36. and fb_Date &lt; #{end_fb_date}
  37. </if>
  38. <if test="source_channel != null ">
  39. and source_channel in
  40. <foreach collection="source_channel" item="item" index="index" open="(" separator="," close=")">
  41. #{item}
  42. </foreach>
  43. </if>
  44. <if test="fb_customer_phone != null and fb_customer_phone !=''">
  45. and fb_customer_phone like "%"#{fb_customer_phone,jdbcType=VARCHAR}"%"
  46. </if>
  47. <if test="branche_name != null ">
  48. and branche_name in
  49. <foreach collection="branche_name" item="item" index="index" open="(" separator="," close=")">
  50. #{item}
  51. </foreach>
  52. </if>
  53. <if test="fb_type != null ">
  54. and fb_type in
  55. <foreach collection="fb_type" item="item" index="index" open="(" separator="," close=")">
  56. #{item}
  57. </foreach>
  58. </if>
  59. <if test="create_person != null ">
  60. and create_person in
  61. <foreach collection="create_person" item="item" index="index" open="(" separator="," close=")">
  62. #{item}
  63. </foreach>
  64. </if>
  65. <if test="in_charge_person != null ">
  66. and in_charge_person in
  67. <foreach collection="in_charge_person" item="item" index="index" open="(" separator="," close=")">
  68. #{item}
  69. </foreach>
  70. </if>
  71. <if test="customer_manager != null ">
  72. and customer_manager in
  73. <foreach collection="customer_manager" item="item" index="index" open="(" separator="," close=")">
  74. #{item}
  75. </foreach>
  76. </if>
  77. </select>
  78. <insert id="insertInfoFeedback" parameterType="com.ygj.yuemum.domain.customer.CustomerInfoFeedback">
  79. insert into customer_info_feedback (fb_date, source_channel, fb_customer_phone, branche_name, fb_type, create_person, in_charge_person, customer_manager, entry_date, p_code, fb_customer_name, fb_wechat_number, edc_date, fb_remarks)
  80. values (#{fb_date}, #{source_channel}, #{fb_customer_phone}, #{branche_name}, #{fb_type}, #{create_person}, #{in_charge_person}, #{customer_manager}, #{entry_date}, #{p_code}, #{fb_customer_name}, #{fb_wechat_number}, #{edc_date}, #{fb_remarks})
  81. </insert>
  82. <select id="getById" resultType="com.ygj.yuemum.domain.customer.CustomerInfoFeedback">
  83. SELECT
  84. id,
  85. fb_date,
  86. source_channel,
  87. fb_customer_phone,
  88. branche_name,
  89. fb_type,
  90. create_person,
  91. in_charge_person,
  92. customer_manager,
  93. entry_date,
  94. edc_date,
  95. fb_wechat_number,
  96. fb_customer_name,
  97. fb_remarks,
  98. store,
  99. (
  100. SELECT
  101. p.p_name
  102. FROM
  103. packages p
  104. WHERE
  105. p.p_code = customer_info_feedback.p_code
  106. ) AS p_code,
  107. it_on,
  108. convenient_time,
  109. communication_content,
  110. user_feedback
  111. FROM
  112. customer_info_feedback
  113. WHERE
  114. id = #{id}
  115. </select>
  116. <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.customer.CustomerInfoFeedback">
  117. update customer_info_feedback
  118. <set>
  119. <if test="fb_date != null">
  120. `fb_date` = #{fb_date,jdbcType=TIMESTAMP},
  121. </if>
  122. <if test="source_channel != null">
  123. `source_channel` = #{source_channel,jdbcType=VARCHAR},
  124. </if>
  125. <if test="fb_customer_phone != null">
  126. `fb_customer_phone` = #{fb_customer_phone,jdbcType=VARCHAR},
  127. </if>
  128. <if test="branche_name != null">
  129. `branche_name` = #{branche_name,jdbcType=VARCHAR},
  130. </if>
  131. <if test="fb_type != null">
  132. `fb_type` = #{fb_type,jdbcType=VARCHAR},
  133. </if>
  134. <if test="create_person != null">
  135. `create_person` = #{create_person,jdbcType=VARCHAR},
  136. </if>
  137. <if test="in_charge_person != null">
  138. `in_charge_person` = #{in_charge_person,jdbcType=VARCHAR},
  139. </if>
  140. <if test="customer_manager != null">
  141. `customer_manager` = #{customer_manager,jdbcType=VARCHAR},
  142. </if>
  143. <if test="entry_date != null">
  144. `entry_date` = #{entry_date,jdbcType=TIMESTAMP},
  145. </if>
  146. <if test="p_code != null">
  147. `p_code` = #{p_code,jdbcType=VARCHAR},
  148. </if>
  149. <if test="fb_customer_name != null">
  150. `fb_customer_name` = #{fb_customer_name,jdbcType=VARCHAR},
  151. </if>
  152. <if test="fb_wechat_number != null">
  153. `fb_wechat_number` = #{fb_wechat_number,jdbcType=VARCHAR},
  154. </if>
  155. <if test="edc_date != null">
  156. `edc_date` = #{edc_date,jdbcType=TIMESTAMP},
  157. </if>
  158. <if test="fb_remarks != null">
  159. `fb_remarks` = #{fb_remarks,jdbcType=VARCHAR},
  160. </if>
  161. <if test="it_on != null">
  162. `it_on` = #{it_on,jdbcType=VARCHAR},
  163. </if>
  164. <if test="convenient_time != null">
  165. `convenient_time` = #{convenient_time,jdbcType=VARCHAR},
  166. </if>
  167. <if test="communication_content != null">
  168. `communication_content` = #{communication_content,jdbcType=VARCHAR},
  169. </if>
  170. <if test="user_feedback != null">
  171. `user_feedback` = #{user_feedback,jdbcType=VARCHAR},
  172. </if>
  173. <if test="store != null">
  174. `store` = #{store,jdbcType=VARCHAR},
  175. </if>
  176. </set>
  177. where `id` = #{id,jdbcType=INTEGER}
  178. </update>
  179. <insert id="insertInfoFeedbackList">
  180. insert into customer_info_feedback (fb_date, source_channel, fb_customer_phone, branche_name, fb_type, create_person, in_charge_person, customer_manager, entry_date, p_code, fb_customer_name, fb_wechat_number, edc_date, fb_remarks, it_on, convenient_time, communication_content, user_feedback, store)
  181. values
  182. <foreach collection="list" item="item" separator=",">
  183. (#{item.fb_date}, #{item.source_channel}, #{item.fb_customer_phone}, #{item.branche_name}, #{item.fb_type}, #{item.create_person}, #{item.in_charge_person}, #{item.customer_manager}, #{item.entry_date}, #{item.p_code}, #{item.fb_customer_name}, #{item.fb_wechat_number}, #{item.edc_date}, #{item.fb_remarks}, #{item.it_on}, #{item.convenient_time}, #{item.communication_content}, #{item.user_feedback}, #{item.store})
  184. </foreach>
  185. </insert>
  186. </mapper>