CustomerUserInfoMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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.goafanti.common.dao.CustomerUserInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.CustomerUserInfo">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="cid" jdbcType="VARCHAR" property="cid" />
  7. <result column="name" jdbcType="VARCHAR" property="name" />
  8. <result column="sex" jdbcType="CHAR" property="sex" />
  9. <result column="mobile" jdbcType="VARCHAR" property="mobile" />
  10. <result column="tel_num" jdbcType="VARCHAR" property="telNum" />
  11. <result column="email" jdbcType="VARCHAR" property="email" />
  12. <result column="qq" jdbcType="VARCHAR" property="qq" />
  13. <result column="wechat" jdbcType="VARCHAR" property="wechat" />
  14. <result column="depatrment" jdbcType="VARCHAR" property="depatrment" />
  15. <result column="customer_position" jdbcType="VARCHAR" property="customerPosition" />
  16. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  17. </resultMap>
  18. <!-- 新增 -->
  19. <insert id="insertCustomerUser" parameterType="com.goafanti.common.model.CustomerUserInfo">
  20. insert into customer_user_info
  21. <trim prefix="(" suffix=")" suffixOverrides=",">
  22. <if test="id != null">
  23. id,
  24. </if>
  25. <if test="cid != null">
  26. cid,
  27. </if>
  28. <if test="name != null">
  29. name,
  30. </if>
  31. <if test="sex != null">
  32. sex,
  33. </if>
  34. <if test="mobile != null">
  35. mobile,
  36. </if>
  37. <if test="telNum != null">
  38. tel_num,
  39. </if>
  40. <if test="email != null">
  41. email,
  42. </if>
  43. <if test="qq != null">
  44. qq,
  45. </if>
  46. <if test="wechat != null">
  47. wechat,
  48. </if>
  49. <if test="depatrment != null">
  50. depatrment,
  51. </if>
  52. <if test="customerPosition != null">
  53. customer_position,
  54. </if>
  55. <if test="remarks != null">
  56. remarks,
  57. </if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides=",">
  60. <if test="id != null">
  61. #{id,jdbcType=VARCHAR},
  62. </if>
  63. <if test="cid != null">
  64. #{cid,jdbcType=VARCHAR},
  65. </if>
  66. <if test="name != null">
  67. #{name,jdbcType=VARCHAR},
  68. </if>
  69. <if test="sex != null">
  70. #{sex,jdbcType=CHAR},
  71. </if>
  72. <if test="mobile != null">
  73. #{mobile,jdbcType=VARCHAR},
  74. </if>
  75. <if test="telNum != null">
  76. #{telNum,jdbcType=VARCHAR},
  77. </if>
  78. <if test="email != null">
  79. #{email,jdbcType=VARCHAR},
  80. </if>
  81. <if test="qq != null">
  82. #{qq,jdbcType=VARCHAR},
  83. </if>
  84. <if test="wechat != null">
  85. #{wechat,jdbcType=VARCHAR},
  86. </if>
  87. <if test="depatrment != null">
  88. #{depatrment,jdbcType=VARCHAR},
  89. </if>
  90. <if test="customerPosition != null">
  91. #{customerPosition,jdbcType=VARCHAR},
  92. </if>
  93. <if test="remarks != null">
  94. #{remarks,jdbcType=VARCHAR},
  95. </if>
  96. </trim>
  97. </insert>
  98. <delete id="deleteCustomerUserByCid" parameterType="java.lang.String">
  99. delete from customer_user_info
  100. where cid = #{cid,jdbcType=VARCHAR}
  101. </delete>
  102. <update id="updateCustomerUserByPrimaryKey" parameterType="com.goafanti.common.model.CustomerUserInfo">
  103. update customer_user_info
  104. <set>
  105. <if test="cid != null">
  106. cid = #{cid,jdbcType=VARCHAR},
  107. </if>
  108. <if test="name != null">
  109. name = #{name,jdbcType=VARCHAR},
  110. </if>
  111. <if test="sex != null">
  112. sex = #{sex,jdbcType=INTEGER},
  113. </if>
  114. <if test="mobile != null">
  115. mobile = #{mobile,jdbcType=VARCHAR},
  116. </if>
  117. <if test="email != null">
  118. email = #{email,jdbcType=VARCHAR},
  119. </if>
  120. <if test="qq != null">
  121. qq = #{qq,jdbcType=VARCHAR},
  122. </if>
  123. <if test="wechat != null">
  124. wechat = #{wechat,jdbcType=VARCHAR},
  125. </if>
  126. <if test="depatrment != null">
  127. depatrment = #{depatrment,jdbcType=VARCHAR},
  128. </if>
  129. <if test="customerPosition != null">
  130. customer_position = #{customerPosition,jdbcType=VARCHAR},
  131. </if>
  132. <if test="remarks != null">
  133. remarks = #{remarks,jdbcType=VARCHAR},
  134. </if>
  135. </set>
  136. where cid = #{cid,jdbcType=VARCHAR}
  137. </update>
  138. </mapper>