CustomerMapper.xml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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.zcxk.smartcity.data.access.dao.CustomerMapper">
  4. <resultMap id="BaseResultMap" type="com.zcxk.smartcity.data.access.entity.Customer">
  5. <!--@mbg.generated-->
  6. <id column="id" jdbcType="INTEGER" property="id" />
  7. <result column="site_id" jdbcType="INTEGER" property="siteId" />
  8. <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
  9. <result column="customer_phone" jdbcType="VARCHAR" property="customerPhone" />
  10. <result column="customer_contact_person" jdbcType="VARCHAR" property="customerContactPerson" />
  11. <result column="remark" jdbcType="VARCHAR" property="remark" />
  12. <result column="status" jdbcType="INTEGER" property="status" />
  13. <result column="customer_org_id" jdbcType="INTEGER" property="customerOrgId" />
  14. <result column="push_url" jdbcType="VARCHAR" property="pushUrl" />
  15. <result column="customer_no" jdbcType="VARCHAR" property="customerNo" />
  16. <result column="token" jdbcType="VARCHAR" property="token" />
  17. <result column="date_create" jdbcType="TIMESTAMP" property="dateCreate" />
  18. <result column="date_update" jdbcType="TIMESTAMP" property="dateUpdate" />
  19. <result column="create_by" jdbcType="VARCHAR" property="createBy" />
  20. <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
  21. </resultMap>
  22. <sql id="Base_Column_List">
  23. <!--@mbg.generated-->
  24. id, site_id, customer_name, customer_phone, customer_contact_person, remark, `status`,
  25. customer_org_id, push_url, customer_no, token, date_create, date_update, create_by,
  26. update_by
  27. </sql>
  28. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  29. <!--@mbg.generated-->
  30. select
  31. <include refid="Base_Column_List" />
  32. from sc_customer
  33. where id = #{id,jdbcType=INTEGER}
  34. </select>
  35. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  36. <!--@mbg.generated-->
  37. delete from sc_customer
  38. where id = #{id,jdbcType=INTEGER}
  39. </delete>
  40. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.zcxk.smartcity.data.access.entity.Customer" useGeneratedKeys="true">
  41. <!--@mbg.generated-->
  42. insert into sc_customer (site_id, customer_name, customer_phone,
  43. customer_contact_person, remark, `status`,
  44. customer_org_id, push_url, customer_no,
  45. token, date_create, date_update,
  46. create_by, update_by)
  47. values (#{siteId,jdbcType=INTEGER}, #{customerName,jdbcType=VARCHAR}, #{customerPhone,jdbcType=VARCHAR},
  48. #{customerContactPerson,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  49. #{customerOrgId,jdbcType=INTEGER}, #{pushUrl,jdbcType=VARCHAR}, #{customerNo,jdbcType=VARCHAR},
  50. #{token,jdbcType=VARCHAR}, #{dateCreate,jdbcType=TIMESTAMP}, #{dateUpdate,jdbcType=TIMESTAMP},
  51. #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR})
  52. </insert>
  53. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.smartcity.data.access.entity.Customer" useGeneratedKeys="true">
  54. <!--@mbg.generated-->
  55. insert into sc_customer
  56. <trim prefix="(" suffix=")" suffixOverrides=",">
  57. <if test="siteId != null">
  58. site_id,
  59. </if>
  60. <if test="customerName != null">
  61. customer_name,
  62. </if>
  63. <if test="customerPhone != null">
  64. customer_phone,
  65. </if>
  66. <if test="customerContactPerson != null">
  67. customer_contact_person,
  68. </if>
  69. <if test="remark != null">
  70. remark,
  71. </if>
  72. <if test="status != null">
  73. `status`,
  74. </if>
  75. <if test="customerOrgId != null">
  76. customer_org_id,
  77. </if>
  78. <if test="pushUrl != null">
  79. push_url,
  80. </if>
  81. <if test="customerNo != null">
  82. customer_no,
  83. </if>
  84. <if test="token != null">
  85. token,
  86. </if>
  87. <if test="dateCreate != null">
  88. date_create,
  89. </if>
  90. <if test="dateUpdate != null">
  91. date_update,
  92. </if>
  93. <if test="createBy != null">
  94. create_by,
  95. </if>
  96. <if test="updateBy != null">
  97. update_by,
  98. </if>
  99. </trim>
  100. <trim prefix="values (" suffix=")" suffixOverrides=",">
  101. <if test="siteId != null">
  102. #{siteId,jdbcType=INTEGER},
  103. </if>
  104. <if test="customerName != null">
  105. #{customerName,jdbcType=VARCHAR},
  106. </if>
  107. <if test="customerPhone != null">
  108. #{customerPhone,jdbcType=VARCHAR},
  109. </if>
  110. <if test="customerContactPerson != null">
  111. #{customerContactPerson,jdbcType=VARCHAR},
  112. </if>
  113. <if test="remark != null">
  114. #{remark,jdbcType=VARCHAR},
  115. </if>
  116. <if test="status != null">
  117. #{status,jdbcType=INTEGER},
  118. </if>
  119. <if test="customerOrgId != null">
  120. #{customerOrgId,jdbcType=INTEGER},
  121. </if>
  122. <if test="pushUrl != null">
  123. #{pushUrl,jdbcType=VARCHAR},
  124. </if>
  125. <if test="customerNo != null">
  126. #{customerNo,jdbcType=VARCHAR},
  127. </if>
  128. <if test="token != null">
  129. #{token,jdbcType=VARCHAR},
  130. </if>
  131. <if test="dateCreate != null">
  132. #{dateCreate,jdbcType=TIMESTAMP},
  133. </if>
  134. <if test="dateUpdate != null">
  135. #{dateUpdate,jdbcType=TIMESTAMP},
  136. </if>
  137. <if test="createBy != null">
  138. #{createBy,jdbcType=VARCHAR},
  139. </if>
  140. <if test="updateBy != null">
  141. #{updateBy,jdbcType=VARCHAR},
  142. </if>
  143. </trim>
  144. </insert>
  145. <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.smartcity.data.access.entity.Customer">
  146. <!--@mbg.generated-->
  147. update sc_customer
  148. <set>
  149. <if test="siteId != null">
  150. site_id = #{siteId,jdbcType=INTEGER},
  151. </if>
  152. <if test="customerName != null">
  153. customer_name = #{customerName,jdbcType=VARCHAR},
  154. </if>
  155. <if test="customerPhone != null">
  156. customer_phone = #{customerPhone,jdbcType=VARCHAR},
  157. </if>
  158. <if test="customerContactPerson != null">
  159. customer_contact_person = #{customerContactPerson,jdbcType=VARCHAR},
  160. </if>
  161. <if test="remark != null">
  162. remark = #{remark,jdbcType=VARCHAR},
  163. </if>
  164. <if test="status != null">
  165. `status` = #{status,jdbcType=INTEGER},
  166. </if>
  167. <if test="customerOrgId != null">
  168. customer_org_id = #{customerOrgId,jdbcType=INTEGER},
  169. </if>
  170. <if test="pushUrl != null">
  171. push_url = #{pushUrl,jdbcType=VARCHAR},
  172. </if>
  173. <if test="customerNo != null">
  174. customer_no = #{customerNo,jdbcType=VARCHAR},
  175. </if>
  176. <if test="token != null">
  177. token = #{token,jdbcType=VARCHAR},
  178. </if>
  179. <if test="dateCreate != null">
  180. date_create = #{dateCreate,jdbcType=TIMESTAMP},
  181. </if>
  182. <if test="dateUpdate != null">
  183. date_update = #{dateUpdate,jdbcType=TIMESTAMP},
  184. </if>
  185. <if test="createBy != null">
  186. create_by = #{createBy,jdbcType=VARCHAR},
  187. </if>
  188. <if test="updateBy != null">
  189. update_by = #{updateBy,jdbcType=VARCHAR},
  190. </if>
  191. </set>
  192. where id = #{id,jdbcType=INTEGER}
  193. </update>
  194. <update id="updateByPrimaryKey" parameterType="com.zcxk.smartcity.data.access.entity.Customer">
  195. <!--@mbg.generated-->
  196. update sc_customer
  197. set site_id = #{siteId,jdbcType=INTEGER},
  198. customer_name = #{customerName,jdbcType=VARCHAR},
  199. customer_phone = #{customerPhone,jdbcType=VARCHAR},
  200. customer_contact_person = #{customerContactPerson,jdbcType=VARCHAR},
  201. remark = #{remark,jdbcType=VARCHAR},
  202. `status` = #{status,jdbcType=INTEGER},
  203. customer_org_id = #{customerOrgId,jdbcType=INTEGER},
  204. push_url = #{pushUrl,jdbcType=VARCHAR},
  205. customer_no = #{customerNo,jdbcType=VARCHAR},
  206. token = #{token,jdbcType=VARCHAR},
  207. date_create = #{dateCreate,jdbcType=TIMESTAMP},
  208. date_update = #{dateUpdate,jdbcType=TIMESTAMP},
  209. create_by = #{createBy,jdbcType=VARCHAR},
  210. update_by = #{updateBy,jdbcType=VARCHAR}
  211. where id = #{id,jdbcType=INTEGER}
  212. </update>
  213. </mapper>