TOrderMapper.xml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  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.TOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrder">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  9. -->
  10. <id column="order_no" jdbcType="BIGINT" property="orderNo" />
  11. <result column="creater" jdbcType="VARCHAR" property="creater" />
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  13. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="buyer_id" jdbcType="VARCHAR" property="buyerId" />
  15. <result column="seller_id" jdbcType="VARCHAR" property="sellerId" />
  16. <result column="commodity_id" jdbcType="VARCHAR" property="commodityId" />
  17. <result column="commodity_quantity" jdbcType="INTEGER" property="commodityQuantity" />
  18. <result column="commodity_price" jdbcType="DECIMAL" property="commodityPrice" />
  19. <result column="commodity_type" jdbcType="INTEGER" property="commodityType" />
  20. <result column="commodity_mode" jdbcType="VARCHAR" property="commodityMode" />
  21. <result column="first_payment" jdbcType="DECIMAL" property="firstPayment" />
  22. <result column="order_amount" jdbcType="DECIMAL" property="orderAmount" />
  23. <result column="brokerage_amount" jdbcType="DECIMAL" property="brokerageAmount" />
  24. <result column="brokerage_proportion" jdbcType="DECIMAL" property="brokerageProportion" />
  25. <result column="actually_first_payment" jdbcType="DECIMAL" property="actuallyFirstPayment" />
  26. <result column="actually_total_payment" jdbcType="DECIMAL" property="actuallyTotalPayment" />
  27. <result column="actually_brokerage_amount" jdbcType="DECIMAL" property="actuallyBrokerageAmount" />
  28. <result column="order_status" jdbcType="INTEGER" property="orderStatus" />
  29. <result column="intention_status" jdbcType="INTEGER" property="intentionStatus" />
  30. <result column="trading_status" jdbcType="INTEGER" property="tradingStatus" />
  31. <result column="technology_transfer_progress" jdbcType="INTEGER" property="technologyTransferProgress" />
  32. <result column="payment_status" jdbcType="INTEGER" property="paymentStatus" />
  33. <result column="liquidation_status" jdbcType="INTEGER" property="liquidationStatus" />
  34. <result column="order_follower" jdbcType="VARCHAR" property="orderFollower" />
  35. <result column="order_channel" jdbcType="INTEGER" property="orderChannel" />
  36. <result column="order_remarks" jdbcType="VARCHAR" property="orderRemarks" />
  37. <result column="delete_sign" jdbcType="BIT" property="deleteSign" />
  38. <result column="commodity_name" jdbcType="VARCHAR" property="commodityName" />
  39. </resultMap>
  40. <sql id="Example_Where_Clause">
  41. <!--
  42. WARNING - @mbg.generated
  43. This element is automatically generated by MyBatis Generator, do not modify.
  44. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  45. -->
  46. <where>
  47. <foreach collection="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="Update_By_Example_Where_Clause">
  75. <!--
  76. WARNING - @mbg.generated
  77. This element is automatically generated by MyBatis Generator, do not modify.
  78. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  79. -->
  80. <where>
  81. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  82. <if test="criteria.valid">
  83. <trim prefix="(" prefixOverrides="and" suffix=")">
  84. <foreach collection="criteria.criteria" item="criterion">
  85. <choose>
  86. <when test="criterion.noValue">
  87. and ${criterion.condition}
  88. </when>
  89. <when test="criterion.singleValue">
  90. and ${criterion.condition} #{criterion.value}
  91. </when>
  92. <when test="criterion.betweenValue">
  93. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  94. </when>
  95. <when test="criterion.listValue">
  96. and ${criterion.condition}
  97. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  98. #{listItem}
  99. </foreach>
  100. </when>
  101. </choose>
  102. </foreach>
  103. </trim>
  104. </if>
  105. </foreach>
  106. </where>
  107. </sql>
  108. <sql id="Base_Column_List">
  109. <!--
  110. WARNING - @mbg.generated
  111. This element is automatically generated by MyBatis Generator, do not modify.
  112. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  113. -->
  114. order_no, creater, create_time, update_time, buyer_id, seller_id, commodity_id, commodity_quantity,
  115. commodity_price, commodity_type, commodity_mode, first_payment, order_amount, brokerage_amount,
  116. brokerage_proportion, actually_first_payment, actually_total_payment, actually_brokerage_amount,
  117. order_status, intention_status, trading_status, technology_transfer_progress, payment_status,
  118. liquidation_status, order_follower, order_channel, order_remarks, delete_sign, commodity_name
  119. </sql>
  120. <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderExample" resultMap="BaseResultMap">
  121. <!--
  122. WARNING - @mbg.generated
  123. This element is automatically generated by MyBatis Generator, do not modify.
  124. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  125. -->
  126. select
  127. <if test="distinct">
  128. distinct
  129. </if>
  130. <include refid="Base_Column_List" />
  131. from t_order
  132. <if test="_parameter != null">
  133. <include refid="Example_Where_Clause" />
  134. </if>
  135. <if test="orderByClause != null">
  136. order by ${orderByClause}
  137. </if>
  138. </select>
  139. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  140. <!--
  141. WARNING - @mbg.generated
  142. This element is automatically generated by MyBatis Generator, do not modify.
  143. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  144. -->
  145. select
  146. <include refid="Base_Column_List" />
  147. from t_order
  148. where order_no = #{orderNo,jdbcType=BIGINT}
  149. </select>
  150. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  151. <!--
  152. WARNING - @mbg.generated
  153. This element is automatically generated by MyBatis Generator, do not modify.
  154. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  155. -->
  156. delete from t_order
  157. where order_no = #{orderNo,jdbcType=BIGINT}
  158. </delete>
  159. <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderExample">
  160. <!--
  161. WARNING - @mbg.generated
  162. This element is automatically generated by MyBatis Generator, do not modify.
  163. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  164. -->
  165. delete from t_order
  166. <if test="_parameter != null">
  167. <include refid="Example_Where_Clause" />
  168. </if>
  169. </delete>
  170. <insert id="insert" parameterType="com.goafanti.common.model.TOrder">
  171. <!--
  172. WARNING - @mbg.generated
  173. This element is automatically generated by MyBatis Generator, do not modify.
  174. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  175. -->
  176. insert into t_order (order_no, creater, create_time,
  177. update_time, buyer_id, seller_id,
  178. commodity_id, commodity_quantity, commodity_price,
  179. commodity_type, commodity_mode, first_payment,
  180. order_amount, brokerage_amount, brokerage_proportion,
  181. actually_first_payment, actually_total_payment,
  182. actually_brokerage_amount, order_status, intention_status,
  183. trading_status, technology_transfer_progress,
  184. payment_status, liquidation_status, order_follower,
  185. order_channel, order_remarks, delete_sign,
  186. commodity_name)
  187. values (#{orderNo,jdbcType=BIGINT}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  188. #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR}, #{sellerId,jdbcType=VARCHAR},
  189. #{commodityId,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL},
  190. #{commodityType,jdbcType=INTEGER}, #{commodityMode,jdbcType=VARCHAR}, #{firstPayment,jdbcType=DECIMAL},
  191. #{orderAmount,jdbcType=DECIMAL}, #{brokerageAmount,jdbcType=DECIMAL}, #{brokerageProportion,jdbcType=DECIMAL},
  192. #{actuallyFirstPayment,jdbcType=DECIMAL}, #{actuallyTotalPayment,jdbcType=DECIMAL},
  193. #{actuallyBrokerageAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, #{intentionStatus,jdbcType=INTEGER},
  194. #{tradingStatus,jdbcType=INTEGER}, #{technologyTransferProgress,jdbcType=INTEGER},
  195. #{paymentStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{orderFollower,jdbcType=VARCHAR},
  196. #{orderChannel,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=BIT},
  197. #{commodityName,jdbcType=VARCHAR})
  198. </insert>
  199. <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrder">
  200. <!--
  201. WARNING - @mbg.generated
  202. This element is automatically generated by MyBatis Generator, do not modify.
  203. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  204. -->
  205. insert into t_order
  206. <trim prefix="(" suffix=")" suffixOverrides=",">
  207. <if test="orderNo != null">
  208. order_no,
  209. </if>
  210. <if test="creater != null">
  211. creater,
  212. </if>
  213. <if test="createTime != null">
  214. create_time,
  215. </if>
  216. <if test="updateTime != null">
  217. update_time,
  218. </if>
  219. <if test="buyerId != null">
  220. buyer_id,
  221. </if>
  222. <if test="sellerId != null">
  223. seller_id,
  224. </if>
  225. <if test="commodityId != null">
  226. commodity_id,
  227. </if>
  228. <if test="commodityQuantity != null">
  229. commodity_quantity,
  230. </if>
  231. <if test="commodityPrice != null">
  232. commodity_price,
  233. </if>
  234. <if test="commodityType != null">
  235. commodity_type,
  236. </if>
  237. <if test="commodityMode != null">
  238. commodity_mode,
  239. </if>
  240. <if test="firstPayment != null">
  241. first_payment,
  242. </if>
  243. <if test="orderAmount != null">
  244. order_amount,
  245. </if>
  246. <if test="brokerageAmount != null">
  247. brokerage_amount,
  248. </if>
  249. <if test="brokerageProportion != null">
  250. brokerage_proportion,
  251. </if>
  252. <if test="actuallyFirstPayment != null">
  253. actually_first_payment,
  254. </if>
  255. <if test="actuallyTotalPayment != null">
  256. actually_total_payment,
  257. </if>
  258. <if test="actuallyBrokerageAmount != null">
  259. actually_brokerage_amount,
  260. </if>
  261. <if test="orderStatus != null">
  262. order_status,
  263. </if>
  264. <if test="intentionStatus != null">
  265. intention_status,
  266. </if>
  267. <if test="tradingStatus != null">
  268. trading_status,
  269. </if>
  270. <if test="technologyTransferProgress != null">
  271. technology_transfer_progress,
  272. </if>
  273. <if test="paymentStatus != null">
  274. payment_status,
  275. </if>
  276. <if test="liquidationStatus != null">
  277. liquidation_status,
  278. </if>
  279. <if test="orderFollower != null">
  280. order_follower,
  281. </if>
  282. <if test="orderChannel != null">
  283. order_channel,
  284. </if>
  285. <if test="orderRemarks != null">
  286. order_remarks,
  287. </if>
  288. <if test="deleteSign != null">
  289. delete_sign,
  290. </if>
  291. <if test="commodityName != null">
  292. commodity_name,
  293. </if>
  294. </trim>
  295. <trim prefix="values (" suffix=")" suffixOverrides=",">
  296. <if test="orderNo != null">
  297. #{orderNo,jdbcType=BIGINT},
  298. </if>
  299. <if test="creater != null">
  300. #{creater,jdbcType=VARCHAR},
  301. </if>
  302. <if test="createTime != null">
  303. #{createTime,jdbcType=TIMESTAMP},
  304. </if>
  305. <if test="updateTime != null">
  306. #{updateTime,jdbcType=TIMESTAMP},
  307. </if>
  308. <if test="buyerId != null">
  309. #{buyerId,jdbcType=VARCHAR},
  310. </if>
  311. <if test="sellerId != null">
  312. #{sellerId,jdbcType=VARCHAR},
  313. </if>
  314. <if test="commodityId != null">
  315. #{commodityId,jdbcType=VARCHAR},
  316. </if>
  317. <if test="commodityQuantity != null">
  318. #{commodityQuantity,jdbcType=INTEGER},
  319. </if>
  320. <if test="commodityPrice != null">
  321. #{commodityPrice,jdbcType=DECIMAL},
  322. </if>
  323. <if test="commodityType != null">
  324. #{commodityType,jdbcType=INTEGER},
  325. </if>
  326. <if test="commodityMode != null">
  327. #{commodityMode,jdbcType=VARCHAR},
  328. </if>
  329. <if test="firstPayment != null">
  330. #{firstPayment,jdbcType=DECIMAL},
  331. </if>
  332. <if test="orderAmount != null">
  333. #{orderAmount,jdbcType=DECIMAL},
  334. </if>
  335. <if test="brokerageAmount != null">
  336. #{brokerageAmount,jdbcType=DECIMAL},
  337. </if>
  338. <if test="brokerageProportion != null">
  339. #{brokerageProportion,jdbcType=DECIMAL},
  340. </if>
  341. <if test="actuallyFirstPayment != null">
  342. #{actuallyFirstPayment,jdbcType=DECIMAL},
  343. </if>
  344. <if test="actuallyTotalPayment != null">
  345. #{actuallyTotalPayment,jdbcType=DECIMAL},
  346. </if>
  347. <if test="actuallyBrokerageAmount != null">
  348. #{actuallyBrokerageAmount,jdbcType=DECIMAL},
  349. </if>
  350. <if test="orderStatus != null">
  351. #{orderStatus,jdbcType=INTEGER},
  352. </if>
  353. <if test="intentionStatus != null">
  354. #{intentionStatus,jdbcType=INTEGER},
  355. </if>
  356. <if test="tradingStatus != null">
  357. #{tradingStatus,jdbcType=INTEGER},
  358. </if>
  359. <if test="technologyTransferProgress != null">
  360. #{technologyTransferProgress,jdbcType=INTEGER},
  361. </if>
  362. <if test="paymentStatus != null">
  363. #{paymentStatus,jdbcType=INTEGER},
  364. </if>
  365. <if test="liquidationStatus != null">
  366. #{liquidationStatus,jdbcType=INTEGER},
  367. </if>
  368. <if test="orderFollower != null">
  369. #{orderFollower,jdbcType=VARCHAR},
  370. </if>
  371. <if test="orderChannel != null">
  372. #{orderChannel,jdbcType=INTEGER},
  373. </if>
  374. <if test="orderRemarks != null">
  375. #{orderRemarks,jdbcType=VARCHAR},
  376. </if>
  377. <if test="deleteSign != null">
  378. #{deleteSign,jdbcType=BIT},
  379. </if>
  380. <if test="commodityName != null">
  381. #{commodityName,jdbcType=VARCHAR},
  382. </if>
  383. </trim>
  384. </insert>
  385. <select id="countByExample" parameterType="com.goafanti.common.model.TOrderExample" resultType="java.lang.Long">
  386. <!--
  387. WARNING - @mbg.generated
  388. This element is automatically generated by MyBatis Generator, do not modify.
  389. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  390. -->
  391. select count(*) from t_order
  392. <if test="_parameter != null">
  393. <include refid="Example_Where_Clause" />
  394. </if>
  395. </select>
  396. <update id="updateByExampleSelective" parameterType="map">
  397. <!--
  398. WARNING - @mbg.generated
  399. This element is automatically generated by MyBatis Generator, do not modify.
  400. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  401. -->
  402. update t_order
  403. <set>
  404. <if test="record.orderNo != null">
  405. order_no = #{record.orderNo,jdbcType=BIGINT},
  406. </if>
  407. <if test="record.creater != null">
  408. creater = #{record.creater,jdbcType=VARCHAR},
  409. </if>
  410. <if test="record.createTime != null">
  411. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  412. </if>
  413. <if test="record.updateTime != null">
  414. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  415. </if>
  416. <if test="record.buyerId != null">
  417. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  418. </if>
  419. <if test="record.sellerId != null">
  420. seller_id = #{record.sellerId,jdbcType=VARCHAR},
  421. </if>
  422. <if test="record.commodityId != null">
  423. commodity_id = #{record.commodityId,jdbcType=VARCHAR},
  424. </if>
  425. <if test="record.commodityQuantity != null">
  426. commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
  427. </if>
  428. <if test="record.commodityPrice != null">
  429. commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
  430. </if>
  431. <if test="record.commodityType != null">
  432. commodity_type = #{record.commodityType,jdbcType=INTEGER},
  433. </if>
  434. <if test="record.commodityMode != null">
  435. commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
  436. </if>
  437. <if test="record.firstPayment != null">
  438. first_payment = #{record.firstPayment,jdbcType=DECIMAL},
  439. </if>
  440. <if test="record.orderAmount != null">
  441. order_amount = #{record.orderAmount,jdbcType=DECIMAL},
  442. </if>
  443. <if test="record.brokerageAmount != null">
  444. brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
  445. </if>
  446. <if test="record.brokerageProportion != null">
  447. brokerage_proportion = #{record.brokerageProportion,jdbcType=DECIMAL},
  448. </if>
  449. <if test="record.actuallyFirstPayment != null">
  450. actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
  451. </if>
  452. <if test="record.actuallyTotalPayment != null">
  453. actually_total_payment = #{record.actuallyTotalPayment,jdbcType=DECIMAL},
  454. </if>
  455. <if test="record.actuallyBrokerageAmount != null">
  456. actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
  457. </if>
  458. <if test="record.orderStatus != null">
  459. order_status = #{record.orderStatus,jdbcType=INTEGER},
  460. </if>
  461. <if test="record.intentionStatus != null">
  462. intention_status = #{record.intentionStatus,jdbcType=INTEGER},
  463. </if>
  464. <if test="record.tradingStatus != null">
  465. trading_status = #{record.tradingStatus,jdbcType=INTEGER},
  466. </if>
  467. <if test="record.technologyTransferProgress != null">
  468. technology_transfer_progress = #{record.technologyTransferProgress,jdbcType=INTEGER},
  469. </if>
  470. <if test="record.paymentStatus != null">
  471. payment_status = #{record.paymentStatus,jdbcType=INTEGER},
  472. </if>
  473. <if test="record.liquidationStatus != null">
  474. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  475. </if>
  476. <if test="record.orderFollower != null">
  477. order_follower = #{record.orderFollower,jdbcType=VARCHAR},
  478. </if>
  479. <if test="record.orderChannel != null">
  480. order_channel = #{record.orderChannel,jdbcType=INTEGER},
  481. </if>
  482. <if test="record.orderRemarks != null">
  483. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  484. </if>
  485. <if test="record.deleteSign != null">
  486. delete_sign = #{record.deleteSign,jdbcType=BIT},
  487. </if>
  488. <if test="record.commodityName != null">
  489. commodity_name = #{record.commodityName,jdbcType=VARCHAR},
  490. </if>
  491. </set>
  492. <if test="_parameter != null">
  493. <include refid="Update_By_Example_Where_Clause" />
  494. </if>
  495. </update>
  496. <update id="updateByExample" parameterType="map">
  497. <!--
  498. WARNING - @mbg.generated
  499. This element is automatically generated by MyBatis Generator, do not modify.
  500. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  501. -->
  502. update t_order
  503. set order_no = #{record.orderNo,jdbcType=BIGINT},
  504. creater = #{record.creater,jdbcType=VARCHAR},
  505. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  506. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  507. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  508. seller_id = #{record.sellerId,jdbcType=VARCHAR},
  509. commodity_id = #{record.commodityId,jdbcType=VARCHAR},
  510. commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
  511. commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
  512. commodity_type = #{record.commodityType,jdbcType=INTEGER},
  513. commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
  514. first_payment = #{record.firstPayment,jdbcType=DECIMAL},
  515. order_amount = #{record.orderAmount,jdbcType=DECIMAL},
  516. brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
  517. brokerage_proportion = #{record.brokerageProportion,jdbcType=DECIMAL},
  518. actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
  519. actually_total_payment = #{record.actuallyTotalPayment,jdbcType=DECIMAL},
  520. actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
  521. order_status = #{record.orderStatus,jdbcType=INTEGER},
  522. intention_status = #{record.intentionStatus,jdbcType=INTEGER},
  523. trading_status = #{record.tradingStatus,jdbcType=INTEGER},
  524. technology_transfer_progress = #{record.technologyTransferProgress,jdbcType=INTEGER},
  525. payment_status = #{record.paymentStatus,jdbcType=INTEGER},
  526. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  527. order_follower = #{record.orderFollower,jdbcType=VARCHAR},
  528. order_channel = #{record.orderChannel,jdbcType=INTEGER},
  529. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  530. delete_sign = #{record.deleteSign,jdbcType=BIT},
  531. commodity_name = #{record.commodityName,jdbcType=VARCHAR}
  532. <if test="_parameter != null">
  533. <include refid="Update_By_Example_Where_Clause" />
  534. </if>
  535. </update>
  536. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrder">
  537. <!--
  538. WARNING - @mbg.generated
  539. This element is automatically generated by MyBatis Generator, do not modify.
  540. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  541. -->
  542. update t_order
  543. <set>
  544. <if test="creater != null">
  545. creater = #{creater,jdbcType=VARCHAR},
  546. </if>
  547. <if test="createTime != null">
  548. create_time = #{createTime,jdbcType=TIMESTAMP},
  549. </if>
  550. <if test="updateTime != null">
  551. update_time = #{updateTime,jdbcType=TIMESTAMP},
  552. </if>
  553. <if test="buyerId != null">
  554. buyer_id = #{buyerId,jdbcType=VARCHAR},
  555. </if>
  556. <if test="sellerId != null">
  557. seller_id = #{sellerId,jdbcType=VARCHAR},
  558. </if>
  559. <if test="commodityId != null">
  560. commodity_id = #{commodityId,jdbcType=VARCHAR},
  561. </if>
  562. <if test="commodityQuantity != null">
  563. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  564. </if>
  565. <if test="commodityPrice != null">
  566. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  567. </if>
  568. <if test="commodityType != null">
  569. commodity_type = #{commodityType,jdbcType=INTEGER},
  570. </if>
  571. <if test="commodityMode != null">
  572. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  573. </if>
  574. <if test="firstPayment != null">
  575. first_payment = #{firstPayment,jdbcType=DECIMAL},
  576. </if>
  577. <if test="orderAmount != null">
  578. order_amount = #{orderAmount,jdbcType=DECIMAL},
  579. </if>
  580. <if test="brokerageAmount != null">
  581. brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
  582. </if>
  583. <if test="brokerageProportion != null">
  584. brokerage_proportion = #{brokerageProportion,jdbcType=DECIMAL},
  585. </if>
  586. <if test="actuallyFirstPayment != null">
  587. actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
  588. </if>
  589. <if test="actuallyTotalPayment != null">
  590. actually_total_payment = #{actuallyTotalPayment,jdbcType=DECIMAL},
  591. </if>
  592. <if test="actuallyBrokerageAmount != null">
  593. actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
  594. </if>
  595. <if test="orderStatus != null">
  596. order_status = #{orderStatus,jdbcType=INTEGER},
  597. </if>
  598. <if test="intentionStatus != null">
  599. intention_status = #{intentionStatus,jdbcType=INTEGER},
  600. </if>
  601. <if test="tradingStatus != null">
  602. trading_status = #{tradingStatus,jdbcType=INTEGER},
  603. </if>
  604. <if test="technologyTransferProgress != null">
  605. technology_transfer_progress = #{technologyTransferProgress,jdbcType=INTEGER},
  606. </if>
  607. <if test="paymentStatus != null">
  608. payment_status = #{paymentStatus,jdbcType=INTEGER},
  609. </if>
  610. <if test="liquidationStatus != null">
  611. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  612. </if>
  613. <if test="orderFollower != null">
  614. order_follower = #{orderFollower,jdbcType=VARCHAR},
  615. </if>
  616. <if test="orderChannel != null">
  617. order_channel = #{orderChannel,jdbcType=INTEGER},
  618. </if>
  619. <if test="orderRemarks != null">
  620. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  621. </if>
  622. <if test="deleteSign != null">
  623. delete_sign = #{deleteSign,jdbcType=BIT},
  624. </if>
  625. <if test="commodityName != null">
  626. commodity_name = #{commodityName,jdbcType=VARCHAR},
  627. </if>
  628. </set>
  629. where order_no = #{orderNo,jdbcType=BIGINT}
  630. </update>
  631. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrder">
  632. <!--
  633. WARNING - @mbg.generated
  634. This element is automatically generated by MyBatis Generator, do not modify.
  635. This element was generated on Sat Dec 30 15:36:11 CST 2017.
  636. -->
  637. update t_order
  638. set creater = #{creater,jdbcType=VARCHAR},
  639. create_time = #{createTime,jdbcType=TIMESTAMP},
  640. update_time = #{updateTime,jdbcType=TIMESTAMP},
  641. buyer_id = #{buyerId,jdbcType=VARCHAR},
  642. seller_id = #{sellerId,jdbcType=VARCHAR},
  643. commodity_id = #{commodityId,jdbcType=VARCHAR},
  644. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  645. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  646. commodity_type = #{commodityType,jdbcType=INTEGER},
  647. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  648. first_payment = #{firstPayment,jdbcType=DECIMAL},
  649. order_amount = #{orderAmount,jdbcType=DECIMAL},
  650. brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
  651. brokerage_proportion = #{brokerageProportion,jdbcType=DECIMAL},
  652. actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
  653. actually_total_payment = #{actuallyTotalPayment,jdbcType=DECIMAL},
  654. actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
  655. order_status = #{orderStatus,jdbcType=INTEGER},
  656. intention_status = #{intentionStatus,jdbcType=INTEGER},
  657. trading_status = #{tradingStatus,jdbcType=INTEGER},
  658. technology_transfer_progress = #{technologyTransferProgress,jdbcType=INTEGER},
  659. payment_status = #{paymentStatus,jdbcType=INTEGER},
  660. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  661. order_follower = #{orderFollower,jdbcType=VARCHAR},
  662. order_channel = #{orderChannel,jdbcType=INTEGER},
  663. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  664. delete_sign = #{deleteSign,jdbcType=BIT},
  665. commodity_name = #{commodityName,jdbcType=VARCHAR}
  666. where order_no = #{orderNo,jdbcType=BIGINT}
  667. </update>
  668. <select id="selectCommodityDetail" resultType="com.goafanti.order.bo.OrderDetailBo">
  669. <choose>
  670. <when test="commodityType == 0">
  671. select id as commodityId,bname as commodityName,ifnull(price,0) as commodityPrice from business_project where id = #{commodityId,jdbcType=VARCHAR}
  672. </when>
  673. <when test="commodityType == 1">
  674. select id as commodityId,name as commodityName,introduction,ifnull(transfer_price,0) as commodityPrice,owner_id as sellerId from achievement where id = #{commodityId,jdbcType=VARCHAR}
  675. </when>
  676. <when test="commodityType == 2">
  677. select id as commodityId,name as commodityName,problem_des as introduction,ifnull(budget_cost,0) as commodityPrice,employer_id as sellerId from demand where id = #{commodityId,jdbcType=VARCHAR}
  678. </when>
  679. <when test="commodityType == 3">
  680. select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a
  681. left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
  682. </when>
  683. <when test="commodityType == 4">
  684. </when>
  685. <when test="commodityType == 5">
  686. </when>
  687. <when test="commodityType == 6">
  688. select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a
  689. left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
  690. </when>
  691. </choose>
  692. </select>
  693. <select id="selectOrderListByPage" resultMap="BaseResultMap">
  694. select
  695. <include refid="Base_Column_List" />
  696. from t_order where delete_sign = 0
  697. <choose>
  698. <when test="intentionStatus == 0"><!-- 意向订单 -->
  699. and intention_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
  700. </when>
  701. <otherwise>
  702. and intention_status != 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
  703. </otherwise>
  704. </choose>
  705. order by create_time desc
  706. <if test="page_sql!=null">
  707. ${page_sql}
  708. </if>
  709. </select>
  710. <select id="selectOrderListCount" resultType="java.lang.Integer">
  711. select
  712. count(0)
  713. from t_order where delete_sign = 0
  714. <choose>
  715. <when test="intentionStatus == 0"><!-- 意向订单 -->
  716. and intention_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
  717. </when>
  718. <otherwise>
  719. and intention_status != 0 and buyer_id = #{uid,jdbcType=VARCHAR}
  720. </otherwise>
  721. </choose>
  722. </select>
  723. <select id="selectFundingHistoryByPage" resultType="com.goafanti.order.bo.FundingListBo">
  724. select
  725. a.order_no as orderNo,
  726. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  727. a.transaction_subject as transactionSubject,
  728. a.transaction_amount as transactionAmount,
  729. b.commodity_id as commodityId,
  730. b.commodity_type as commodityType,
  731. a.confirm_sign as confirmSign
  732. from
  733. t_funding_records a left join t_order b on a.order_no = b.order_no
  734. where
  735. (a.payee_id = #{uid,jdbcType=VARCHAR} or a.payer_id = #{uid,jdbcType=VARCHAR}) and b.delete_sign = 0
  736. <if test="orderNo != null and orderNo != ''">
  737. and a.order_no = #{orderNo,jdbcType=BIGINT}
  738. </if>
  739. order by a.create_time desc
  740. <if test="page_sql!=null">
  741. ${page_sql}
  742. </if>
  743. </select>
  744. <select id="selectFundingHistoryCount" resultType="java.lang.Integer">
  745. select
  746. count(0)
  747. from
  748. t_funding_records a left join t_order b on a.order_no = b.order_no
  749. where
  750. (a.payee_id = #{uid,jdbcType=VARCHAR} or a.payer_id = #{uid,jdbcType=VARCHAR}) and b.delete_sign = 0
  751. <if test="orderNo != null and orderNo != ''">
  752. a.order_no = #{orderNo,jdbcType=BIGINT}
  753. </if>
  754. </select>
  755. </mapper>