TOrderDetailMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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.goafanti.common.dao.TOrderDetailMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderDetail">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  12. <result column="commodity_id" jdbcType="VARCHAR" property="commodityId" />
  13. <result column="commodity_name" jdbcType="VARCHAR" property="commodityName" />
  14. <result column="commodity_quantity" jdbcType="INTEGER" property="commodityQuantity" />
  15. <result column="commodity_price" jdbcType="DECIMAL" property="commodityPrice" />
  16. <result column="commodity_first_payment" jdbcType="DECIMAL" property="commodityFirstPayment" />
  17. <result column="commodity_type" jdbcType="INTEGER" property="commodityType" />
  18. <result column="commodity_mode" jdbcType="VARCHAR" property="commodityMode" />
  19. <result column="discount_price" jdbcType="DECIMAL" property="discountPrice" />
  20. <result column="discount_first_payment" jdbcType="DECIMAL" property="discountFirstPayment" />
  21. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  22. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  23. </resultMap>
  24. <sql id="Example_Where_Clause">
  25. <!--
  26. WARNING - @mbg.generated
  27. This element is automatically generated by MyBatis Generator, do not modify.
  28. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  29. -->
  30. <where>
  31. <foreach collection="oredCriteria" item="criteria" separator="or">
  32. <if test="criteria.valid">
  33. <trim prefix="(" prefixOverrides="and" suffix=")">
  34. <foreach collection="criteria.criteria" item="criterion">
  35. <choose>
  36. <when test="criterion.noValue">
  37. and ${criterion.condition}
  38. </when>
  39. <when test="criterion.singleValue">
  40. and ${criterion.condition} #{criterion.value}
  41. </when>
  42. <when test="criterion.betweenValue">
  43. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  44. </when>
  45. <when test="criterion.listValue">
  46. and ${criterion.condition}
  47. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  48. #{listItem}
  49. </foreach>
  50. </when>
  51. </choose>
  52. </foreach>
  53. </trim>
  54. </if>
  55. </foreach>
  56. </where>
  57. </sql>
  58. <sql id="Update_By_Example_Where_Clause">
  59. <!--
  60. WARNING - @mbg.generated
  61. This element is automatically generated by MyBatis Generator, do not modify.
  62. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  63. -->
  64. <where>
  65. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  66. <if test="criteria.valid">
  67. <trim prefix="(" prefixOverrides="and" suffix=")">
  68. <foreach collection="criteria.criteria" item="criterion">
  69. <choose>
  70. <when test="criterion.noValue">
  71. and ${criterion.condition}
  72. </when>
  73. <when test="criterion.singleValue">
  74. and ${criterion.condition} #{criterion.value}
  75. </when>
  76. <when test="criterion.betweenValue">
  77. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  78. </when>
  79. <when test="criterion.listValue">
  80. and ${criterion.condition}
  81. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  82. #{listItem}
  83. </foreach>
  84. </when>
  85. </choose>
  86. </foreach>
  87. </trim>
  88. </if>
  89. </foreach>
  90. </where>
  91. </sql>
  92. <sql id="Base_Column_List">
  93. <!--
  94. WARNING - @mbg.generated
  95. This element is automatically generated by MyBatis Generator, do not modify.
  96. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  97. -->
  98. id, order_no, commodity_id, commodity_name, commodity_quantity, commodity_price,
  99. commodity_first_payment, commodity_type, commodity_mode, discount_price, discount_first_payment,
  100. create_time, remarks
  101. </sql>
  102. <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderDetailExample" resultMap="BaseResultMap">
  103. <!--
  104. WARNING - @mbg.generated
  105. This element is automatically generated by MyBatis Generator, do not modify.
  106. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  107. -->
  108. select
  109. <if test="distinct">
  110. distinct
  111. </if>
  112. <include refid="Base_Column_List" />
  113. from t_order_detail
  114. <if test="_parameter != null">
  115. <include refid="Example_Where_Clause" />
  116. </if>
  117. <if test="orderByClause != null">
  118. order by ${orderByClause}
  119. </if>
  120. </select>
  121. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  122. <!--
  123. WARNING - @mbg.generated
  124. This element is automatically generated by MyBatis Generator, do not modify.
  125. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  126. -->
  127. select
  128. <include refid="Base_Column_List" />
  129. from t_order_detail
  130. where id = #{id,jdbcType=VARCHAR}
  131. </select>
  132. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  133. <!--
  134. WARNING - @mbg.generated
  135. This element is automatically generated by MyBatis Generator, do not modify.
  136. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  137. -->
  138. delete from t_order_detail
  139. where id = #{id,jdbcType=VARCHAR}
  140. </delete>
  141. <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderDetailExample">
  142. <!--
  143. WARNING - @mbg.generated
  144. This element is automatically generated by MyBatis Generator, do not modify.
  145. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  146. -->
  147. delete from t_order_detail
  148. <if test="_parameter != null">
  149. <include refid="Example_Where_Clause" />
  150. </if>
  151. </delete>
  152. <insert id="insert" parameterType="com.goafanti.common.model.TOrderDetail">
  153. <!--
  154. WARNING - @mbg.generated
  155. This element is automatically generated by MyBatis Generator, do not modify.
  156. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  157. -->
  158. insert into t_order_detail (id, order_no, commodity_id,
  159. commodity_name, commodity_quantity, commodity_price,
  160. commodity_first_payment, commodity_type, commodity_mode,
  161. discount_price, discount_first_payment, create_time,
  162. remarks)
  163. values (#{id,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, #{commodityId,jdbcType=VARCHAR},
  164. #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL},
  165. #{commodityFirstPayment,jdbcType=DECIMAL}, #{commodityType,jdbcType=INTEGER}, #{commodityMode,jdbcType=VARCHAR},
  166. #{discountPrice,jdbcType=DECIMAL}, #{discountFirstPayment,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP},
  167. #{remarks,jdbcType=VARCHAR})
  168. </insert>
  169. <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderDetail">
  170. <!--
  171. WARNING - @mbg.generated
  172. This element is automatically generated by MyBatis Generator, do not modify.
  173. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  174. -->
  175. insert into t_order_detail
  176. <trim prefix="(" suffix=")" suffixOverrides=",">
  177. <if test="id != null">
  178. id,
  179. </if>
  180. <if test="orderNo != null">
  181. order_no,
  182. </if>
  183. <if test="commodityId != null">
  184. commodity_id,
  185. </if>
  186. <if test="commodityName != null">
  187. commodity_name,
  188. </if>
  189. <if test="commodityQuantity != null">
  190. commodity_quantity,
  191. </if>
  192. <if test="commodityPrice != null">
  193. commodity_price,
  194. </if>
  195. <if test="commodityFirstPayment != null">
  196. commodity_first_payment,
  197. </if>
  198. <if test="commodityType != null">
  199. commodity_type,
  200. </if>
  201. <if test="commodityMode != null">
  202. commodity_mode,
  203. </if>
  204. <if test="discountPrice != null">
  205. discount_price,
  206. </if>
  207. <if test="discountFirstPayment != null">
  208. discount_first_payment,
  209. </if>
  210. <if test="createTime != null">
  211. create_time,
  212. </if>
  213. <if test="remarks != null">
  214. remarks,
  215. </if>
  216. </trim>
  217. <trim prefix="values (" suffix=")" suffixOverrides=",">
  218. <if test="id != null">
  219. #{id,jdbcType=VARCHAR},
  220. </if>
  221. <if test="orderNo != null">
  222. #{orderNo,jdbcType=VARCHAR},
  223. </if>
  224. <if test="commodityId != null">
  225. #{commodityId,jdbcType=VARCHAR},
  226. </if>
  227. <if test="commodityName != null">
  228. #{commodityName,jdbcType=VARCHAR},
  229. </if>
  230. <if test="commodityQuantity != null">
  231. #{commodityQuantity,jdbcType=INTEGER},
  232. </if>
  233. <if test="commodityPrice != null">
  234. #{commodityPrice,jdbcType=DECIMAL},
  235. </if>
  236. <if test="commodityFirstPayment != null">
  237. #{commodityFirstPayment,jdbcType=DECIMAL},
  238. </if>
  239. <if test="commodityType != null">
  240. #{commodityType,jdbcType=INTEGER},
  241. </if>
  242. <if test="commodityMode != null">
  243. #{commodityMode,jdbcType=VARCHAR},
  244. </if>
  245. <if test="discountPrice != null">
  246. #{discountPrice,jdbcType=DECIMAL},
  247. </if>
  248. <if test="discountFirstPayment != null">
  249. #{discountFirstPayment,jdbcType=DECIMAL},
  250. </if>
  251. <if test="createTime != null">
  252. #{createTime,jdbcType=TIMESTAMP},
  253. </if>
  254. <if test="remarks != null">
  255. #{remarks,jdbcType=VARCHAR},
  256. </if>
  257. </trim>
  258. </insert>
  259. <select id="countByExample" parameterType="com.goafanti.common.model.TOrderDetailExample" resultType="java.lang.Long">
  260. <!--
  261. WARNING - @mbg.generated
  262. This element is automatically generated by MyBatis Generator, do not modify.
  263. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  264. -->
  265. select count(*) from t_order_detail
  266. <if test="_parameter != null">
  267. <include refid="Example_Where_Clause" />
  268. </if>
  269. </select>
  270. <update id="updateByExampleSelective" parameterType="map">
  271. <!--
  272. WARNING - @mbg.generated
  273. This element is automatically generated by MyBatis Generator, do not modify.
  274. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  275. -->
  276. update t_order_detail
  277. <set>
  278. <if test="record.id != null">
  279. id = #{record.id,jdbcType=VARCHAR},
  280. </if>
  281. <if test="record.orderNo != null">
  282. order_no = #{record.orderNo,jdbcType=VARCHAR},
  283. </if>
  284. <if test="record.commodityId != null">
  285. commodity_id = #{record.commodityId,jdbcType=VARCHAR},
  286. </if>
  287. <if test="record.commodityName != null">
  288. commodity_name = #{record.commodityName,jdbcType=VARCHAR},
  289. </if>
  290. <if test="record.commodityQuantity != null">
  291. commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
  292. </if>
  293. <if test="record.commodityPrice != null">
  294. commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
  295. </if>
  296. <if test="record.commodityFirstPayment != null">
  297. commodity_first_payment = #{record.commodityFirstPayment,jdbcType=DECIMAL},
  298. </if>
  299. <if test="record.commodityType != null">
  300. commodity_type = #{record.commodityType,jdbcType=INTEGER},
  301. </if>
  302. <if test="record.commodityMode != null">
  303. commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
  304. </if>
  305. <if test="record.discountPrice != null">
  306. discount_price = #{record.discountPrice,jdbcType=DECIMAL},
  307. </if>
  308. <if test="record.discountFirstPayment != null">
  309. discount_first_payment = #{record.discountFirstPayment,jdbcType=DECIMAL},
  310. </if>
  311. <if test="record.createTime != null">
  312. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  313. </if>
  314. <if test="record.remarks != null">
  315. remarks = #{record.remarks,jdbcType=VARCHAR},
  316. </if>
  317. </set>
  318. <if test="_parameter != null">
  319. <include refid="Update_By_Example_Where_Clause" />
  320. </if>
  321. </update>
  322. <update id="updateByExample" parameterType="map">
  323. <!--
  324. WARNING - @mbg.generated
  325. This element is automatically generated by MyBatis Generator, do not modify.
  326. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  327. -->
  328. update t_order_detail
  329. set id = #{record.id,jdbcType=VARCHAR},
  330. order_no = #{record.orderNo,jdbcType=VARCHAR},
  331. commodity_id = #{record.commodityId,jdbcType=VARCHAR},
  332. commodity_name = #{record.commodityName,jdbcType=VARCHAR},
  333. commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
  334. commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
  335. commodity_first_payment = #{record.commodityFirstPayment,jdbcType=DECIMAL},
  336. commodity_type = #{record.commodityType,jdbcType=INTEGER},
  337. commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
  338. discount_price = #{record.discountPrice,jdbcType=DECIMAL},
  339. discount_first_payment = #{record.discountFirstPayment,jdbcType=DECIMAL},
  340. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  341. remarks = #{record.remarks,jdbcType=VARCHAR}
  342. <if test="_parameter != null">
  343. <include refid="Update_By_Example_Where_Clause" />
  344. </if>
  345. </update>
  346. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderDetail">
  347. <!--
  348. WARNING - @mbg.generated
  349. This element is automatically generated by MyBatis Generator, do not modify.
  350. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  351. -->
  352. update t_order_detail
  353. <set>
  354. <if test="orderNo != null">
  355. order_no = #{orderNo,jdbcType=VARCHAR},
  356. </if>
  357. <if test="commodityId != null">
  358. commodity_id = #{commodityId,jdbcType=VARCHAR},
  359. </if>
  360. <if test="commodityName != null">
  361. commodity_name = #{commodityName,jdbcType=VARCHAR},
  362. </if>
  363. <if test="commodityQuantity != null">
  364. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  365. </if>
  366. <if test="commodityPrice != null">
  367. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  368. </if>
  369. <if test="commodityFirstPayment != null">
  370. commodity_first_payment = #{commodityFirstPayment,jdbcType=DECIMAL},
  371. </if>
  372. <if test="commodityType != null">
  373. commodity_type = #{commodityType,jdbcType=INTEGER},
  374. </if>
  375. <if test="commodityMode != null">
  376. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  377. </if>
  378. <if test="discountPrice != null">
  379. discount_price = #{discountPrice,jdbcType=DECIMAL},
  380. </if>
  381. <if test="discountFirstPayment != null">
  382. discount_first_payment = #{discountFirstPayment,jdbcType=DECIMAL},
  383. </if>
  384. <if test="createTime != null">
  385. create_time = #{createTime,jdbcType=TIMESTAMP},
  386. </if>
  387. <if test="remarks != null">
  388. remarks = #{remarks,jdbcType=VARCHAR},
  389. </if>
  390. </set>
  391. where id = #{id,jdbcType=VARCHAR}
  392. </update>
  393. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderDetail">
  394. <!--
  395. WARNING - @mbg.generated
  396. This element is automatically generated by MyBatis Generator, do not modify.
  397. This element was generated on Sat Jan 20 15:19:07 CST 2018.
  398. -->
  399. update t_order_detail
  400. set order_no = #{orderNo,jdbcType=VARCHAR},
  401. commodity_id = #{commodityId,jdbcType=VARCHAR},
  402. commodity_name = #{commodityName,jdbcType=VARCHAR},
  403. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  404. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  405. commodity_first_payment = #{commodityFirstPayment,jdbcType=DECIMAL},
  406. commodity_type = #{commodityType,jdbcType=INTEGER},
  407. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  408. discount_price = #{discountPrice,jdbcType=DECIMAL},
  409. discount_first_payment = #{discountFirstPayment,jdbcType=DECIMAL},
  410. create_time = #{createTime,jdbcType=TIMESTAMP},
  411. remarks = #{remarks,jdbcType=VARCHAR}
  412. where id = #{id,jdbcType=VARCHAR}
  413. </update>
  414. </mapper>