UmsMemberReceiveAddressMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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.yonge.cooleshow.mbg.mapper.UmsMemberReceiveAddressMapper">
  4. <resultMap id="BaseResultMap" type="com.yonge.cooleshow.mbg.model.UmsMemberReceiveAddress">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="member_id" jdbcType="BIGINT" property="memberId" />
  7. <result column="name" jdbcType="VARCHAR" property="name" />
  8. <result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
  9. <result column="default_status" jdbcType="INTEGER" property="defaultStatus" />
  10. <result column="post_code" jdbcType="VARCHAR" property="postCode" />
  11. <result column="province" jdbcType="VARCHAR" property="province" />
  12. <result column="city" jdbcType="VARCHAR" property="city" />
  13. <result column="region" jdbcType="VARCHAR" property="region" />
  14. <result column="detail_address" jdbcType="VARCHAR" property="detailAddress" />
  15. </resultMap>
  16. <sql id="Example_Where_Clause">
  17. <where>
  18. <foreach collection="oredCriteria" item="criteria" separator="or">
  19. <if test="criteria.valid">
  20. <trim prefix="(" prefixOverrides="and" suffix=")">
  21. <foreach collection="criteria.criteria" item="criterion">
  22. <choose>
  23. <when test="criterion.noValue">
  24. and ${criterion.condition}
  25. </when>
  26. <when test="criterion.singleValue">
  27. and ${criterion.condition} #{criterion.value}
  28. </when>
  29. <when test="criterion.betweenValue">
  30. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  31. </when>
  32. <when test="criterion.listValue">
  33. and ${criterion.condition}
  34. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  35. #{listItem}
  36. </foreach>
  37. </when>
  38. </choose>
  39. </foreach>
  40. </trim>
  41. </if>
  42. </foreach>
  43. </where>
  44. </sql>
  45. <sql id="Update_By_Example_Where_Clause">
  46. <where>
  47. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  48. <if test="criteria.valid">
  49. <trim prefix="(" prefixOverrides="and" suffix=")">
  50. <foreach collection="criteria.criteria" item="criterion">
  51. <choose>
  52. <when test="criterion.noValue">
  53. and ${criterion.condition}
  54. </when>
  55. <when test="criterion.singleValue">
  56. and ${criterion.condition} #{criterion.value}
  57. </when>
  58. <when test="criterion.betweenValue">
  59. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  60. </when>
  61. <when test="criterion.listValue">
  62. and ${criterion.condition}
  63. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  64. #{listItem}
  65. </foreach>
  66. </when>
  67. </choose>
  68. </foreach>
  69. </trim>
  70. </if>
  71. </foreach>
  72. </where>
  73. </sql>
  74. <sql id="Base_Column_List">
  75. id, member_id, name, phone_number, default_status, post_code, province, city, region,
  76. detail_address
  77. </sql>
  78. <select id="selectByExample" parameterType="com.yonge.cooleshow.mbg.model.UmsMemberReceiveAddressExample" resultMap="BaseResultMap">
  79. select
  80. <if test="distinct">
  81. distinct
  82. </if>
  83. <include refid="Base_Column_List" />
  84. from ums_member_receive_address
  85. <if test="_parameter != null">
  86. <include refid="Example_Where_Clause" />
  87. </if>
  88. <if test="orderByClause != null">
  89. order by ${orderByClause}
  90. </if>
  91. </select>
  92. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  93. select
  94. <include refid="Base_Column_List" />
  95. from ums_member_receive_address
  96. where id = #{id,jdbcType=BIGINT}
  97. </select>
  98. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  99. delete from ums_member_receive_address
  100. where id = #{id,jdbcType=BIGINT}
  101. </delete>
  102. <delete id="deleteByExample" parameterType="com.yonge.cooleshow.mbg.model.UmsMemberReceiveAddressExample">
  103. delete from ums_member_receive_address
  104. <if test="_parameter != null">
  105. <include refid="Example_Where_Clause" />
  106. </if>
  107. </delete>
  108. <insert id="insert" parameterType="com.yonge.cooleshow.mbg.model.UmsMemberReceiveAddress">
  109. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  110. SELECT LAST_INSERT_ID()
  111. </selectKey>
  112. insert into ums_member_receive_address (member_id, name, phone_number,
  113. default_status, post_code, province,
  114. city, region, detail_address
  115. )
  116. values (#{memberId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{phoneNumber,jdbcType=VARCHAR},
  117. #{defaultStatus,jdbcType=INTEGER}, #{postCode,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR},
  118. #{city,jdbcType=VARCHAR}, #{region,jdbcType=VARCHAR}, #{detailAddress,jdbcType=VARCHAR}
  119. )
  120. </insert>
  121. <insert id="insertSelective" parameterType="com.yonge.cooleshow.mbg.model.UmsMemberReceiveAddress">
  122. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  123. SELECT LAST_INSERT_ID()
  124. </selectKey>
  125. insert into ums_member_receive_address
  126. <trim prefix="(" suffix=")" suffixOverrides=",">
  127. <if test="memberId != null">
  128. member_id,
  129. </if>
  130. <if test="name != null">
  131. name,
  132. </if>
  133. <if test="phoneNumber != null">
  134. phone_number,
  135. </if>
  136. <if test="defaultStatus != null">
  137. default_status,
  138. </if>
  139. <if test="postCode != null">
  140. post_code,
  141. </if>
  142. <if test="province != null">
  143. province,
  144. </if>
  145. <if test="city != null">
  146. city,
  147. </if>
  148. <if test="region != null">
  149. region,
  150. </if>
  151. <if test="detailAddress != null">
  152. detail_address,
  153. </if>
  154. </trim>
  155. <trim prefix="values (" suffix=")" suffixOverrides=",">
  156. <if test="memberId != null">
  157. #{memberId,jdbcType=BIGINT},
  158. </if>
  159. <if test="name != null">
  160. #{name,jdbcType=VARCHAR},
  161. </if>
  162. <if test="phoneNumber != null">
  163. #{phoneNumber,jdbcType=VARCHAR},
  164. </if>
  165. <if test="defaultStatus != null">
  166. #{defaultStatus,jdbcType=INTEGER},
  167. </if>
  168. <if test="postCode != null">
  169. #{postCode,jdbcType=VARCHAR},
  170. </if>
  171. <if test="province != null">
  172. #{province,jdbcType=VARCHAR},
  173. </if>
  174. <if test="city != null">
  175. #{city,jdbcType=VARCHAR},
  176. </if>
  177. <if test="region != null">
  178. #{region,jdbcType=VARCHAR},
  179. </if>
  180. <if test="detailAddress != null">
  181. #{detailAddress,jdbcType=VARCHAR},
  182. </if>
  183. </trim>
  184. </insert>
  185. <select id="countByExample" parameterType="com.yonge.cooleshow.mbg.model.UmsMemberReceiveAddressExample" resultType="java.lang.Long">
  186. select count(*) from ums_member_receive_address
  187. <if test="_parameter != null">
  188. <include refid="Example_Where_Clause" />
  189. </if>
  190. </select>
  191. <update id="updateByExampleSelective" parameterType="map">
  192. update ums_member_receive_address
  193. <set>
  194. <if test="record.id != null">
  195. id = #{record.id,jdbcType=BIGINT},
  196. </if>
  197. <if test="record.memberId != null">
  198. member_id = #{record.memberId,jdbcType=BIGINT},
  199. </if>
  200. <if test="record.name != null">
  201. name = #{record.name,jdbcType=VARCHAR},
  202. </if>
  203. <if test="record.phoneNumber != null">
  204. phone_number = #{record.phoneNumber,jdbcType=VARCHAR},
  205. </if>
  206. <if test="record.defaultStatus != null">
  207. default_status = #{record.defaultStatus,jdbcType=INTEGER},
  208. </if>
  209. <if test="record.postCode != null">
  210. post_code = #{record.postCode,jdbcType=VARCHAR},
  211. </if>
  212. <if test="record.province != null">
  213. province = #{record.province,jdbcType=VARCHAR},
  214. </if>
  215. <if test="record.city != null">
  216. city = #{record.city,jdbcType=VARCHAR},
  217. </if>
  218. <if test="record.region != null">
  219. region = #{record.region,jdbcType=VARCHAR},
  220. </if>
  221. <if test="record.detailAddress != null">
  222. detail_address = #{record.detailAddress,jdbcType=VARCHAR},
  223. </if>
  224. </set>
  225. <if test="_parameter != null">
  226. <include refid="Update_By_Example_Where_Clause" />
  227. </if>
  228. </update>
  229. <update id="updateByExample" parameterType="map">
  230. update ums_member_receive_address
  231. set id = #{record.id,jdbcType=BIGINT},
  232. member_id = #{record.memberId,jdbcType=BIGINT},
  233. name = #{record.name,jdbcType=VARCHAR},
  234. phone_number = #{record.phoneNumber,jdbcType=VARCHAR},
  235. default_status = #{record.defaultStatus,jdbcType=INTEGER},
  236. post_code = #{record.postCode,jdbcType=VARCHAR},
  237. province = #{record.province,jdbcType=VARCHAR},
  238. city = #{record.city,jdbcType=VARCHAR},
  239. region = #{record.region,jdbcType=VARCHAR},
  240. detail_address = #{record.detailAddress,jdbcType=VARCHAR}
  241. <if test="_parameter != null">
  242. <include refid="Update_By_Example_Where_Clause" />
  243. </if>
  244. </update>
  245. <update id="updateByPrimaryKeySelective" parameterType="com.yonge.cooleshow.mbg.model.UmsMemberReceiveAddress">
  246. update ums_member_receive_address
  247. <set>
  248. <if test="memberId != null">
  249. member_id = #{memberId,jdbcType=BIGINT},
  250. </if>
  251. <if test="name != null">
  252. name = #{name,jdbcType=VARCHAR},
  253. </if>
  254. <if test="phoneNumber != null">
  255. phone_number = #{phoneNumber,jdbcType=VARCHAR},
  256. </if>
  257. <if test="defaultStatus != null">
  258. default_status = #{defaultStatus,jdbcType=INTEGER},
  259. </if>
  260. <if test="postCode != null">
  261. post_code = #{postCode,jdbcType=VARCHAR},
  262. </if>
  263. <if test="province != null">
  264. province = #{province,jdbcType=VARCHAR},
  265. </if>
  266. <if test="city != null">
  267. city = #{city,jdbcType=VARCHAR},
  268. </if>
  269. <if test="region != null">
  270. region = #{region,jdbcType=VARCHAR},
  271. </if>
  272. <if test="detailAddress != null">
  273. detail_address = #{detailAddress,jdbcType=VARCHAR},
  274. </if>
  275. </set>
  276. where id = #{id,jdbcType=BIGINT}
  277. </update>
  278. <update id="updateByPrimaryKey" parameterType="com.yonge.cooleshow.mbg.model.UmsMemberReceiveAddress">
  279. update ums_member_receive_address
  280. set member_id = #{memberId,jdbcType=BIGINT},
  281. name = #{name,jdbcType=VARCHAR},
  282. phone_number = #{phoneNumber,jdbcType=VARCHAR},
  283. default_status = #{defaultStatus,jdbcType=INTEGER},
  284. post_code = #{postCode,jdbcType=VARCHAR},
  285. province = #{province,jdbcType=VARCHAR},
  286. city = #{city,jdbcType=VARCHAR},
  287. region = #{region,jdbcType=VARCHAR},
  288. detail_address = #{detailAddress,jdbcType=VARCHAR}
  289. where id = #{id,jdbcType=BIGINT}
  290. </update>
  291. </mapper>