NewOrderChangeMapper.xml 48 KB

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