TOrderMapper.xml 31 KB

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