AddressMapper.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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.AddressMapper">
  4. <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Address">
  5. <id column="ad_id" jdbcType="INTEGER" property="id" />
  6. <result column="ad_recorddate" jdbcType="TIMESTAMP" property="ad_recorddate" />
  7. <result column="companyId" jdbcType="INTEGER" property="companyId" />
  8. <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
  9. <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
  10. <result column="ad_text1" jdbcType="VARCHAR" property="ad_text1" />
  11. <result column="ad_text2" jdbcType="VARCHAR" property="ad_text2" />
  12. <result column="ad_text3" jdbcType="VARCHAR" property="ad_text3" />
  13. <result column="ad_text4" jdbcType="VARCHAR" property="ad_text4" />
  14. <result column="ad_text5" jdbcType="VARCHAR" property="ad_text5" />
  15. </resultMap>
  16. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Address">
  17. <result column="ad_address" jdbcType="LONGVARCHAR" property="ad_address" />
  18. </resultMap>
  19. <sql id="Base_Column_List">
  20. ad_id, ad_recorddate, companyId, updaterId, updateTime, ad_text1, ad_text2, ad_text3,
  21. ad_text4, ad_text5
  22. </sql>
  23. <sql id="Blob_Column_List">
  24. ad_address
  25. </sql>
  26. <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Address">
  27. insert into address (ad_recorddate, companyId,
  28. updaterId, updateTime, ad_text1,
  29. ad_text2, ad_text3, ad_text4,
  30. ad_text5, ad_address)
  31. values (#{ad_recorddate,jdbcType=TIMESTAMP}, #{companyId,jdbcType=INTEGER},
  32. #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{ad_text1,jdbcType=VARCHAR},
  33. #{ad_text2,jdbcType=VARCHAR}, #{ad_text3,jdbcType=VARCHAR}, #{ad_text4,jdbcType=VARCHAR},
  34. #{ad_text5,jdbcType=VARCHAR}, #{ad_address,jdbcType=LONGVARCHAR})
  35. </insert>
  36. <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Address">
  37. insert into address
  38. <trim prefix="(" suffix=")" suffixOverrides=",">
  39. <if test="ad_recorddate != null">
  40. ad_recorddate,
  41. </if>
  42. <if test="companyId != null">
  43. companyId,
  44. </if>
  45. <if test="updaterId != null">
  46. updaterId,
  47. </if>
  48. <if test="updateTime != null">
  49. updateTime,
  50. </if>
  51. <if test="ad_text1 != null">
  52. ad_text1,
  53. </if>
  54. <if test="ad_text2 != null">
  55. ad_text2,
  56. </if>
  57. <if test="ad_text3 != null">
  58. ad_text3,
  59. </if>
  60. <if test="ad_text4 != null">
  61. ad_text4,
  62. </if>
  63. <if test="ad_text5 != null">
  64. ad_text5,
  65. </if>
  66. <if test="ad_address != null">
  67. ad_address,
  68. </if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="ad_recorddate != null">
  72. #{ad_recorddate,jdbcType=TIMESTAMP},
  73. </if>
  74. <if test="companyId != null">
  75. #{companyId,jdbcType=INTEGER},
  76. </if>
  77. <if test="updaterId != null">
  78. #{updaterId,jdbcType=INTEGER},
  79. </if>
  80. <if test="updateTime != null">
  81. #{updateTime,jdbcType=TIMESTAMP},
  82. </if>
  83. <if test="ad_text1 != null">
  84. #{ad_text1,jdbcType=VARCHAR},
  85. </if>
  86. <if test="ad_text2 != null">
  87. #{ad_text2,jdbcType=VARCHAR},
  88. </if>
  89. <if test="ad_text3 != null">
  90. #{ad_text3,jdbcType=VARCHAR},
  91. </if>
  92. <if test="ad_text4 != null">
  93. #{ad_text4,jdbcType=VARCHAR},
  94. </if>
  95. <if test="ad_text5 != null">
  96. #{ad_text5,jdbcType=VARCHAR},
  97. </if>
  98. <if test="ad_address != null">
  99. #{ad_address,jdbcType=LONGVARCHAR},
  100. </if>
  101. </trim>
  102. </insert>
  103. <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Address">
  104. update address
  105. <set>
  106. <if test="ad_recorddate != null">
  107. ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
  108. </if>
  109. <if test="companyId != null">
  110. companyId = #{companyId,jdbcType=INTEGER},
  111. </if>
  112. <if test="updaterId != null">
  113. updaterId = #{updaterId,jdbcType=INTEGER},
  114. </if>
  115. <if test="updateTime != null">
  116. updateTime = #{updateTime,jdbcType=TIMESTAMP},
  117. </if>
  118. <if test="ad_text1 != null">
  119. ad_text1 = #{ad_text1,jdbcType=VARCHAR},
  120. </if>
  121. <if test="ad_text2 != null">
  122. ad_text2 = #{ad_text2,jdbcType=VARCHAR},
  123. </if>
  124. <if test="ad_text3 != null">
  125. ad_text3 = #{ad_text3,jdbcType=VARCHAR},
  126. </if>
  127. <if test="ad_text4 != null">
  128. ad_text4 = #{ad_text4,jdbcType=VARCHAR},
  129. </if>
  130. <if test="ad_text5 != null">
  131. ad_text5 = #{ad_text5,jdbcType=VARCHAR},
  132. </if>
  133. <if test="ad_address != null">
  134. ad_address = #{ad_address,jdbcType=LONGVARCHAR},
  135. </if>
  136. </set>
  137. where ad_id = #{ad_id,jdbcType=INTEGER}
  138. </update>
  139. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Address">
  140. update address
  141. set ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
  142. companyId = #{companyId,jdbcType=INTEGER},
  143. updaterId = #{updaterId,jdbcType=INTEGER},
  144. updateTime = #{updateTime,jdbcType=TIMESTAMP},
  145. ad_text1 = #{ad_text1,jdbcType=VARCHAR},
  146. ad_text2 = #{ad_text2,jdbcType=VARCHAR},
  147. ad_text3 = #{ad_text3,jdbcType=VARCHAR},
  148. ad_text4 = #{ad_text4,jdbcType=VARCHAR},
  149. ad_text5 = #{ad_text5,jdbcType=VARCHAR},
  150. ad_address = #{ad_address,jdbcType=LONGVARCHAR}
  151. where ad_id = #{id}
  152. </update>
  153. <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Address">
  154. update address
  155. set ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
  156. companyId = #{companyId,jdbcType=INTEGER},
  157. updaterId = #{updaterId,jdbcType=INTEGER},
  158. updateTime = #{updateTime,jdbcType=TIMESTAMP},
  159. ad_text1 = #{ad_text1,jdbcType=VARCHAR},
  160. ad_text2 = #{ad_text2,jdbcType=VARCHAR},
  161. ad_text3 = #{ad_text3,jdbcType=VARCHAR},
  162. ad_text4 = #{ad_text4,jdbcType=VARCHAR},
  163. ad_text5 = #{ad_text5,jdbcType=VARCHAR}
  164. where ad_id = #{id}
  165. </update>
  166. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  167. delete from address
  168. where ad_id = #{id}
  169. </delete>
  170. <delete id="deleteByIds" parameterType="java.lang.String">
  171. delete from address
  172. where ad_id in (#{ids,jdbcType=VARCHAR})
  173. </delete>
  174. <select id="selectAll" resultMap="ResultMapWithBLOBs">
  175. SELECT * FROM ADDRESS
  176. </select>
  177. </mapper>