NewOrderChangeMapper.xml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  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.NewOrderChangeMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.NewOrderChange">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  12. <result column="process_state" jdbcType="INTEGER" property="processState" />
  13. <result column="status" jdbcType="INTEGER" property="status" />
  14. <result column="type" jdbcType="INTEGER" property="type" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  17. <result column="voucher_url" jdbcType="VARCHAR" property="voucherUrl" />
  18. <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
  19. <result column="settlement_amount" jdbcType="DECIMAL" property="settlementAmount" />
  20. <result column="change_amount" jdbcType="DECIMAL" property="changeAmount" />
  21. <result column="applicant" jdbcType="VARCHAR" property="applicant" />
  22. <result column="dep_name" jdbcType="VARCHAR" property="depName" />
  23. <result column="project_state" jdbcType="VARCHAR" property="projectState" />
  24. <result column="zxs_cost" jdbcType="DECIMAL" property="zxsCost" />
  25. <result column="zxs_remarks" jdbcType="VARCHAR" property="zxsRemarks" />
  26. <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime" />
  27. <result column="payment_amount" jdbcType="DECIMAL" property="paymentAmount" />
  28. <result column="invoice_time" jdbcType="TIMESTAMP" property="invoiceTime" />
  29. <result column="invoice_amount" jdbcType="DECIMAL" property="invoiceAmount" />
  30. <result column="invoice_type" jdbcType="VARCHAR" property="invoiceType" />
  31. <result column="cw_cost" jdbcType="DECIMAL" property="cwCost" />
  32. <result column="refundable_amount" jdbcType="DECIMAL" property="refundableAmount" />
  33. <result column="cw_remarks" jdbcType="VARCHAR" property="cwRemarks" />
  34. <result column="estimate_cost" jdbcType="DECIMAL" property="estimateCost" />
  35. <result column="estimate_refundable" jdbcType="DECIMAL" property="estimateRefundable" />
  36. <result column="refund_Invoice" jdbcType="DECIMAL" property="refundInvoice" />
  37. </resultMap>
  38. <sql id="Example_Where_Clause">
  39. <!--
  40. WARNING - @mbg.generated
  41. This element is automatically generated by MyBatis Generator, do not modify.
  42. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  43. -->
  44. <where>
  45. <foreach collection="oredCriteria" item="criteria" separator="or">
  46. <if test="criteria.valid">
  47. <trim prefix="(" prefixOverrides="and" suffix=")">
  48. <foreach collection="criteria.criteria" item="criterion">
  49. <choose>
  50. <when test="criterion.noValue">
  51. and ${criterion.condition}
  52. </when>
  53. <when test="criterion.singleValue">
  54. and ${criterion.condition} #{criterion.value}
  55. </when>
  56. <when test="criterion.betweenValue">
  57. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  58. </when>
  59. <when test="criterion.listValue">
  60. and ${criterion.condition}
  61. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  62. #{listItem}
  63. </foreach>
  64. </when>
  65. </choose>
  66. </foreach>
  67. </trim>
  68. </if>
  69. </foreach>
  70. </where>
  71. </sql>
  72. <sql id="Update_By_Example_Where_Clause">
  73. <!--
  74. WARNING - @mbg.generated
  75. This element is automatically generated by MyBatis Generator, do not modify.
  76. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  77. -->
  78. <where>
  79. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  80. <if test="criteria.valid">
  81. <trim prefix="(" prefixOverrides="and" suffix=")">
  82. <foreach collection="criteria.criteria" item="criterion">
  83. <choose>
  84. <when test="criterion.noValue">
  85. and ${criterion.condition}
  86. </when>
  87. <when test="criterion.singleValue">
  88. and ${criterion.condition} #{criterion.value}
  89. </when>
  90. <when test="criterion.betweenValue">
  91. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  92. </when>
  93. <when test="criterion.listValue">
  94. and ${criterion.condition}
  95. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  96. #{listItem}
  97. </foreach>
  98. </when>
  99. </choose>
  100. </foreach>
  101. </trim>
  102. </if>
  103. </foreach>
  104. </where>
  105. </sql>
  106. <sql id="Base_Column_List">
  107. <!--
  108. WARNING - @mbg.generated
  109. This element is automatically generated by MyBatis Generator, do not modify.
  110. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  111. -->
  112. id, order_no, process_state, status, type, create_time, remarks, voucher_url, total_amount,
  113. settlement_amount, change_amount, applicant, dep_name, project_state, zxs_cost, zxs_remarks,
  114. payment_time, payment_amount, invoice_time, invoice_amount, invoice_type, cw_cost,
  115. refundable_amount, cw_remarks, estimate_cost, estimate_refundable, refund_Invoice
  116. </sql>
  117. <select id="selectByExample" parameterType="com.goafanti.common.model.NewOrderChangeExample" resultMap="BaseResultMap">
  118. <!--
  119. WARNING - @mbg.generated
  120. This element is automatically generated by MyBatis Generator, do not modify.
  121. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  122. -->
  123. select
  124. <if test="distinct">
  125. distinct
  126. </if>
  127. <include refid="Base_Column_List" />
  128. from new_order_change
  129. <if test="_parameter != null">
  130. <include refid="Example_Where_Clause" />
  131. </if>
  132. <if test="orderByClause != null">
  133. order by ${orderByClause}
  134. </if>
  135. </select>
  136. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  137. <!--
  138. WARNING - @mbg.generated
  139. This element is automatically generated by MyBatis Generator, do not modify.
  140. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  141. -->
  142. select
  143. <include refid="Base_Column_List" />
  144. from new_order_change
  145. where id = #{id,jdbcType=INTEGER}
  146. </select>
  147. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  148. <!--
  149. WARNING - @mbg.generated
  150. This element is automatically generated by MyBatis Generator, do not modify.
  151. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  152. -->
  153. delete from new_order_change
  154. where id = #{id,jdbcType=INTEGER}
  155. </delete>
  156. <delete id="deleteByExample" parameterType="com.goafanti.common.model.NewOrderChangeExample">
  157. <!--
  158. WARNING - @mbg.generated
  159. This element is automatically generated by MyBatis Generator, do not modify.
  160. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  161. -->
  162. delete from new_order_change
  163. <if test="_parameter != null">
  164. <include refid="Example_Where_Clause" />
  165. </if>
  166. </delete>
  167. <insert id="insert" parameterType="com.goafanti.common.model.NewOrderChange">
  168. <!--
  169. WARNING - @mbg.generated
  170. This element is automatically generated by MyBatis Generator, do not modify.
  171. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  172. -->
  173. insert into new_order_change (id, order_no, process_state,
  174. status, type, create_time,
  175. remarks, voucher_url, total_amount,
  176. settlement_amount, change_amount, applicant,
  177. dep_name, project_state, zxs_cost,
  178. zxs_remarks, payment_time, payment_amount,
  179. invoice_time, invoice_amount, invoice_type,
  180. cw_cost, refundable_amount, cw_remarks,
  181. estimate_cost, estimate_refundable, refund_Invoice
  182. )
  183. values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{processState,jdbcType=INTEGER},
  184. #{status,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  185. #{remarks,jdbcType=VARCHAR}, #{voucherUrl,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL},
  186. #{settlementAmount,jdbcType=DECIMAL}, #{changeAmount,jdbcType=DECIMAL}, #{applicant,jdbcType=VARCHAR},
  187. #{depName,jdbcType=VARCHAR}, #{projectState,jdbcType=VARCHAR}, #{zxsCost,jdbcType=DECIMAL},
  188. #{zxsRemarks,jdbcType=VARCHAR}, #{paymentTime,jdbcType=TIMESTAMP}, #{paymentAmount,jdbcType=DECIMAL},
  189. #{invoiceTime,jdbcType=TIMESTAMP}, #{invoiceAmount,jdbcType=DECIMAL}, #{invoiceType,jdbcType=VARCHAR},
  190. #{cwCost,jdbcType=DECIMAL}, #{refundableAmount,jdbcType=DECIMAL}, #{cwRemarks,jdbcType=VARCHAR},
  191. #{estimateCost,jdbcType=DECIMAL}, #{estimateRefundable,jdbcType=DECIMAL}, #{refundInvoice,jdbcType=DECIMAL}
  192. )
  193. </insert>
  194. <insert id="insertSelective" parameterType="com.goafanti.common.model.NewOrderChange">
  195. <!--
  196. WARNING - @mbg.generated
  197. This element is automatically generated by MyBatis Generator, do not modify.
  198. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  199. -->
  200. insert into new_order_change
  201. <trim prefix="(" suffix=")" suffixOverrides=",">
  202. <if test="id != null">
  203. id,
  204. </if>
  205. <if test="orderNo != null">
  206. order_no,
  207. </if>
  208. <if test="processState != null">
  209. process_state,
  210. </if>
  211. <if test="status != null">
  212. status,
  213. </if>
  214. <if test="type != null">
  215. type,
  216. </if>
  217. <if test="createTime != null">
  218. create_time,
  219. </if>
  220. <if test="remarks != null">
  221. remarks,
  222. </if>
  223. <if test="voucherUrl != null">
  224. voucher_url,
  225. </if>
  226. <if test="totalAmount != null">
  227. total_amount,
  228. </if>
  229. <if test="settlementAmount != null">
  230. settlement_amount,
  231. </if>
  232. <if test="changeAmount != null">
  233. change_amount,
  234. </if>
  235. <if test="applicant != null">
  236. applicant,
  237. </if>
  238. <if test="depName != null">
  239. dep_name,
  240. </if>
  241. <if test="projectState != null">
  242. project_state,
  243. </if>
  244. <if test="zxsCost != null">
  245. zxs_cost,
  246. </if>
  247. <if test="zxsRemarks != null">
  248. zxs_remarks,
  249. </if>
  250. <if test="paymentTime != null">
  251. payment_time,
  252. </if>
  253. <if test="paymentAmount != null">
  254. payment_amount,
  255. </if>
  256. <if test="invoiceTime != null">
  257. invoice_time,
  258. </if>
  259. <if test="invoiceAmount != null">
  260. invoice_amount,
  261. </if>
  262. <if test="invoiceType != null">
  263. invoice_type,
  264. </if>
  265. <if test="cwCost != null">
  266. cw_cost,
  267. </if>
  268. <if test="refundableAmount != null">
  269. refundable_amount,
  270. </if>
  271. <if test="cwRemarks != null">
  272. cw_remarks,
  273. </if>
  274. <if test="estimateCost != null">
  275. estimate_cost,
  276. </if>
  277. <if test="estimateRefundable != null">
  278. estimate_refundable,
  279. </if>
  280. <if test="refundInvoice != null">
  281. refund_Invoice,
  282. </if>
  283. </trim>
  284. <trim prefix="values (" suffix=")" suffixOverrides=",">
  285. <if test="id != null">
  286. #{id,jdbcType=INTEGER},
  287. </if>
  288. <if test="orderNo != null">
  289. #{orderNo,jdbcType=VARCHAR},
  290. </if>
  291. <if test="processState != null">
  292. #{processState,jdbcType=INTEGER},
  293. </if>
  294. <if test="status != null">
  295. #{status,jdbcType=INTEGER},
  296. </if>
  297. <if test="type != null">
  298. #{type,jdbcType=INTEGER},
  299. </if>
  300. <if test="createTime != null">
  301. #{createTime,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="remarks != null">
  304. #{remarks,jdbcType=VARCHAR},
  305. </if>
  306. <if test="voucherUrl != null">
  307. #{voucherUrl,jdbcType=VARCHAR},
  308. </if>
  309. <if test="totalAmount != null">
  310. #{totalAmount,jdbcType=DECIMAL},
  311. </if>
  312. <if test="settlementAmount != null">
  313. #{settlementAmount,jdbcType=DECIMAL},
  314. </if>
  315. <if test="changeAmount != null">
  316. #{changeAmount,jdbcType=DECIMAL},
  317. </if>
  318. <if test="applicant != null">
  319. #{applicant,jdbcType=VARCHAR},
  320. </if>
  321. <if test="depName != null">
  322. #{depName,jdbcType=VARCHAR},
  323. </if>
  324. <if test="projectState != null">
  325. #{projectState,jdbcType=VARCHAR},
  326. </if>
  327. <if test="zxsCost != null">
  328. #{zxsCost,jdbcType=DECIMAL},
  329. </if>
  330. <if test="zxsRemarks != null">
  331. #{zxsRemarks,jdbcType=VARCHAR},
  332. </if>
  333. <if test="paymentTime != null">
  334. #{paymentTime,jdbcType=TIMESTAMP},
  335. </if>
  336. <if test="paymentAmount != null">
  337. #{paymentAmount,jdbcType=DECIMAL},
  338. </if>
  339. <if test="invoiceTime != null">
  340. #{invoiceTime,jdbcType=TIMESTAMP},
  341. </if>
  342. <if test="invoiceAmount != null">
  343. #{invoiceAmount,jdbcType=DECIMAL},
  344. </if>
  345. <if test="invoiceType != null">
  346. #{invoiceType,jdbcType=VARCHAR},
  347. </if>
  348. <if test="cwCost != null">
  349. #{cwCost,jdbcType=DECIMAL},
  350. </if>
  351. <if test="refundableAmount != null">
  352. #{refundableAmount,jdbcType=DECIMAL},
  353. </if>
  354. <if test="cwRemarks != null">
  355. #{cwRemarks,jdbcType=VARCHAR},
  356. </if>
  357. <if test="estimateCost != null">
  358. #{estimateCost,jdbcType=DECIMAL},
  359. </if>
  360. <if test="estimateRefundable != null">
  361. #{estimateRefundable,jdbcType=DECIMAL},
  362. </if>
  363. <if test="refundInvoice != null">
  364. #{refundInvoice,jdbcType=DECIMAL},
  365. </if>
  366. </trim>
  367. </insert>
  368. <select id="countByExample" parameterType="com.goafanti.common.model.NewOrderChangeExample" resultType="java.lang.Long">
  369. <!--
  370. WARNING - @mbg.generated
  371. This element is automatically generated by MyBatis Generator, do not modify.
  372. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  373. -->
  374. select count(*) from new_order_change
  375. <if test="_parameter != null">
  376. <include refid="Example_Where_Clause" />
  377. </if>
  378. </select>
  379. <update id="updateByExampleSelective" parameterType="map">
  380. <!--
  381. WARNING - @mbg.generated
  382. This element is automatically generated by MyBatis Generator, do not modify.
  383. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  384. -->
  385. update new_order_change
  386. <set>
  387. <if test="record.id != null">
  388. id = #{record.id,jdbcType=INTEGER},
  389. </if>
  390. <if test="record.orderNo != null">
  391. order_no = #{record.orderNo,jdbcType=VARCHAR},
  392. </if>
  393. <if test="record.processState != null">
  394. process_state = #{record.processState,jdbcType=INTEGER},
  395. </if>
  396. <if test="record.status != null">
  397. status = #{record.status,jdbcType=INTEGER},
  398. </if>
  399. <if test="record.type != null">
  400. type = #{record.type,jdbcType=INTEGER},
  401. </if>
  402. <if test="record.createTime != null">
  403. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  404. </if>
  405. <if test="record.remarks != null">
  406. remarks = #{record.remarks,jdbcType=VARCHAR},
  407. </if>
  408. <if test="record.voucherUrl != null">
  409. voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
  410. </if>
  411. <if test="record.totalAmount != null">
  412. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  413. </if>
  414. <if test="record.settlementAmount != null">
  415. settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
  416. </if>
  417. <if test="record.changeAmount != null">
  418. change_amount = #{record.changeAmount,jdbcType=DECIMAL},
  419. </if>
  420. <if test="record.applicant != null">
  421. applicant = #{record.applicant,jdbcType=VARCHAR},
  422. </if>
  423. <if test="record.depName != null">
  424. dep_name = #{record.depName,jdbcType=VARCHAR},
  425. </if>
  426. <if test="record.projectState != null">
  427. project_state = #{record.projectState,jdbcType=VARCHAR},
  428. </if>
  429. <if test="record.zxsCost != null">
  430. zxs_cost = #{record.zxsCost,jdbcType=DECIMAL},
  431. </if>
  432. <if test="record.zxsRemarks != null">
  433. zxs_remarks = #{record.zxsRemarks,jdbcType=VARCHAR},
  434. </if>
  435. <if test="record.paymentTime != null">
  436. payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
  437. </if>
  438. <if test="record.paymentAmount != null">
  439. payment_amount = #{record.paymentAmount,jdbcType=DECIMAL},
  440. </if>
  441. <if test="record.invoiceTime != null">
  442. invoice_time = #{record.invoiceTime,jdbcType=TIMESTAMP},
  443. </if>
  444. <if test="record.invoiceAmount != null">
  445. invoice_amount = #{record.invoiceAmount,jdbcType=DECIMAL},
  446. </if>
  447. <if test="record.invoiceType != null">
  448. invoice_type = #{record.invoiceType,jdbcType=VARCHAR},
  449. </if>
  450. <if test="record.cwCost != null">
  451. cw_cost = #{record.cwCost,jdbcType=DECIMAL},
  452. </if>
  453. <if test="record.refundableAmount != null">
  454. refundable_amount = #{record.refundableAmount,jdbcType=DECIMAL},
  455. </if>
  456. <if test="record.cwRemarks != null">
  457. cw_remarks = #{record.cwRemarks,jdbcType=VARCHAR},
  458. </if>
  459. <if test="record.estimateCost != null">
  460. estimate_cost = #{record.estimateCost,jdbcType=DECIMAL},
  461. </if>
  462. <if test="record.estimateRefundable != null">
  463. estimate_refundable = #{record.estimateRefundable,jdbcType=DECIMAL},
  464. </if>
  465. <if test="record.refundInvoice != null">
  466. refund_Invoice = #{record.refundInvoice,jdbcType=DECIMAL},
  467. </if>
  468. </set>
  469. <if test="_parameter != null">
  470. <include refid="Update_By_Example_Where_Clause" />
  471. </if>
  472. </update>
  473. <update id="updateByExample" parameterType="map">
  474. <!--
  475. WARNING - @mbg.generated
  476. This element is automatically generated by MyBatis Generator, do not modify.
  477. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  478. -->
  479. update new_order_change
  480. set id = #{record.id,jdbcType=INTEGER},
  481. order_no = #{record.orderNo,jdbcType=VARCHAR},
  482. process_state = #{record.processState,jdbcType=INTEGER},
  483. status = #{record.status,jdbcType=INTEGER},
  484. type = #{record.type,jdbcType=INTEGER},
  485. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  486. remarks = #{record.remarks,jdbcType=VARCHAR},
  487. voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
  488. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  489. settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
  490. change_amount = #{record.changeAmount,jdbcType=DECIMAL},
  491. applicant = #{record.applicant,jdbcType=VARCHAR},
  492. dep_name = #{record.depName,jdbcType=VARCHAR},
  493. project_state = #{record.projectState,jdbcType=VARCHAR},
  494. zxs_cost = #{record.zxsCost,jdbcType=DECIMAL},
  495. zxs_remarks = #{record.zxsRemarks,jdbcType=VARCHAR},
  496. payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
  497. payment_amount = #{record.paymentAmount,jdbcType=DECIMAL},
  498. invoice_time = #{record.invoiceTime,jdbcType=TIMESTAMP},
  499. invoice_amount = #{record.invoiceAmount,jdbcType=DECIMAL},
  500. invoice_type = #{record.invoiceType,jdbcType=VARCHAR},
  501. cw_cost = #{record.cwCost,jdbcType=DECIMAL},
  502. refundable_amount = #{record.refundableAmount,jdbcType=DECIMAL},
  503. cw_remarks = #{record.cwRemarks,jdbcType=VARCHAR},
  504. estimate_cost = #{record.estimateCost,jdbcType=DECIMAL},
  505. estimate_refundable = #{record.estimateRefundable,jdbcType=DECIMAL},
  506. refund_Invoice = #{record.refundInvoice,jdbcType=DECIMAL}
  507. <if test="_parameter != null">
  508. <include refid="Update_By_Example_Where_Clause" />
  509. </if>
  510. </update>
  511. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.NewOrderChange">
  512. <!--
  513. WARNING - @mbg.generated
  514. This element is automatically generated by MyBatis Generator, do not modify.
  515. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  516. -->
  517. update new_order_change
  518. <set>
  519. <if test="orderNo != null">
  520. order_no = #{orderNo,jdbcType=VARCHAR},
  521. </if>
  522. <if test="processState != null">
  523. process_state = #{processState,jdbcType=INTEGER},
  524. </if>
  525. <if test="status != null">
  526. status = #{status,jdbcType=INTEGER},
  527. </if>
  528. <if test="type != null">
  529. type = #{type,jdbcType=INTEGER},
  530. </if>
  531. <if test="createTime != null">
  532. create_time = #{createTime,jdbcType=TIMESTAMP},
  533. </if>
  534. <if test="remarks != null">
  535. remarks = #{remarks,jdbcType=VARCHAR},
  536. </if>
  537. <if test="voucherUrl != null">
  538. voucher_url = #{voucherUrl,jdbcType=VARCHAR},
  539. </if>
  540. <if test="totalAmount != null">
  541. total_amount = #{totalAmount,jdbcType=DECIMAL},
  542. </if>
  543. <if test="settlementAmount != null">
  544. settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
  545. </if>
  546. <if test="changeAmount != null">
  547. change_amount = #{changeAmount,jdbcType=DECIMAL},
  548. </if>
  549. <if test="applicant != null">
  550. applicant = #{applicant,jdbcType=VARCHAR},
  551. </if>
  552. <if test="depName != null">
  553. dep_name = #{depName,jdbcType=VARCHAR},
  554. </if>
  555. <if test="projectState != null">
  556. project_state = #{projectState,jdbcType=VARCHAR},
  557. </if>
  558. <if test="zxsCost != null">
  559. zxs_cost = #{zxsCost,jdbcType=DECIMAL},
  560. </if>
  561. <if test="zxsRemarks != null">
  562. zxs_remarks = #{zxsRemarks,jdbcType=VARCHAR},
  563. </if>
  564. <if test="paymentTime != null">
  565. payment_time = #{paymentTime,jdbcType=TIMESTAMP},
  566. </if>
  567. <if test="paymentAmount != null">
  568. payment_amount = #{paymentAmount,jdbcType=DECIMAL},
  569. </if>
  570. <if test="invoiceTime != null">
  571. invoice_time = #{invoiceTime,jdbcType=TIMESTAMP},
  572. </if>
  573. <if test="invoiceAmount != null">
  574. invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
  575. </if>
  576. <if test="invoiceType != null">
  577. invoice_type = #{invoiceType,jdbcType=VARCHAR},
  578. </if>
  579. <if test="cwCost != null">
  580. cw_cost = #{cwCost,jdbcType=DECIMAL},
  581. </if>
  582. <if test="refundableAmount != null">
  583. refundable_amount = #{refundableAmount,jdbcType=DECIMAL},
  584. </if>
  585. <if test="cwRemarks != null">
  586. cw_remarks = #{cwRemarks,jdbcType=VARCHAR},
  587. </if>
  588. <if test="estimateCost != null">
  589. estimate_cost = #{estimateCost,jdbcType=DECIMAL},
  590. </if>
  591. <if test="estimateRefundable != null">
  592. estimate_refundable = #{estimateRefundable,jdbcType=DECIMAL},
  593. </if>
  594. <if test="refundInvoice != null">
  595. refund_Invoice = #{refundInvoice,jdbcType=DECIMAL},
  596. </if>
  597. </set>
  598. where id = #{id,jdbcType=INTEGER}
  599. </update>
  600. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.NewOrderChange">
  601. <!--
  602. WARNING - @mbg.generated
  603. This element is automatically generated by MyBatis Generator, do not modify.
  604. This element was generated on Wed Sep 18 14:33:46 CST 2019.
  605. -->
  606. update new_order_change
  607. set order_no = #{orderNo,jdbcType=VARCHAR},
  608. process_state = #{processState,jdbcType=INTEGER},
  609. status = #{status,jdbcType=INTEGER},
  610. type = #{type,jdbcType=INTEGER},
  611. create_time = #{createTime,jdbcType=TIMESTAMP},
  612. remarks = #{remarks,jdbcType=VARCHAR},
  613. voucher_url = #{voucherUrl,jdbcType=VARCHAR},
  614. total_amount = #{totalAmount,jdbcType=DECIMAL},
  615. settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
  616. change_amount = #{changeAmount,jdbcType=DECIMAL},
  617. applicant = #{applicant,jdbcType=VARCHAR},
  618. dep_name = #{depName,jdbcType=VARCHAR},
  619. project_state = #{projectState,jdbcType=VARCHAR},
  620. zxs_cost = #{zxsCost,jdbcType=DECIMAL},
  621. zxs_remarks = #{zxsRemarks,jdbcType=VARCHAR},
  622. payment_time = #{paymentTime,jdbcType=TIMESTAMP},
  623. payment_amount = #{paymentAmount,jdbcType=DECIMAL},
  624. invoice_time = #{invoiceTime,jdbcType=TIMESTAMP},
  625. invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
  626. invoice_type = #{invoiceType,jdbcType=VARCHAR},
  627. cw_cost = #{cwCost,jdbcType=DECIMAL},
  628. refundable_amount = #{refundableAmount,jdbcType=DECIMAL},
  629. cw_remarks = #{cwRemarks,jdbcType=VARCHAR},
  630. estimate_cost = #{estimateCost,jdbcType=DECIMAL},
  631. estimate_refundable = #{estimateRefundable,jdbcType=DECIMAL},
  632. refund_Invoice = #{refundInvoice,jdbcType=DECIMAL}
  633. where id = #{id,jdbcType=INTEGER}
  634. </update>
  635. <select id="selectByorderNo" resultType="com.goafanti.order.bo.NewOrderChangeBo">
  636. select
  637. a.id, a.order_no orderNo, a.process_state processState, a.status, a.`type`,a.refundable_amount refundableAmount,
  638. date_format(a.create_time, '%Y-%m-%d %H:%i:%S')createTimes, a.remarks, a.voucher_url voucherUrl,a.cw_cost cwCost,
  639. a.total_amount totalAmount, a.settlement_amount settlementAmount, (a.total_amount-a.settlement_amount) arrears,
  640. a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,
  641. a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,
  642. date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
  643. a.cw_remarks cwRemarks from new_order_change a where 1 = 1
  644. and a.order_no= #{orderNo}
  645. order by a.create_time desc
  646. limit 1
  647. </select>
  648. <select id="selectById" resultType="com.goafanti.order.bo.NewOrderChangeBo">
  649. select
  650. a.id, a.order_no orderNo, a.process_state processState, a.status, a.`type`,a.refundable_amount refundableAmount,
  651. date_format(a.create_time, '%Y-%m-%d %H:%i:%S')createTimes, a.remarks, a.voucher_url voucherUrl,a.cw_cost cwCost,
  652. a.total_amount totalAmount, a.settlement_amount settlementAmount, (a.total_amount-a.settlement_amount) arrears,
  653. a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,
  654. a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,
  655. date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
  656. a.cw_remarks cwRemarks,a.estimate_cost estimateCost,estimate_refundable estimateRefundable,refund_Invoice refundInvoice
  657. from new_order_change a where 1 = 1 and a.id= #{id}
  658. </select>
  659. <select id="checkOderNo" resultType="java.lang.Integer">
  660. select count(*) from new_order_change
  661. where status != 4 and order_no= #{orderNo}
  662. </select>
  663. <select id="selectOrderChangeList" resultType="com.goafanti.order.bo.NewOderCahngeListBo">
  664. select a.id,a.order_no orderNo,b.contract_no contractNo, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes,c.nickname,b.order_type orderType,
  665. date_format(b.create_time,'%Y-%m-%d %H:%i:%S')establishTimes, b.order_status orderStatus,b.total_amount totalAmount,a.status ,
  666. b.settlement_amount settlementAmount,(b.total_amount-b.settlement_amount) arrears,d.name salesmanName,e.name depName,a.`type`,
  667. a.process_state processState from new_order_change a left join t_order_new b on a.order_no=b.order_no
  668. left join user c on b.buyer_id=c.id left join admin d on b.salesman_id=d.id left join department e on b.order_dep=e.id
  669. <if test="processState==2 or processState==3 ">
  670. left join t_order_task x on a.order_no=x.order_no
  671. </if>
  672. where 1=1
  673. <if test="processState==0">
  674. and b.salesman_id= #{aid}
  675. </if>
  676. <if test="processState==1">
  677. and b.order_dep in
  678. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  679. #{deps.id}
  680. </foreach>
  681. </if>
  682. <if test="processState==2 ">
  683. and x.consultant_id=#{aid} and process_state &gt;= 2
  684. </if>
  685. <if test="processState==3 ">
  686. and x.manager_id=#{aid} and process_state &gt;= 3
  687. </if>
  688. <if test="processState==5">
  689. and e.finance_id =#{aid}
  690. </if>
  691. <if test="userName !=null">
  692. and c.nickname like concat('%',#{userName},'%')
  693. </if>
  694. <if test="orderNo !=null">
  695. and a.order_no like concat('%',#{orderNo},'%')
  696. </if>
  697. <if test="contractNo !=null">
  698. and b.contract_no like concat('%',#{contractNo},'%')
  699. </if>
  700. <if test="type !=null">
  701. and a.type = #{type}
  702. </if>
  703. <if test="timeType == 0 and startTime !=null and endTime !=null">
  704. and a.create_time between #{startTime} and #{endTime}
  705. </if>
  706. <if test="timeType == 1 and startTime !=null and endTime !=null">
  707. and b.create_time between #{startTime} and #{endTime}
  708. </if>
  709. <if test="depId !=null">
  710. and b.order_dep = #{depId}
  711. </if>
  712. <if test="salesmanName !=null">
  713. and d.name like concat('%',#{salesmanName},'%')
  714. </if>
  715. <if test="complete ==0 and processState != 8">
  716. and a.process_state &gt;= #{processState}
  717. </if>
  718. <if test="complete ==0 and processState == 8">
  719. and a.process_state &gt;= #{processState} and a.process_state &lt; 9
  720. </if>
  721. <if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
  722. and a.process_state = #{processState}
  723. </if>
  724. <if test="complete ==1 and processState == 5">
  725. and a.process_state in(5,9) and a.status !=4
  726. </if>
  727. <if test="complete ==1 and processState == 7">
  728. and a.process_state = 7 and a.status != 4 and a.status !=2
  729. </if>
  730. <if test="complete ==1 and processState == 8">
  731. and a.process_state = #{processState} and a.status != 4 and a.status !=2
  732. </if>
  733. <if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
  734. and a.process_state &gt; #{processState}
  735. </if>
  736. <if test="complete ==2 and processState == 5">
  737. and (a.process_state &gt; 5 and a.process_state &lt; 9) or (a.process_state =9 and a.status=4)
  738. </if>
  739. <if test="complete ==2 and processState == 7">
  740. and ((a.process_state = 7 and (a.status = 4 or a.status = 2))or a.process_state &gt; 7)
  741. </if>
  742. <if test="complete ==2 and processState == 8">
  743. and a.process_state = 8 and (a.status = 4 or a.status = 2)
  744. </if>
  745. <if test="complete ==3">
  746. and a.status = 2
  747. </if>
  748. order by a.create_time desc
  749. <if test="page_sql != null">
  750. ${page_sql}
  751. </if>
  752. </select>
  753. <select id="selectOrderChangeCount" resultType="java.lang.Integer">
  754. select count(*) from new_order_change a left join t_order_new b on a.order_no=b.order_no left join user c on b.buyer_id=c.id
  755. left join admin d on b.salesman_id=d.id left join department e on b.order_dep=e.id
  756. <if test="processState==2 or processState==3 ">
  757. left join t_order_task x on a.order_no=x.order_no
  758. </if>
  759. where 1=1
  760. <if test="processState==0">
  761. and b.salesman_id= #{aid}
  762. </if>
  763. <if test="processState==1">
  764. and b.order_dep in
  765. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  766. #{deps.id}
  767. </foreach>
  768. </if>
  769. <if test="processState==2 ">
  770. and x.consultant_id=#{aid} and process_state &gt;= 2
  771. </if>
  772. <if test="processState==3 ">
  773. and x.manager_id=#{aid} and process_state &gt;= 3
  774. </if>
  775. <if test="processState==5">
  776. and e.finance_id =#{aid}
  777. </if>
  778. <if test="userName !=null">
  779. and c.nickname like concat('%',#{userName},'%')
  780. </if>
  781. <if test="timeType == 0 and startTime !=null and endTime !=null">
  782. and a.create_time between #{startTime} and #{endTime}
  783. </if>
  784. <if test="timeType == 1 and startTime !=null and endTime !=null">
  785. and b.create_time between #{startTime} and #{endTime}
  786. </if>
  787. <if test="depId !=null">
  788. and b.order_dep = #{depId}
  789. </if>
  790. <if test="orderNo !=null">
  791. and a.order_no like concat('%',#{orderNo},'%')
  792. </if>
  793. <if test="contractNo !=null">
  794. and b.contract_no like concat('%',#{contractNo},'%')
  795. </if>
  796. <if test="type !=null">
  797. and a.type = #{type}
  798. </if>
  799. <if test="salesmanName !=null">
  800. and d.name like concat('%',#{salesmanName},'%')
  801. </if>
  802. <if test="complete ==0 and processState != 8">
  803. and a.process_state &gt;= #{processState}
  804. </if>
  805. <if test="complete ==0 and processState == 8">
  806. and a.process_state &gt;= #{processState} and a.process_state &lt; 9
  807. </if>
  808. <if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
  809. and a.process_state = #{processState}
  810. </if>
  811. <if test="complete ==1 and processState == 5">
  812. and a.process_state in(5,9) and a.status !=4
  813. </if>
  814. <if test="complete ==1 and processState == 7">
  815. and a.process_state = 7 and a.status != 4 and a.status !=2
  816. </if>
  817. <if test="complete ==1 and processState == 8">
  818. and a.process_state = #{processState} and a.status != 4 and a.status !=2
  819. </if>
  820. <if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
  821. and a.process_state &gt; #{processState}
  822. </if>
  823. <if test="complete ==2 and processState == 5">
  824. and (a.process_state &gt; 5 and a.process_state &lt; 9) or (a.process_state =9 and a.status=4)
  825. </if>
  826. <if test="complete ==2 and processState == 7">
  827. and ((a.process_state = 7 and (a.status = 4 or a.status = 2))or a.process_state &gt; 7)
  828. </if>
  829. <if test="complete ==2 and processState == 8">
  830. and a.process_state = 8 and (a.status = 4 or a.status = 2)
  831. </if>
  832. <if test="complete ==3">
  833. and a.status = 2
  834. </if>
  835. </select>
  836. <update id="addRefundInvoice" >
  837. update new_order_change
  838. set `refund_Invoice`=ifnull(`refund_Invoice`,0)+ #{amount}
  839. where order_no= #{orderNo}
  840. </update>
  841. <update id="subtractRefundInvoice">
  842. update new_order_change
  843. set `refund_Invoice`=ifnull(`refund_Invoice`,0)- #{amount}
  844. where order_no= #{orderNo}
  845. </update>
  846. </mapper>