CustomeraddressMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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.usoftchina.saas.document.mapper.CustomeraddressMapper">
  4. <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Customeraddress">
  5. <id column="ca_id" jdbcType="INTEGER" property="id" />
  6. <result column="ca_cuid" jdbcType="INTEGER" property="ca_cuid" />
  7. <result column="ca_detno" jdbcType="INTEGER" property="ca_detno" />
  8. <result column="ca_person" jdbcType="VARCHAR" property="ca_person" />
  9. <result column="ca_phone" jdbcType="VARCHAR" property="ca_phone" />
  10. <result column="ca_default" jdbcType="INTEGER" property="ca_default" />
  11. <result column="companyid" jdbcType="INTEGER" property="companyId" />
  12. <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
  13. <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="ca_text1" jdbcType="VARCHAR" property="ca_text1" />
  15. <result column="ca_text2" jdbcType="VARCHAR" property="ca_text2" />
  16. <result column="ca_text3" jdbcType="VARCHAR" property="ca_text3" />
  17. <result column="ca_text4" jdbcType="VARCHAR" property="ca_text4" />
  18. <result column="ca_text5" jdbcType="VARCHAR" property="ca_text5" />
  19. </resultMap>
  20. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Customeraddress">
  21. <result column="ca_address" jdbcType="LONGVARCHAR" property="ca_address" />
  22. </resultMap>
  23. <sql id="Base_Column_List">
  24. ca_id, ca_cuid, ca_detno, ca_person, ca_phone, ca_default, companyid, updaterid,
  25. updatetime, ca_text1, ca_text2, ca_text3, ca_text4, ca_text5
  26. </sql>
  27. <sql id="Blob_Column_List">
  28. ca_address
  29. </sql>
  30. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
  31. select
  32. *
  33. from customeraddress
  34. where ca_id = #{ca_id,jdbcType=INTEGER}
  35. </select>
  36. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  37. delete from customeraddress
  38. where ca_id = #{ca_id,jdbcType=INTEGER}
  39. </delete>
  40. <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Customeraddress">
  41. <selectKey resultType="java.lang.Long" keyProperty="id">
  42. SELECT LAST_INSERT_ID() AS ID
  43. </selectKey>
  44. insert into customeraddress
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="ca_cuid != null">
  47. ca_cuid,
  48. </if>
  49. <if test="ca_detno != null">
  50. ca_detno,
  51. </if>
  52. <if test="ca_person != null">
  53. ca_person,
  54. </if>
  55. <if test="ca_phone != null">
  56. ca_phone,
  57. </if>
  58. <if test="ca_default != null">
  59. ca_default,
  60. </if>
  61. <if test="companyId != null">
  62. companyid,
  63. </if>
  64. <if test="updaterId != null">
  65. updaterid,
  66. </if>
  67. <if test="updateTime != null">
  68. updatetime,
  69. </if>
  70. <if test="ca_text1 != null">
  71. ca_text1,
  72. </if>
  73. <if test="ca_text2 != null">
  74. ca_text2,
  75. </if>
  76. <if test="ca_text3 != null">
  77. ca_text3,
  78. </if>
  79. <if test="ca_text4 != null">
  80. ca_text4,
  81. </if>
  82. <if test="ca_text5 != null">
  83. ca_text5,
  84. </if>
  85. <if test="ca_address != null">
  86. ca_address,
  87. </if>
  88. </trim>
  89. <trim prefix="values (" suffix=")" suffixOverrides=",">
  90. <if test="ca_cuid != null">
  91. #{ca_cuid,jdbcType=INTEGER},
  92. </if>
  93. <if test="ca_detno != null">
  94. #{ca_detno,jdbcType=INTEGER},
  95. </if>
  96. <if test="ca_person != null">
  97. #{ca_person,jdbcType=VARCHAR},
  98. </if>
  99. <if test="ca_phone != null">
  100. #{ca_phone,jdbcType=VARCHAR},
  101. </if>
  102. <if test="ca_default != null">
  103. #{ca_default,jdbcType=INTEGER},
  104. </if>
  105. <if test="companyId != null">
  106. #{companyId,jdbcType=INTEGER},
  107. </if>
  108. <if test="updaterId != null">
  109. #{updaterId,jdbcType=INTEGER},
  110. </if>
  111. <if test="updateTime != null">
  112. #{updateTime,jdbcType=TIMESTAMP},
  113. </if>
  114. <if test="ca_text1 != null">
  115. #{ca_text1,jdbcType=VARCHAR},
  116. </if>
  117. <if test="ca_text2 != null">
  118. #{ca_text2,jdbcType=VARCHAR},
  119. </if>
  120. <if test="ca_text3 != null">
  121. #{ca_text3,jdbcType=VARCHAR},
  122. </if>
  123. <if test="ca_text4 != null">
  124. #{ca_text4,jdbcType=VARCHAR},
  125. </if>
  126. <if test="ca_text5 != null">
  127. #{ca_text5,jdbcType=VARCHAR},
  128. </if>
  129. <if test="ca_address != null">
  130. #{ca_address,jdbcType=LONGVARCHAR},
  131. </if>
  132. </trim>
  133. </insert>
  134. <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Customeraddress">
  135. update customeraddress
  136. <set>
  137. <if test="id != null">
  138. ca_cuid = #{id,jdbcType=INTEGER},
  139. </if>
  140. <if test="ca_detno != null">
  141. ca_detno = #{ca_detno,jdbcType=INTEGER},
  142. </if>
  143. <if test="ca_person != null">
  144. ca_person = #{ca_person,jdbcType=VARCHAR},
  145. </if>
  146. <if test="ca_phone != null">
  147. ca_phone = #{ca_phone,jdbcType=VARCHAR},
  148. </if>
  149. <if test="ca_default != null">
  150. ca_default = #{ca_default,jdbcType=INTEGER},
  151. </if>
  152. <if test="companyId != null">
  153. companyid = #{companyId,jdbcType=INTEGER},
  154. </if>
  155. <if test="updaterId != null">
  156. updaterid = #{updaterId,jdbcType=INTEGER},
  157. </if>
  158. <if test="updateTime != null">
  159. updatetime = #{updateTime,jdbcType=TIMESTAMP},
  160. </if>
  161. <if test="ca_text1 != null">
  162. ca_text1 = #{ca_text1,jdbcType=VARCHAR},
  163. </if>
  164. <if test="ca_text2 != null">
  165. ca_text2 = #{ca_text2,jdbcType=VARCHAR},
  166. </if>
  167. <if test="ca_text3 != null">
  168. ca_text3 = #{ca_text3,jdbcType=VARCHAR},
  169. </if>
  170. <if test="ca_text4 != null">
  171. ca_text4 = #{ca_text4,jdbcType=VARCHAR},
  172. </if>
  173. <if test="ca_text5 != null">
  174. ca_text5 = #{ca_text5,jdbcType=VARCHAR},
  175. </if>
  176. <if test="ca_address != null">
  177. ca_address = #{ca_address,jdbcType=LONGVARCHAR},
  178. </if>
  179. </set>
  180. where ca_id = #{id,jdbcType=INTEGER}
  181. </update>
  182. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Customeraddress">
  183. update customeraddress
  184. set ca_cuid = #{ca_cuid,jdbcType=INTEGER},
  185. ca_detno = #{ca_detno,jdbcType=INTEGER},
  186. ca_person = #{ca_person,jdbcType=VARCHAR},
  187. ca_phone = #{ca_phone,jdbcType=VARCHAR},
  188. ca_default = #{ca_default,jdbcType=INTEGER},
  189. companyid = #{companyId,jdbcType=INTEGER},
  190. updaterid = #{updaterId,jdbcType=INTEGER},
  191. updatetime = #{updateTime,jdbcType=TIMESTAMP},
  192. ca_text1 = #{ca_text1,jdbcType=VARCHAR},
  193. ca_text2 = #{ca_text2,jdbcType=VARCHAR},
  194. ca_text3 = #{ca_text3,jdbcType=VARCHAR},
  195. ca_text4 = #{ca_text4,jdbcType=VARCHAR},
  196. ca_text5 = #{ca_text5,jdbcType=VARCHAR},
  197. ca_address = #{ca_address,jdbcType=LONGVARCHAR}
  198. where ca_id = #{id,jdbcType=INTEGER}
  199. </update>
  200. <select id="selectByFK" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
  201. select
  202. <include refid="Base_Column_List" />
  203. ,
  204. <include refid="Blob_Column_List" />
  205. from customeraddress
  206. where ca_cuid = #{fk_i,jdbcType=INTEGER}
  207. </select>
  208. <insert id="batchInsert" parameterType="java.util.List" >
  209. insert into customeraddress
  210. (ca_cuid,ca_detno,ca_person,ca_address,ca_phone,
  211. ca_default,companyid,updaterid,updatetime,ca_text1,
  212. ca_text2,ca_text3,ca_text4,ca_text5) VALUES
  213. <foreach collection="list" item="item" index="index" open="" close="" separator=",">
  214. (
  215. #{item.ca_cuid,jdbcType=INTEGER},
  216. #{item.ca_detno,jdbcType=INTEGER},
  217. #{item.ca_person,jdbcType=VARCHAR},
  218. #{item.ca_address,jdbcType=LONGVARCHAR},
  219. #{item.ca_phone,jdbcType=VARCHAR},
  220. #{item.ca_default,jdbcType=INTEGER},
  221. #{item.companyId,jdbcType=INTEGER},
  222. #{item.updaterId,jdbcType=INTEGER},
  223. #{item.updateTime,jdbcType=TIMESTAMP},
  224. #{item.ca_text1,jdbcType=VARCHAR},
  225. #{item.ca_text2,jdbcType=VARCHAR},
  226. #{item.ca_text3,jdbcType=VARCHAR},
  227. #{item.ca_text4,jdbcType=VARCHAR},
  228. #{item.ca_text5,jdbcType=VARCHAR}
  229. )
  230. </foreach>
  231. </insert>
  232. <update id="batchUpdate" parameterType="com.usoftchina.saas.document.entities.Customeraddress" >
  233. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  234. update customeraddress
  235. <set>
  236. <if test="item.ca_detno != null">
  237. ca_detno = #{item.ca_detno,jdbcType=INTEGER},
  238. </if>
  239. <if test="item.ca_person != null">
  240. ca_person = #{item.ca_person,jdbcType=VARCHAR},
  241. </if>
  242. <if test="item.ca_phone != null">
  243. ca_phone = #{item.ca_phone,jdbcType=VARCHAR},
  244. </if>
  245. <if test="item.ca_default != null">
  246. ca_default = #{item.ca_default,jdbcType=INTEGER},
  247. </if>
  248. <if test="item.companyId != null">
  249. companyid = #{item.companyId,jdbcType=INTEGER},
  250. </if>
  251. <if test="item.updaterId != null">
  252. updaterid = #{item.updaterId,jdbcType=INTEGER},
  253. </if>
  254. <if test="item.updateTime != null">
  255. updatetime = #{item.updateTime,jdbcType=TIMESTAMP},
  256. </if>
  257. <if test="item.ca_text1 != null">
  258. ca_text1 = #{item.ca_text1,jdbcType=VARCHAR},
  259. </if>
  260. <if test="item.ca_text2 != null">
  261. ca_text2 = #{item.ca_text2,jdbcType=VARCHAR},
  262. </if>
  263. <if test="item.ca_text3 != null">
  264. ca_text3 = #{item.ca_text3,jdbcType=VARCHAR},
  265. </if>
  266. <if test="item.ca_text4 != null">
  267. ca_text4 = #{item.ca_text4,jdbcType=VARCHAR},
  268. </if>
  269. <if test="item.ca_text5 != null">
  270. ca_text5 = #{item.ca_text5,jdbcType=VARCHAR},
  271. </if>
  272. <if test="item.ca_address != null">
  273. ca_address = #{item.ca_address,jdbcType=LONGVARCHAR},
  274. </if>
  275. </set>
  276. where ca_id = #{item.id,jdbcType=INTEGER}
  277. </foreach>
  278. </update>
  279. <delete id="deleteByFK" parameterType="java.lang.Long">
  280. delete from customeraddress
  281. where ca_cuid = #{id,jdbcType=INTEGER}
  282. </delete>
  283. </mapper>