OrderFormInfoDOMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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.cdu.lys.graduation.repository.dao.OrderFormInfoDOMapper" >
  4. <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.OrderFormInfoDO" >
  5. <constructor >
  6. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  7. <arg column="order_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  8. <arg column="order_num" jdbcType="VARCHAR" javaType="java.lang.String" />
  9. <arg column="goods_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  10. <arg column="goods_pic" jdbcType="VARCHAR" javaType="java.lang.String" />
  11. <arg column="goods_name" jdbcType="VARCHAR" javaType="java.lang.String" />
  12. <arg column="goods_price" jdbcType="DOUBLE" javaType="java.lang.Double" />
  13. <arg column="goods_quantity" jdbcType="INTEGER" javaType="java.lang.Integer" />
  14. <arg column="extra_price" jdbcType="DOUBLE" javaType="java.lang.Double" />
  15. <arg column="extra_options" jdbcType="VARCHAR" javaType="java.lang.String" />
  16. <arg column="delivery_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
  17. <arg column="create_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  18. <arg column="update_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  19. </constructor>
  20. </resultMap>
  21. <sql id="Example_Where_Clause" >
  22. <where >
  23. <foreach collection="oredCriteria" item="criteria" separator="or" >
  24. <if test="criteria.valid" >
  25. <trim prefix="(" suffix=")" prefixOverrides="and" >
  26. <foreach collection="criteria.criteria" item="criterion" >
  27. <choose >
  28. <when test="criterion.noValue" >
  29. and ${criterion.condition}
  30. </when>
  31. <when test="criterion.singleValue" >
  32. and ${criterion.condition} #{criterion.value}
  33. </when>
  34. <when test="criterion.betweenValue" >
  35. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  36. </when>
  37. <when test="criterion.listValue" >
  38. and ${criterion.condition}
  39. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  40. #{listItem}
  41. </foreach>
  42. </when>
  43. </choose>
  44. </foreach>
  45. </trim>
  46. </if>
  47. </foreach>
  48. </where>
  49. </sql>
  50. <sql id="Update_By_Example_Where_Clause" >
  51. <where >
  52. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  53. <if test="criteria.valid" >
  54. <trim prefix="(" suffix=")" prefixOverrides="and" >
  55. <foreach collection="criteria.criteria" item="criterion" >
  56. <choose >
  57. <when test="criterion.noValue" >
  58. and ${criterion.condition}
  59. </when>
  60. <when test="criterion.singleValue" >
  61. and ${criterion.condition} #{criterion.value}
  62. </when>
  63. <when test="criterion.betweenValue" >
  64. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  65. </when>
  66. <when test="criterion.listValue" >
  67. and ${criterion.condition}
  68. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  69. #{listItem}
  70. </foreach>
  71. </when>
  72. </choose>
  73. </foreach>
  74. </trim>
  75. </if>
  76. </foreach>
  77. </where>
  78. </sql>
  79. <sql id="Base_Column_List" >
  80. id, order_id, order_num, goods_id, goods_pic, goods_name, goods_price, goods_quantity,
  81. extra_price, extra_options, delivery_status, create_time, update_time
  82. </sql>
  83. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormInfoDOExample" >
  84. select
  85. <if test="distinct" >
  86. distinct
  87. </if>
  88. 'true' as QUERYID,
  89. <include refid="Base_Column_List" />
  90. from tb_order_form_info
  91. <if test="_parameter != null" >
  92. <include refid="Example_Where_Clause" />
  93. </if>
  94. <if test="orderByClause != null" >
  95. order by ${orderByClause}
  96. </if>
  97. </select>
  98. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  99. select
  100. <include refid="Base_Column_List" />
  101. from tb_order_form_info
  102. where id = #{id,jdbcType=INTEGER}
  103. </select>
  104. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  105. delete from tb_order_form_info
  106. where id = #{id,jdbcType=INTEGER}
  107. </delete>
  108. <delete id="deleteByExample" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormInfoDOExample" >
  109. delete from tb_order_form_info
  110. <if test="_parameter != null" >
  111. <include refid="Example_Where_Clause" />
  112. </if>
  113. </delete>
  114. <insert id="insert" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormInfoDO" >
  115. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  116. SELECT LAST_INSERT_ID()
  117. </selectKey>
  118. insert into tb_order_form_info (order_id, order_num, goods_id,
  119. goods_pic, goods_name, goods_price,
  120. goods_quantity, extra_price, extra_options,
  121. delivery_status, create_time, update_time
  122. )
  123. values (#{orderId,jdbcType=INTEGER}, #{orderNum,jdbcType=VARCHAR}, #{goodsId,jdbcType=INTEGER},
  124. #{goodsPic,jdbcType=VARCHAR}, #{goodsName,jdbcType=VARCHAR}, #{goodsPrice,jdbcType=DOUBLE},
  125. #{goodsQuantity,jdbcType=INTEGER}, #{extraPrice,jdbcType=DOUBLE}, #{extraOptions,jdbcType=VARCHAR},
  126. #{deliveryStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
  127. )
  128. </insert>
  129. <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormInfoDO" >
  130. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  131. SELECT LAST_INSERT_ID()
  132. </selectKey>
  133. insert into tb_order_form_info
  134. <trim prefix="(" suffix=")" suffixOverrides="," >
  135. <if test="orderId != null" >
  136. order_id,
  137. </if>
  138. <if test="orderNum != null" >
  139. order_num,
  140. </if>
  141. <if test="goodsId != null" >
  142. goods_id,
  143. </if>
  144. <if test="goodsPic != null" >
  145. goods_pic,
  146. </if>
  147. <if test="goodsName != null" >
  148. goods_name,
  149. </if>
  150. <if test="goodsPrice != null" >
  151. goods_price,
  152. </if>
  153. <if test="goodsQuantity != null" >
  154. goods_quantity,
  155. </if>
  156. <if test="extraPrice != null" >
  157. extra_price,
  158. </if>
  159. <if test="extraOptions != null" >
  160. extra_options,
  161. </if>
  162. <if test="deliveryStatus != null" >
  163. delivery_status,
  164. </if>
  165. <if test="createTime != null" >
  166. create_time,
  167. </if>
  168. <if test="updateTime != null" >
  169. update_time,
  170. </if>
  171. </trim>
  172. <trim prefix="values (" suffix=")" suffixOverrides="," >
  173. <if test="orderId != null" >
  174. #{orderId,jdbcType=INTEGER},
  175. </if>
  176. <if test="orderNum != null" >
  177. #{orderNum,jdbcType=VARCHAR},
  178. </if>
  179. <if test="goodsId != null" >
  180. #{goodsId,jdbcType=INTEGER},
  181. </if>
  182. <if test="goodsPic != null" >
  183. #{goodsPic,jdbcType=VARCHAR},
  184. </if>
  185. <if test="goodsName != null" >
  186. #{goodsName,jdbcType=VARCHAR},
  187. </if>
  188. <if test="goodsPrice != null" >
  189. #{goodsPrice,jdbcType=DOUBLE},
  190. </if>
  191. <if test="goodsQuantity != null" >
  192. #{goodsQuantity,jdbcType=INTEGER},
  193. </if>
  194. <if test="extraPrice != null" >
  195. #{extraPrice,jdbcType=DOUBLE},
  196. </if>
  197. <if test="extraOptions != null" >
  198. #{extraOptions,jdbcType=VARCHAR},
  199. </if>
  200. <if test="deliveryStatus != null" >
  201. #{deliveryStatus,jdbcType=INTEGER},
  202. </if>
  203. <if test="createTime != null" >
  204. #{createTime,jdbcType=TIMESTAMP},
  205. </if>
  206. <if test="updateTime != null" >
  207. #{updateTime,jdbcType=TIMESTAMP},
  208. </if>
  209. </trim>
  210. </insert>
  211. <select id="countByExample" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormInfoDOExample" resultType="java.lang.Integer" >
  212. select count(*) from tb_order_form_info
  213. <if test="_parameter != null" >
  214. <include refid="Example_Where_Clause" />
  215. </if>
  216. </select>
  217. <update id="updateByExampleSelective" parameterType="map" >
  218. update tb_order_form_info
  219. <set >
  220. <if test="record.id != null" >
  221. id = #{record.id,jdbcType=INTEGER},
  222. </if>
  223. <if test="record.orderId != null" >
  224. order_id = #{record.orderId,jdbcType=INTEGER},
  225. </if>
  226. <if test="record.orderNum != null" >
  227. order_num = #{record.orderNum,jdbcType=VARCHAR},
  228. </if>
  229. <if test="record.goodsId != null" >
  230. goods_id = #{record.goodsId,jdbcType=INTEGER},
  231. </if>
  232. <if test="record.goodsPic != null" >
  233. goods_pic = #{record.goodsPic,jdbcType=VARCHAR},
  234. </if>
  235. <if test="record.goodsName != null" >
  236. goods_name = #{record.goodsName,jdbcType=VARCHAR},
  237. </if>
  238. <if test="record.goodsPrice != null" >
  239. goods_price = #{record.goodsPrice,jdbcType=DOUBLE},
  240. </if>
  241. <if test="record.goodsQuantity != null" >
  242. goods_quantity = #{record.goodsQuantity,jdbcType=INTEGER},
  243. </if>
  244. <if test="record.extraPrice != null" >
  245. extra_price = #{record.extraPrice,jdbcType=DOUBLE},
  246. </if>
  247. <if test="record.extraOptions != null" >
  248. extra_options = #{record.extraOptions,jdbcType=VARCHAR},
  249. </if>
  250. <if test="record.deliveryStatus != null" >
  251. delivery_status = #{record.deliveryStatus,jdbcType=INTEGER},
  252. </if>
  253. <if test="record.createTime != null" >
  254. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  255. </if>
  256. <if test="record.updateTime != null" >
  257. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  258. </if>
  259. </set>
  260. <if test="_parameter != null" >
  261. <include refid="Update_By_Example_Where_Clause" />
  262. </if>
  263. </update>
  264. <update id="updateByExample" parameterType="map" >
  265. update tb_order_form_info
  266. set id = #{record.id,jdbcType=INTEGER},
  267. order_id = #{record.orderId,jdbcType=INTEGER},
  268. order_num = #{record.orderNum,jdbcType=VARCHAR},
  269. goods_id = #{record.goodsId,jdbcType=INTEGER},
  270. goods_pic = #{record.goodsPic,jdbcType=VARCHAR},
  271. goods_name = #{record.goodsName,jdbcType=VARCHAR},
  272. goods_price = #{record.goodsPrice,jdbcType=DOUBLE},
  273. goods_quantity = #{record.goodsQuantity,jdbcType=INTEGER},
  274. extra_price = #{record.extraPrice,jdbcType=DOUBLE},
  275. extra_options = #{record.extraOptions,jdbcType=VARCHAR},
  276. delivery_status = #{record.deliveryStatus,jdbcType=INTEGER},
  277. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  278. update_time = #{record.updateTime,jdbcType=TIMESTAMP}
  279. <if test="_parameter != null" >
  280. <include refid="Update_By_Example_Where_Clause" />
  281. </if>
  282. </update>
  283. <update id="updateByPrimaryKeySelective" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormInfoDO" >
  284. update tb_order_form_info
  285. <set >
  286. <if test="orderId != null" >
  287. order_id = #{orderId,jdbcType=INTEGER},
  288. </if>
  289. <if test="orderNum != null" >
  290. order_num = #{orderNum,jdbcType=VARCHAR},
  291. </if>
  292. <if test="goodsId != null" >
  293. goods_id = #{goodsId,jdbcType=INTEGER},
  294. </if>
  295. <if test="goodsPic != null" >
  296. goods_pic = #{goodsPic,jdbcType=VARCHAR},
  297. </if>
  298. <if test="goodsName != null" >
  299. goods_name = #{goodsName,jdbcType=VARCHAR},
  300. </if>
  301. <if test="goodsPrice != null" >
  302. goods_price = #{goodsPrice,jdbcType=DOUBLE},
  303. </if>
  304. <if test="goodsQuantity != null" >
  305. goods_quantity = #{goodsQuantity,jdbcType=INTEGER},
  306. </if>
  307. <if test="extraPrice != null" >
  308. extra_price = #{extraPrice,jdbcType=DOUBLE},
  309. </if>
  310. <if test="extraOptions != null" >
  311. extra_options = #{extraOptions,jdbcType=VARCHAR},
  312. </if>
  313. <if test="deliveryStatus != null" >
  314. delivery_status = #{deliveryStatus,jdbcType=INTEGER},
  315. </if>
  316. <if test="createTime != null" >
  317. create_time = #{createTime,jdbcType=TIMESTAMP},
  318. </if>
  319. <if test="updateTime != null" >
  320. update_time = #{updateTime,jdbcType=TIMESTAMP},
  321. </if>
  322. </set>
  323. where id = #{id,jdbcType=INTEGER}
  324. </update>
  325. <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormInfoDO" >
  326. update tb_order_form_info
  327. set order_id = #{orderId,jdbcType=INTEGER},
  328. order_num = #{orderNum,jdbcType=VARCHAR},
  329. goods_id = #{goodsId,jdbcType=INTEGER},
  330. goods_pic = #{goodsPic,jdbcType=VARCHAR},
  331. goods_name = #{goodsName,jdbcType=VARCHAR},
  332. goods_price = #{goodsPrice,jdbcType=DOUBLE},
  333. goods_quantity = #{goodsQuantity,jdbcType=INTEGER},
  334. extra_price = #{extraPrice,jdbcType=DOUBLE},
  335. extra_options = #{extraOptions,jdbcType=VARCHAR},
  336. delivery_status = #{deliveryStatus,jdbcType=INTEGER},
  337. create_time = #{createTime,jdbcType=TIMESTAMP},
  338. update_time = #{updateTime,jdbcType=TIMESTAMP}
  339. where id = #{id,jdbcType=INTEGER}
  340. </update>
  341. </mapper>