NewOrderChangeMapper.xml 31 KB

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