OmsCompanyAddressMapper.xml 10 KB

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