TOrderNewMapper.xml 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278
  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.TOrderNewMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderNew">
  5. <!--
  6. WARNING - @mbggenerated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  9. -->
  10. <id column="order_no" jdbcType="VARCHAR" property="orderNo" />
  11. <result column="order_type" jdbcType="INTEGER" property="orderType" />
  12. <result column="creater" jdbcType="VARCHAR" property="creater" />
  13. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  14. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  15. <result column="buyer_id" jdbcType="VARCHAR" property="buyerId" />
  16. <result column="first_amount" jdbcType="DECIMAL" property="firstAmount" />
  17. <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
  18. <result column="settlement_amount" jdbcType="DECIMAL" property="settlementAmount" />
  19. <result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
  20. <result column="order_status" jdbcType="INTEGER" property="orderStatus" />
  21. <result column="liquidation_status" jdbcType="INTEGER" property="liquidationStatus" />
  22. <result column="process_status" jdbcType="INTEGER" property="processStatus" />
  23. <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
  24. <result column="approval" jdbcType="INTEGER" property="approval" />
  25. <result column="order_remarks" jdbcType="VARCHAR" property="orderRemarks" />
  26. <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
  27. <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
  28. <result column="finance_id" jdbcType="VARCHAR" property="financeId" />
  29. <result column="technician_id" jdbcType="VARCHAR" property="technicianId" />
  30. <result column="sign_time" jdbcType="DATE" property="signTime" />
  31. <result column="settlement_time" jdbcType="DATE" property="settlementTime" />
  32. <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
  33. <result column="contract_type" jdbcType="VARCHAR" property="contractType" />
  34. <result column="contacts" jdbcType="VARCHAR" property="contacts" />
  35. <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
  36. <result column="legal_person" jdbcType="VARCHAR" property="legalPerson" />
  37. <result column="legal_person_tel" jdbcType="VARCHAR" property="legalPersonTel" />
  38. <result column="proof_count" jdbcType="REAL" property="proofCount" />
  39. <result column="proof_aid" jdbcType="VARCHAR" property="proofAid" />
  40. </resultMap>
  41. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrderNew">
  42. <!--
  43. WARNING - @mbggenerated
  44. This element is automatically generated by MyBatis Generator, do not modify.
  45. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  46. -->
  47. <result column="contract_picture_url" jdbcType="LONGVARCHAR" property="contractPictureUrl" />
  48. </resultMap>
  49. <sql id="Example_Where_Clause">
  50. <!--
  51. WARNING - @mbggenerated
  52. This element is automatically generated by MyBatis Generator, do not modify.
  53. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  54. -->
  55. <where>
  56. <foreach collection="oredCriteria" item="criteria" separator="or">
  57. <if test="criteria.valid">
  58. <trim prefix="(" prefixOverrides="and" suffix=")">
  59. <foreach collection="criteria.criteria" item="criterion">
  60. <choose>
  61. <when test="criterion.noValue">
  62. and ${criterion.condition}
  63. </when>
  64. <when test="criterion.singleValue">
  65. and ${criterion.condition} #{criterion.value}
  66. </when>
  67. <when test="criterion.betweenValue">
  68. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  69. </when>
  70. <when test="criterion.listValue">
  71. and ${criterion.condition}
  72. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  73. #{listItem}
  74. </foreach>
  75. </when>
  76. </choose>
  77. </foreach>
  78. </trim>
  79. </if>
  80. </foreach>
  81. </where>
  82. </sql>
  83. <sql id="Update_By_Example_Where_Clause">
  84. <!--
  85. WARNING - @mbggenerated
  86. This element is automatically generated by MyBatis Generator, do not modify.
  87. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  88. -->
  89. <where>
  90. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  91. <if test="criteria.valid">
  92. <trim prefix="(" prefixOverrides="and" suffix=")">
  93. <foreach collection="criteria.criteria" item="criterion">
  94. <choose>
  95. <when test="criterion.noValue">
  96. and ${criterion.condition}
  97. </when>
  98. <when test="criterion.singleValue">
  99. and ${criterion.condition} #{criterion.value}
  100. </when>
  101. <when test="criterion.betweenValue">
  102. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  103. </when>
  104. <when test="criterion.listValue">
  105. and ${criterion.condition}
  106. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  107. #{listItem}
  108. </foreach>
  109. </when>
  110. </choose>
  111. </foreach>
  112. </trim>
  113. </if>
  114. </foreach>
  115. </where>
  116. </sql>
  117. <sql id="Base_Column_List">
  118. <!--
  119. WARNING - @mbggenerated
  120. This element is automatically generated by MyBatis Generator, do not modify.
  121. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  122. -->
  123. order_no, order_type, creater, create_time, update_time, buyer_id, first_amount,
  124. total_amount, settlement_amount, refund_amount, order_status, liquidation_status,
  125. process_status, project_status, approval, order_remarks, delete_sign, salesman_id,
  126. finance_id, technician_id, sign_time, settlement_time, contract_no, contract_type,
  127. contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid,
  128. proof_time, proof_status
  129. </sql>
  130. <sql id="Blob_Column_List">
  131. <!--
  132. WARNING - @mbggenerated
  133. This element is automatically generated by MyBatis Generator, do not modify.
  134. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  135. -->
  136. contract_picture_url
  137. </sql>
  138. <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.TOrderNewExample" resultMap="ResultMapWithBLOBs">
  139. <!--
  140. WARNING - @mbggenerated
  141. This element is automatically generated by MyBatis Generator, do not modify.
  142. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  143. -->
  144. select
  145. <if test="distinct">
  146. distinct
  147. </if>
  148. <include refid="Base_Column_List" />
  149. ,
  150. <include refid="Blob_Column_List" />
  151. from t_order_new
  152. <if test="_parameter != null">
  153. <include refid="Example_Where_Clause" />
  154. </if>
  155. <if test="orderByClause != null">
  156. order by ${orderByClause}
  157. </if>
  158. </select>
  159. <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderNewExample" resultMap="BaseResultMap">
  160. <!--
  161. WARNING - @mbggenerated
  162. This element is automatically generated by MyBatis Generator, do not modify.
  163. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  164. -->
  165. select
  166. <if test="distinct">
  167. distinct
  168. </if>
  169. <include refid="Base_Column_List" />
  170. from t_order_new
  171. <if test="_parameter != null">
  172. <include refid="Example_Where_Clause" />
  173. </if>
  174. <if test="orderByClause != null">
  175. order by ${orderByClause}
  176. </if>
  177. </select>
  178. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
  179. <!--
  180. WARNING - @mbggenerated
  181. This element is automatically generated by MyBatis Generator, do not modify.
  182. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  183. -->
  184. select
  185. <include refid="Base_Column_List" />
  186. ,
  187. <include refid="Blob_Column_List" />
  188. from t_order_new
  189. where order_no = #{orderNo,jdbcType=VARCHAR}
  190. </select>
  191. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  192. <!--
  193. WARNING - @mbggenerated
  194. This element is automatically generated by MyBatis Generator, do not modify.
  195. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  196. -->
  197. delete from t_order_new
  198. where order_no = #{orderNo,jdbcType=VARCHAR}
  199. </delete>
  200. <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderNewExample">
  201. <!--
  202. WARNING - @mbggenerated
  203. This element is automatically generated by MyBatis Generator, do not modify.
  204. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  205. -->
  206. delete from t_order_new
  207. <if test="_parameter != null">
  208. <include refid="Example_Where_Clause" />
  209. </if>
  210. </delete>
  211. <insert id="insert" parameterType="com.goafanti.common.model.TOrderNew">
  212. <!--
  213. WARNING - @mbggenerated
  214. This element is automatically generated by MyBatis Generator, do not modify.
  215. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  216. -->
  217. insert into t_order_new (order_no, order_type, creater,
  218. create_time, update_time, buyer_id,
  219. first_amount, total_amount, settlement_amount,
  220. refund_amount, order_status, liquidation_status,
  221. process_status, project_status, approval,
  222. order_remarks, delete_sign, salesman_id,
  223. finance_id, technician_id, sign_time,
  224. settlement_time, contract_no, contract_type,
  225. contacts, contact_mobile, legal_person,
  226. legal_person_tel, proof_count, proof_aid,
  227. contract_picture_url)
  228. values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR},
  229. #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR},
  230. #{firstAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL},
  231. #{refundAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER},
  232. #{processStatus,jdbcType=INTEGER}, #{projectStatus,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER},
  233. #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, #{salesmanId,jdbcType=VARCHAR},
  234. #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR}, #{signTime,jdbcType=DATE},
  235. #{settlementTime,jdbcType=DATE}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
  236. #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR},
  237. #{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=REAL}, #{proofAid,jdbcType=VARCHAR},
  238. #{contractPictureUrl,jdbcType=LONGVARCHAR})
  239. </insert>
  240. <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderNew">
  241. <!--
  242. WARNING - @mbggenerated
  243. This element is automatically generated by MyBatis Generator, do not modify.
  244. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  245. -->
  246. insert into t_order_new
  247. <trim prefix="(" suffix=")" suffixOverrides=",">
  248. <if test="orderNo != null">
  249. order_no,
  250. </if>
  251. <if test="orderType != null">
  252. order_type,
  253. </if>
  254. <if test="creater != null">
  255. creater,
  256. </if>
  257. <if test="createTime != null">
  258. create_time,
  259. </if>
  260. <if test="updateTime != null">
  261. update_time,
  262. </if>
  263. <if test="buyerId != null">
  264. buyer_id,
  265. </if>
  266. <if test="firstAmount != null">
  267. first_amount,
  268. </if>
  269. <if test="totalAmount != null">
  270. total_amount,
  271. </if>
  272. <if test="settlementAmount != null">
  273. settlement_amount,
  274. </if>
  275. <if test="refundAmount != null">
  276. refund_amount,
  277. </if>
  278. <if test="orderStatus != null">
  279. order_status,
  280. </if>
  281. <if test="liquidationStatus != null">
  282. liquidation_status,
  283. </if>
  284. <if test="processStatus != null">
  285. process_status,
  286. </if>
  287. <if test="projectStatus != null">
  288. project_status,
  289. </if>
  290. <if test="approval != null">
  291. approval,
  292. </if>
  293. <if test="orderRemarks != null">
  294. order_remarks,
  295. </if>
  296. <if test="deleteSign != null">
  297. delete_sign,
  298. </if>
  299. <if test="salesmanId != null">
  300. salesman_id,
  301. </if>
  302. <if test="financeId != null">
  303. finance_id,
  304. </if>
  305. <if test="technicianId != null">
  306. technician_id,
  307. </if>
  308. <if test="signTime != null">
  309. sign_time,
  310. </if>
  311. <if test="settlementTime != null">
  312. settlement_time,
  313. </if>
  314. <if test="contractNo != null">
  315. contract_no,
  316. </if>
  317. <if test="contractType != null">
  318. contract_type,
  319. </if>
  320. <if test="contacts != null">
  321. contacts,
  322. </if>
  323. <if test="contactMobile != null">
  324. contact_mobile,
  325. </if>
  326. <if test="legalPerson != null">
  327. legal_person,
  328. </if>
  329. <if test="legalPersonTel != null">
  330. legal_person_tel,
  331. </if>
  332. <if test="proofCount != null">
  333. proof_count,
  334. </if>
  335. <if test="proofAid != null">
  336. proof_aid,
  337. </if>
  338. <if test="contractPictureUrl != null">
  339. contract_picture_url,
  340. </if>
  341. </trim>
  342. <trim prefix="values (" suffix=")" suffixOverrides=",">
  343. <if test="orderNo != null">
  344. #{orderNo,jdbcType=VARCHAR},
  345. </if>
  346. <if test="orderType != null">
  347. #{orderType,jdbcType=INTEGER},
  348. </if>
  349. <if test="creater != null">
  350. #{creater,jdbcType=VARCHAR},
  351. </if>
  352. <if test="createTime != null">
  353. #{createTime,jdbcType=TIMESTAMP},
  354. </if>
  355. <if test="updateTime != null">
  356. #{updateTime,jdbcType=TIMESTAMP},
  357. </if>
  358. <if test="buyerId != null">
  359. #{buyerId,jdbcType=VARCHAR},
  360. </if>
  361. <if test="firstAmount != null">
  362. #{firstAmount,jdbcType=DECIMAL},
  363. </if>
  364. <if test="totalAmount != null">
  365. #{totalAmount,jdbcType=DECIMAL},
  366. </if>
  367. <if test="settlementAmount != null">
  368. #{settlementAmount,jdbcType=DECIMAL},
  369. </if>
  370. <if test="refundAmount != null">
  371. #{refundAmount,jdbcType=DECIMAL},
  372. </if>
  373. <if test="orderStatus != null">
  374. #{orderStatus,jdbcType=INTEGER},
  375. </if>
  376. <if test="liquidationStatus != null">
  377. #{liquidationStatus,jdbcType=INTEGER},
  378. </if>
  379. <if test="processStatus != null">
  380. #{processStatus,jdbcType=INTEGER},
  381. </if>
  382. <if test="projectStatus != null">
  383. #{projectStatus,jdbcType=INTEGER},
  384. </if>
  385. <if test="approval != null">
  386. #{approval,jdbcType=INTEGER},
  387. </if>
  388. <if test="orderRemarks != null">
  389. #{orderRemarks,jdbcType=VARCHAR},
  390. </if>
  391. <if test="deleteSign != null">
  392. #{deleteSign,jdbcType=INTEGER},
  393. </if>
  394. <if test="salesmanId != null">
  395. #{salesmanId,jdbcType=VARCHAR},
  396. </if>
  397. <if test="financeId != null">
  398. #{financeId,jdbcType=VARCHAR},
  399. </if>
  400. <if test="technicianId != null">
  401. #{technicianId,jdbcType=VARCHAR},
  402. </if>
  403. <if test="signTime != null">
  404. #{signTime,jdbcType=DATE},
  405. </if>
  406. <if test="settlementTime != null">
  407. #{settlementTime,jdbcType=DATE},
  408. </if>
  409. <if test="contractNo != null">
  410. #{contractNo,jdbcType=VARCHAR},
  411. </if>
  412. <if test="contractType != null">
  413. #{contractType,jdbcType=VARCHAR},
  414. </if>
  415. <if test="contacts != null">
  416. #{contacts,jdbcType=VARCHAR},
  417. </if>
  418. <if test="contactMobile != null">
  419. #{contactMobile,jdbcType=VARCHAR},
  420. </if>
  421. <if test="legalPerson != null">
  422. #{legalPerson,jdbcType=VARCHAR},
  423. </if>
  424. <if test="legalPersonTel != null">
  425. #{legalPersonTel,jdbcType=VARCHAR},
  426. </if>
  427. <if test="proofCount != null">
  428. #{proofCount,jdbcType=REAL},
  429. </if>
  430. <if test="proofAid != null">
  431. #{proofAid,jdbcType=VARCHAR},
  432. </if>
  433. <if test="contractPictureUrl != null">
  434. #{contractPictureUrl,jdbcType=LONGVARCHAR},
  435. </if>
  436. </trim>
  437. </insert>
  438. <select id="countByExample" parameterType="com.goafanti.common.model.TOrderNewExample" resultType="java.lang.Integer">
  439. <!--
  440. WARNING - @mbggenerated
  441. This element is automatically generated by MyBatis Generator, do not modify.
  442. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  443. -->
  444. select count(*) from t_order_new
  445. <if test="_parameter != null">
  446. <include refid="Example_Where_Clause" />
  447. </if>
  448. </select>
  449. <update id="updateByExampleSelective" parameterType="map">
  450. <!--
  451. WARNING - @mbggenerated
  452. This element is automatically generated by MyBatis Generator, do not modify.
  453. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  454. -->
  455. update t_order_new
  456. <set>
  457. <if test="record.orderNo != null">
  458. order_no = #{record.orderNo,jdbcType=VARCHAR},
  459. </if>
  460. <if test="record.orderType != null">
  461. order_type = #{record.orderType,jdbcType=INTEGER},
  462. </if>
  463. <if test="record.creater != null">
  464. creater = #{record.creater,jdbcType=VARCHAR},
  465. </if>
  466. <if test="record.createTime != null">
  467. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  468. </if>
  469. <if test="record.updateTime != null">
  470. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  471. </if>
  472. <if test="record.buyerId != null">
  473. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  474. </if>
  475. <if test="record.firstAmount != null">
  476. first_amount = #{record.firstAmount,jdbcType=DECIMAL},
  477. </if>
  478. <if test="record.totalAmount != null">
  479. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  480. </if>
  481. <if test="record.settlementAmount != null">
  482. settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
  483. </if>
  484. <if test="record.refundAmount != null">
  485. refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
  486. </if>
  487. <if test="record.orderStatus != null">
  488. order_status = #{record.orderStatus,jdbcType=INTEGER},
  489. </if>
  490. <if test="record.liquidationStatus != null">
  491. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  492. </if>
  493. <if test="record.processStatus != null">
  494. process_status = #{record.processStatus,jdbcType=INTEGER},
  495. </if>
  496. <if test="record.projectStatus != null">
  497. project_status = #{record.projectStatus,jdbcType=INTEGER},
  498. </if>
  499. <if test="record.approval != null">
  500. approval = #{record.approval,jdbcType=INTEGER},
  501. </if>
  502. <if test="record.orderRemarks != null">
  503. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  504. </if>
  505. <if test="record.deleteSign != null">
  506. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  507. </if>
  508. <if test="record.salesmanId != null">
  509. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  510. </if>
  511. <if test="record.financeId != null">
  512. finance_id = #{record.financeId,jdbcType=VARCHAR},
  513. </if>
  514. <if test="record.technicianId != null">
  515. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  516. </if>
  517. <if test="record.signTime != null">
  518. sign_time = #{record.signTime,jdbcType=DATE},
  519. </if>
  520. <if test="record.settlementTime != null">
  521. settlement_time = #{record.settlementTime,jdbcType=DATE},
  522. </if>
  523. <if test="record.contractNo != null">
  524. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  525. </if>
  526. <if test="record.contractType != null">
  527. contract_type = #{record.contractType,jdbcType=VARCHAR},
  528. </if>
  529. <if test="record.contacts != null">
  530. contacts = #{record.contacts,jdbcType=VARCHAR},
  531. </if>
  532. <if test="record.contactMobile != null">
  533. contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
  534. </if>
  535. <if test="record.legalPerson != null">
  536. legal_person = #{record.legalPerson,jdbcType=VARCHAR},
  537. </if>
  538. <if test="record.legalPersonTel != null">
  539. legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
  540. </if>
  541. <if test="record.proofCount != null">
  542. proof_count = #{record.proofCount,jdbcType=REAL},
  543. </if>
  544. <if test="record.proofAid != null">
  545. proof_aid = #{record.proofAid,jdbcType=VARCHAR},
  546. </if>
  547. <if test="record.contractPictureUrl != null">
  548. contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR},
  549. </if>
  550. </set>
  551. <if test="_parameter != null">
  552. <include refid="Update_By_Example_Where_Clause" />
  553. </if>
  554. </update>
  555. <update id="updateByExampleWithBLOBs" parameterType="map">
  556. <!--
  557. WARNING - @mbggenerated
  558. This element is automatically generated by MyBatis Generator, do not modify.
  559. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  560. -->
  561. update t_order_new
  562. set order_no = #{record.orderNo,jdbcType=VARCHAR},
  563. order_type = #{record.orderType,jdbcType=INTEGER},
  564. creater = #{record.creater,jdbcType=VARCHAR},
  565. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  566. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  567. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  568. first_amount = #{record.firstAmount,jdbcType=DECIMAL},
  569. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  570. settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
  571. refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
  572. order_status = #{record.orderStatus,jdbcType=INTEGER},
  573. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  574. process_status = #{record.processStatus,jdbcType=INTEGER},
  575. project_status = #{record.projectStatus,jdbcType=INTEGER},
  576. approval = #{record.approval,jdbcType=INTEGER},
  577. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  578. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  579. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  580. finance_id = #{record.financeId,jdbcType=VARCHAR},
  581. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  582. sign_time = #{record.signTime,jdbcType=DATE},
  583. settlement_time = #{record.settlementTime,jdbcType=DATE},
  584. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  585. contract_type = #{record.contractType,jdbcType=VARCHAR},
  586. contacts = #{record.contacts,jdbcType=VARCHAR},
  587. contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
  588. legal_person = #{record.legalPerson,jdbcType=VARCHAR},
  589. legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
  590. proof_count = #{record.proofCount,jdbcType=REAL},
  591. proof_aid = #{record.proofAid,jdbcType=VARCHAR},
  592. contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR}
  593. <if test="_parameter != null">
  594. <include refid="Update_By_Example_Where_Clause" />
  595. </if>
  596. </update>
  597. <update id="updateByExample" parameterType="map">
  598. <!--
  599. WARNING - @mbggenerated
  600. This element is automatically generated by MyBatis Generator, do not modify.
  601. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  602. -->
  603. update t_order_new
  604. set order_no = #{record.orderNo,jdbcType=VARCHAR},
  605. order_type = #{record.orderType,jdbcType=INTEGER},
  606. creater = #{record.creater,jdbcType=VARCHAR},
  607. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  608. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  609. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  610. first_amount = #{record.firstAmount,jdbcType=DECIMAL},
  611. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  612. settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
  613. refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
  614. order_status = #{record.orderStatus,jdbcType=INTEGER},
  615. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  616. process_status = #{record.processStatus,jdbcType=INTEGER},
  617. project_status = #{record.projectStatus,jdbcType=INTEGER},
  618. approval = #{record.approval,jdbcType=INTEGER},
  619. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  620. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  621. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  622. finance_id = #{record.financeId,jdbcType=VARCHAR},
  623. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  624. sign_time = #{record.signTime,jdbcType=DATE},
  625. settlement_time = #{record.settlementTime,jdbcType=DATE},
  626. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  627. contract_type = #{record.contractType,jdbcType=VARCHAR},
  628. contacts = #{record.contacts,jdbcType=VARCHAR},
  629. contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
  630. legal_person = #{record.legalPerson,jdbcType=VARCHAR},
  631. legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
  632. proof_count = #{record.proofCount,jdbcType=REAL},
  633. proof_aid = #{record.proofAid,jdbcType=VARCHAR}
  634. <if test="_parameter != null">
  635. <include refid="Update_By_Example_Where_Clause" />
  636. </if>
  637. </update>
  638. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderNew">
  639. <!--
  640. WARNING - @mbggenerated
  641. This element is automatically generated by MyBatis Generator, do not modify.
  642. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  643. -->
  644. update t_order_new
  645. <set>
  646. <if test="orderType != null">
  647. order_type = #{orderType,jdbcType=INTEGER},
  648. </if>
  649. <if test="creater != null">
  650. creater = #{creater,jdbcType=VARCHAR},
  651. </if>
  652. <if test="createTime != null">
  653. create_time = #{createTime,jdbcType=TIMESTAMP},
  654. </if>
  655. <if test="updateTime != null">
  656. update_time = #{updateTime,jdbcType=TIMESTAMP},
  657. </if>
  658. <if test="buyerId != null">
  659. buyer_id = #{buyerId,jdbcType=VARCHAR},
  660. </if>
  661. <if test="firstAmount != null">
  662. first_amount = #{firstAmount,jdbcType=DECIMAL},
  663. </if>
  664. <if test="totalAmount != null">
  665. total_amount = #{totalAmount,jdbcType=DECIMAL},
  666. </if>
  667. <if test="settlementAmount != null">
  668. settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
  669. </if>
  670. <if test="refundAmount != null">
  671. refund_amount = #{refundAmount,jdbcType=DECIMAL},
  672. </if>
  673. <if test="orderStatus != null">
  674. order_status = #{orderStatus,jdbcType=INTEGER},
  675. </if>
  676. <if test="liquidationStatus != null">
  677. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  678. </if>
  679. <if test="processStatus != null">
  680. process_status = #{processStatus,jdbcType=INTEGER},
  681. </if>
  682. <if test="projectStatus != null">
  683. project_status = #{projectStatus,jdbcType=INTEGER},
  684. </if>
  685. <if test="approval != null">
  686. approval = #{approval,jdbcType=INTEGER},
  687. </if>
  688. <if test="orderRemarks != null">
  689. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  690. </if>
  691. <if test="deleteSign != null">
  692. delete_sign = #{deleteSign,jdbcType=INTEGER},
  693. </if>
  694. <if test="salesmanId != null">
  695. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  696. </if>
  697. <if test="financeId != null">
  698. finance_id = #{financeId,jdbcType=VARCHAR},
  699. </if>
  700. <if test="technicianId != null">
  701. technician_id = #{technicianId,jdbcType=VARCHAR},
  702. </if>
  703. <if test="signTime != null">
  704. sign_time = #{signTime,jdbcType=DATE},
  705. </if>
  706. <if test="settlementTime != null">
  707. settlement_time = #{settlementTime,jdbcType=DATE},
  708. </if>
  709. <if test="contractNo != null">
  710. contract_no = #{contractNo,jdbcType=VARCHAR},
  711. </if>
  712. <if test="contractType != null">
  713. contract_type = #{contractType,jdbcType=VARCHAR},
  714. </if>
  715. <if test="contacts != null">
  716. contacts = #{contacts,jdbcType=VARCHAR},
  717. </if>
  718. <if test="contactMobile != null">
  719. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  720. </if>
  721. <if test="legalPerson != null">
  722. legal_person = #{legalPerson,jdbcType=VARCHAR},
  723. </if>
  724. <if test="legalPersonTel != null">
  725. legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
  726. </if>
  727. <if test="proofCount != null">
  728. proof_count = #{proofCount,jdbcType=REAL},
  729. </if>
  730. <if test="proofAid != null">
  731. proof_aid = #{proofAid,jdbcType=VARCHAR},
  732. </if>
  733. <if test="proofTime != null">
  734. proof_time = #{proofTime,jdbcType=DATE},
  735. </if>
  736. <if test="proofStatus != null">
  737. proof_status = #{proofStatus,jdbcType=INTEGER},
  738. </if>
  739. <if test="contractPictureUrl != null">
  740. contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR},
  741. </if>
  742. </set>
  743. where order_no = #{orderNo,jdbcType=VARCHAR}
  744. </update>
  745. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.TOrderNew">
  746. <!--
  747. WARNING - @mbggenerated
  748. This element is automatically generated by MyBatis Generator, do not modify.
  749. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  750. -->
  751. update t_order_new
  752. set order_type = #{orderType,jdbcType=INTEGER},
  753. creater = #{creater,jdbcType=VARCHAR},
  754. create_time = #{createTime,jdbcType=TIMESTAMP},
  755. update_time = #{updateTime,jdbcType=TIMESTAMP},
  756. buyer_id = #{buyerId,jdbcType=VARCHAR},
  757. first_amount = #{firstAmount,jdbcType=DECIMAL},
  758. total_amount = #{totalAmount,jdbcType=DECIMAL},
  759. settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
  760. refund_amount = #{refundAmount,jdbcType=DECIMAL},
  761. order_status = #{orderStatus,jdbcType=INTEGER},
  762. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  763. process_status = #{processStatus,jdbcType=INTEGER},
  764. project_status = #{projectStatus,jdbcType=INTEGER},
  765. approval = #{approval,jdbcType=INTEGER},
  766. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  767. delete_sign = #{deleteSign,jdbcType=INTEGER},
  768. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  769. finance_id = #{financeId,jdbcType=VARCHAR},
  770. technician_id = #{technicianId,jdbcType=VARCHAR},
  771. sign_time = #{signTime,jdbcType=DATE},
  772. settlement_time = #{settlementTime,jdbcType=DATE},
  773. contract_no = #{contractNo,jdbcType=VARCHAR},
  774. contract_type = #{contractType,jdbcType=VARCHAR},
  775. contacts = #{contacts,jdbcType=VARCHAR},
  776. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  777. legal_person = #{legalPerson,jdbcType=VARCHAR},
  778. legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
  779. proof_count = #{proofCount,jdbcType=REAL},
  780. proof_aid = #{proofAid,jdbcType=VARCHAR},
  781. contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR}
  782. where order_no = #{orderNo,jdbcType=VARCHAR}
  783. </update>
  784. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderNew">
  785. <!--
  786. WARNING - @mbggenerated
  787. This element is automatically generated by MyBatis Generator, do not modify.
  788. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  789. -->
  790. update t_order_new
  791. set order_type = #{orderType,jdbcType=INTEGER},
  792. creater = #{creater,jdbcType=VARCHAR},
  793. create_time = #{createTime,jdbcType=TIMESTAMP},
  794. update_time = #{updateTime,jdbcType=TIMESTAMP},
  795. buyer_id = #{buyerId,jdbcType=VARCHAR},
  796. first_amount = #{firstAmount,jdbcType=DECIMAL},
  797. total_amount = #{totalAmount,jdbcType=DECIMAL},
  798. settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
  799. refund_amount = #{refundAmount,jdbcType=DECIMAL},
  800. order_status = #{orderStatus,jdbcType=INTEGER},
  801. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  802. process_status = #{processStatus,jdbcType=INTEGER},
  803. project_status = #{projectStatus,jdbcType=INTEGER},
  804. approval = #{approval,jdbcType=INTEGER},
  805. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  806. delete_sign = #{deleteSign,jdbcType=INTEGER},
  807. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  808. finance_id = #{financeId,jdbcType=VARCHAR},
  809. technician_id = #{technicianId,jdbcType=VARCHAR},
  810. sign_time = #{signTime,jdbcType=DATE},
  811. settlement_time = #{settlementTime,jdbcType=DATE},
  812. contract_no = #{contractNo,jdbcType=VARCHAR},
  813. contract_type = #{contractType,jdbcType=VARCHAR},
  814. contacts = #{contacts,jdbcType=VARCHAR},
  815. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  816. legal_person = #{legalPerson,jdbcType=VARCHAR},
  817. legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
  818. proof_count = #{proofCount,jdbcType=REAL},
  819. proof_aid = #{proofAid,jdbcType=VARCHAR}
  820. where order_no = #{orderNo,jdbcType=VARCHAR}
  821. </update>
  822. <!-- 查看所有待财务管理员分配的订单数据 -->
  823. <select id="getAllUnassignedListOrder" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
  824. select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
  825. o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
  826. from t_order_new o
  827. left join `user` u on o.buyer_id = u.id
  828. left join admin a on o.salesman_id = a.id
  829. where delete_sign = 0
  830. and order_status = 2
  831. <if test="o.processStatus != null">
  832. and process_status = #{o.processStatus,jdbcType=INTEGER}
  833. </if>
  834. <if test='o.orderNo != null and o.orderNo != ""'>
  835. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  836. </if>
  837. <if test='o.financeId != null and o.financeId != ""'>
  838. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  839. </if>
  840. <if test='o.buyerName != null and o.buyerName != ""'>
  841. <bind name="n" value="'%' + o.buyerName + '%'"/>
  842. and u.nickname like #{n,jdbcType=VARCHAR}
  843. </if>
  844. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  845. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  846. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  847. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  848. </if>
  849. <if test="ob == 1">
  850. order by o.sign_time
  851. </if>
  852. <if test="ob == 2">
  853. order by o.liquidation_status,o.sign_time
  854. </if>
  855. <if test="page_sql != null">
  856. ${page_sql}
  857. </if>
  858. </select>
  859. <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
  860. select count(*) from t_order_new o
  861. left join `user` u on o.buyer_id = u.id
  862. left join admin a on o.salesman_id = a.id
  863. where delete_sign = 0
  864. and order_status = 2
  865. <if test="o.processStatus != null">
  866. and process_status = #{o.processStatus,jdbcType=VARCHAR}
  867. </if>
  868. <if test='o.orderNo != null and o.orderNo != ""'>
  869. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  870. </if>
  871. <if test='financeId != null and financeId != ""'>
  872. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  873. </if>
  874. <if test='o.buyerName != null and o.buyerName != ""'>
  875. <bind name="n" value="'%' + o.buyerName + '%'"/>
  876. and u.nickname like #{n,jdbcType=VARCHAR}
  877. </if>
  878. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  879. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  880. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  881. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  882. </if>
  883. </select>
  884. <!-- 查看某订单状态是否符合要求 -->
  885. <select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
  886. select count(*) from t_order_new
  887. where order_no = #{orderNo,jdbcType=VARCHAR}
  888. <if test="orderType != null">
  889. and order_type = #{orderType,jdbcType=INTEGER}
  890. </if>
  891. <if test="creater != null">
  892. and creater = #{creater,jdbcType=VARCHAR}
  893. </if>
  894. <if test="buyerId != null">
  895. and buyer_id = #{buyerId,jdbcType=VARCHAR}
  896. </if>
  897. <if test="firstAmount != null">
  898. and first_amount = #{firstAmount,jdbcType=DECIMAL}
  899. </if>
  900. <if test="totalAmount != null">
  901. and total_amount = #{totalAmount,jdbcType=DECIMAL}
  902. </if>
  903. <if test="settlementAmount != null">
  904. and settlement_amount = #{settlementAmount,jdbcType=DECIMAL}
  905. </if>
  906. <if test="orderStatus != null">
  907. and order_status = #{orderStatus,jdbcType=INTEGER}
  908. </if>
  909. <if test="liquidationStatus == 1">
  910. and liquidation_status between 1 and 2
  911. </if>
  912. <if test="processStatus != null">
  913. and process_status = #{processStatus,jdbcType=INTEGER}
  914. </if>
  915. <if test="projectStatus != null">
  916. and project_status = #{projectStatus,jdbcType=INTEGER}
  917. </if>
  918. <if test="approval != null">
  919. and approval = #{approval,jdbcType=INTEGER}
  920. </if>
  921. <if test="orderRemarks != null">
  922. and order_remarks = #{orderRemarks,jdbcType=VARCHAR}
  923. </if>
  924. <if test="deleteSign != null">
  925. and delete_sign = #{deleteSign,jdbcType=INTEGER}
  926. </if>
  927. <if test="salesmanId != null">
  928. and salesman_id = #{salesmanId,jdbcType=VARCHAR}
  929. </if>
  930. <if test="financeId != null">
  931. and finance_id = #{financeId,jdbcType=VARCHAR}
  932. </if>
  933. <if test="technicianId != null">
  934. and technician_id = #{technicianId,jdbcType=VARCHAR}
  935. </if>
  936. <if test="contractNo != null">
  937. and contract_no = #{contractNo,jdbcType=VARCHAR}
  938. </if>
  939. <if test="contractType != null">
  940. and contract_type = #{contractType,jdbcType=VARCHAR}
  941. </if>
  942. <if test="contacts != null">
  943. and contacts = #{contacts,jdbcType=VARCHAR}
  944. </if>
  945. <if test="contactMobile != null">
  946. and contact_mobile = #{contactMobile,jdbcType=VARCHAR}
  947. </if>
  948. <if test="legalPerson != null">
  949. and legal_person = #{legalPerson,jdbcType=VARCHAR}
  950. </if>
  951. <if test="legalPersonTel != null">
  952. and legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR}
  953. </if>
  954. </select>
  955. <!-- 财务专员查看需要待收款的数据 -->
  956. <select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
  957. select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
  958. a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
  959. ifnull(b.amount,0) as actuallyTotalAmount,
  960. o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,
  961. 0 as companyId, "湖南科德信息咨询有限公司" as companyName
  962. from t_order_new o
  963. left join `user` u on o.buyer_id = u.id
  964. left join admin a on o.salesman_id = a.id
  965. left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
  966. group by order_no ) b on b.order_no = o.order_no
  967. where delete_sign = 0
  968. and process_status >= 3
  969. and (approval = 0 or approval = 2)
  970. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  971. <if test='o.orderStatus != null and o.orderStatus != ""'>
  972. and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
  973. </if>
  974. <if test='o.liquidationStatus != null and o.liquidationStatus != ""'>
  975. and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
  976. </if>
  977. <if test='o.liquidationStatus == null or o.liquidationStatus == ""'>
  978. and o.liquidation_status &lt; 2
  979. </if>
  980. <if test='o.orderNo != null and o.orderNo != ""'>
  981. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  982. </if>
  983. <if test='o.buyerName != null and o.buyerName != ""'>
  984. <bind name="n" value="'%' + o.buyerName + '%'"/>
  985. and u.nickname like #{n,jdbcType=VARCHAR}
  986. </if>
  987. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  988. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  989. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  990. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  991. </if>
  992. order by o.liquidation_status, o.sign_time
  993. <if test="page_sql != null">
  994. ${page_sql}
  995. </if>
  996. </select>
  997. <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
  998. select count(*)
  999. from t_order_new o
  1000. left join `user` u on o.buyer_id = u.id
  1001. left join admin a on o.salesman_id = a.id
  1002. left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
  1003. group by order_no ) b on b.order_no = o.order_no
  1004. where delete_sign = 0
  1005. and process_status >= 3
  1006. and (approval = 0 or approval = 2)
  1007. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  1008. <if test='o.orderStatus != null and o.orderStatus != ""'>
  1009. and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
  1010. </if>
  1011. <if test='o.liquidationStatus != null and o.liquidationStatus != ""'>
  1012. and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
  1013. </if>
  1014. <if test='o.liquidationStatus == null or o.liquidationStatus == ""'>
  1015. and o.liquidation_status &lt; 2
  1016. </if>
  1017. <if test='o.orderNo != null and o.orderNo != ""'>
  1018. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  1019. </if>
  1020. <if test='o.buyerName != null and o.buyerName != ""'>
  1021. <bind name="n" value="'%' + o.buyerName + '%'"/>
  1022. and u.nickname like #{n,jdbcType=VARCHAR}
  1023. </if>
  1024. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  1025. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  1026. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  1027. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  1028. </if>
  1029. </select>
  1030. <!-- 通过订单编号获得订单的负责人(营销员) -->
  1031. <select id="getSaleIdByOno" resultType="com.goafanti.order.bo.TOrderNewBo" parameterType="java.lang.String">
  1032. select salesman_id as salesmanId, a.name as salesmanName, a.email ,u.nickname as userName
  1033. from t_order_new o
  1034. left join admin a on o.salesman_id = a.id
  1035. left join `user` u on u.id = o.buyer_id
  1036. where order_no = #{_parameter,jdbcType=VARCHAR}
  1037. </select>
  1038. <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1039. select
  1040. a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,
  1041. b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,a.order_status as orderStatus,
  1042. a.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,d.name as financeName
  1043. <if test="specially == 2">
  1044. ,f.name as initiateName ,e.reason ,date_format(e.create_time,'%Y-%m-%d' ) as backDate,e.id as backId
  1045. </if>
  1046. <if test="specially == 4">
  1047. ,f.name as consultantName
  1048. </if>
  1049. from t_order_new a left join `user` b on a.buyer_id=b.id
  1050. left join admin c on a.salesman_id=c.id
  1051. left join admin d on a.finance_id=d.id
  1052. <if test="specially == 2">
  1053. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1054. left join admin f on e.initiate=f.id
  1055. </if>
  1056. <if test="specially == 4">
  1057. left join (select * from t_order_task where main=1) e on e.order_no=a.order_no
  1058. left join admin f on e.task_receiver=f.id
  1059. </if>
  1060. where a.delete_sign = 0
  1061. <if test="specially == 0">
  1062. and a.order_status not in(3,5,6) and a.approval !=3
  1063. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1064. </if>
  1065. <if test="specially == 1">
  1066. and a.process_status =1 and a.order_status=1
  1067. </if>
  1068. <if test="specially == 2">
  1069. and a.order_status in(3,5)
  1070. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1071. </if>
  1072. <if test="specially == 3">
  1073. and a.approval = 1 and a.order_status=2
  1074. </if>
  1075. <if test="specially == 4">
  1076. and a.process_status in (4,5,6)
  1077. </if>
  1078. <if test="specially == 5">
  1079. and c.department_id=(select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  1080. </if>
  1081. <if test="distribution == 1">
  1082. and a.process_status = 5
  1083. </if>
  1084. <if test="distribution == 2">
  1085. and a.process_status = 6
  1086. </if>
  1087. <if test="name != null">
  1088. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1089. </if>
  1090. <if test="orderNo != null">
  1091. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1092. </if>
  1093. <if test="starTime !=null and endTime !=null">
  1094. and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1095. </if>
  1096. order by a.order_status,a.create_time desc
  1097. <if test="page_sql!=null">
  1098. ${page_sql}
  1099. </if>
  1100. </select>
  1101. <select id="selectOrderNewListCount" resultType="java.lang.Integer">
  1102. select
  1103. count(*)
  1104. from t_order_new a left join `user` b on a.buyer_id=b.id
  1105. left join admin c on a.salesman_id=c.id
  1106. left join admin d on a.finance_id=d.id
  1107. <if test="specially == 2">
  1108. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1109. left join admin f on e.initiate=f.id
  1110. </if>
  1111. <if test="specially == 4">
  1112. left join (select * from t_order_task where main=1) e on e.order_no=a.order_no
  1113. left join admin f on e.task_receiver=f.id
  1114. </if>
  1115. where a.delete_sign = 0
  1116. <if test="specially == 0">
  1117. and a.order_status not in(3,5,6) and a.approval !=3
  1118. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1119. </if>
  1120. <if test="specially == 1">
  1121. and a.process_status =1 and a.order_status=1
  1122. </if>
  1123. <if test="specially == 2">
  1124. and a.order_status in(3,5)
  1125. </if>
  1126. <if test="specially == 3">
  1127. and a.approval = 1 and a.order_status=2
  1128. </if>
  1129. <if test="specially == 4">
  1130. and a.process_status in (4,5,6)
  1131. </if>
  1132. <if test="specially == 5">
  1133. and c.department_id=(select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  1134. </if>
  1135. <if test="distribution == 1">
  1136. and a.process_status = 5
  1137. </if>
  1138. <if test="distribution == 2">
  1139. and a.process_status = 6
  1140. </if>
  1141. <if test="name != null">
  1142. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1143. </if>
  1144. <if test="orderNo != null">
  1145. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1146. </if>
  1147. <if test="starTime !=null and endTime !=null">
  1148. and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1149. </if>
  1150. </select>
  1151. <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1152. select a.id,a.order_no as orderNo,date_format(b.sign_time,'%Y-%m-%d') as signDate,
  1153. c.nickname as userName,b.order_status as orderStatus,b.total_amount as totalAmount,
  1154. b.project_status as projectStatus,b.liquidation_status as liquidationStatus,
  1155. b.settlement_amount as settlementAmount,d.name as salesmanName,a.dun_subject as dunSubject,
  1156. date_format(a.start_time, '%Y-%m-%d') as startDate
  1157. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1158. left join `user` c on b.buyer_id=c.id
  1159. left join admin d on b.salesman_id=d.id
  1160. where a.start_time is not null and b.delete_sign = 0
  1161. <if test="name != null">
  1162. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1163. </if>
  1164. <if test="orderNo != null">
  1165. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1166. </if>
  1167. <if test="starTime !=null and endTime !=null">
  1168. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1169. </if>
  1170. order by b.sign_time desc
  1171. <if test="page_sql!=null">
  1172. ${page_sql}
  1173. </if>
  1174. </select>
  1175. <select id="selectDunOrderNewListCount" resultType="java.lang.Integer">
  1176. select
  1177. count(*)
  1178. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1179. left join `user` c on b.buyer_id=c.id
  1180. where a.start_time is not null and b.delete_sign = 0
  1181. <if test="name != null">
  1182. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1183. </if>
  1184. <if test="orderNo != null">
  1185. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1186. </if>
  1187. <if test="starTime !=null and endTime !=null">
  1188. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1189. </if>
  1190. </select>
  1191. <select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
  1192. select
  1193. a.order_no as orderNo, a.order_type as orderType, a.creater, a.create_time as createTime,a.update_time as updateTime, a.buyer_id as buyerId, a.first_amount as firstAmount,
  1194. a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus,
  1195. a.project_status as projectStatus, a.approval, a.order_remarks as orderRemarks, a.delete_sign as deleteSign, a.salesman_id as salesmanId, finance_id as financeId, technician_id as technicianId,
  1196. a.sign_time as signTime, a.settlement_time as settlementTime, a.contract_no as contractNo, a.contract_type as contractType, a.contacts, a.contact_mobile as contactMobile,
  1197. a.legal_person as legalPerson, a.legal_person_tel as legalPersonTel, a.proof_count as proofCount, a.proof_aid as proofAid,contract_picture_url as contractPictureUrl,
  1198. c.name as salesmanName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
  1199. ,e.back_status as backStatus,f.name as initiateName,e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid
  1200. from t_order_new a
  1201. left join `user` b on a.buyer_id=b.id
  1202. left join admin c on a.salesman_id=c.id
  1203. left join admin d on a.finance_id=d.id
  1204. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1205. left join admin f on e.initiate=f.id
  1206. where a.order_no = #{orderNo,jdbcType=VARCHAR}
  1207. </select>
  1208. <select id="selectOrderRefundListByPage" resultType="com.goafanti.order.bo.TOrderRefundBo">
  1209. select a.id, date_format(a.create_time,'%Y-%m-%d') as createDate,a.order_no as orderNo,
  1210. c.nickname as userName,b.order_status as orderStatus,a.refund_status as refundStatus,
  1211. a.reason,b.liquidation_status as liquidationStatus
  1212. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1213. left join `user` c on b.buyer_id=c.id
  1214. where b.delete_sign = 0 and b.order_status = 6
  1215. <if test="name != null">
  1216. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1217. </if>
  1218. <if test="aid != null">
  1219. and a.initiate = #{aid,jdbcType=VARCHAR}
  1220. </if>
  1221. <if test="orderNo != null">
  1222. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1223. </if>
  1224. <if test="starTime !=null and endTime !=null">
  1225. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1226. </if>
  1227. order by a.create_time desc
  1228. <if test="page_sql!=null">
  1229. ${page_sql}
  1230. </if>
  1231. </select>
  1232. <select id="selectOrderRefundListCount" resultType="java.lang.Integer">
  1233. select
  1234. count(*)
  1235. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1236. left join `user` c on b.buyer_id=c.id
  1237. where b.delete_sign = 0 and b.order_status = 6
  1238. <if test="name != null">
  1239. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1240. </if>
  1241. <if test="aid != null">
  1242. and a.initiate = #{aid,jdbcType=VARCHAR}
  1243. </if>
  1244. <if test="orderNo != null">
  1245. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1246. </if>
  1247. <if test="starTime !=null and endTime !=null">
  1248. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1249. </if>
  1250. </select>
  1251. <!-- 财务同意退款邮件通知需要的数据 -->
  1252. <select id="agreeEmailData" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderNewBo">
  1253. select u.nickname as userName, r.order_no as orderNo, o.order_status as orderStatus, o.salesman_id as salesmanId,
  1254. concat(a.email,"," , ifnull(t.email,"")) as email , concat(a.name,"," , ifnull(t.name,"")) as salesmanName
  1255. from t_order_refund r
  1256. left join t_order_new o on r.order_no = o.order_no
  1257. left join admin a on a.id = o.salesman_id
  1258. left join admin t on t.id = o.technician_id
  1259. left join `user` u on u.id = o.buyer_id
  1260. where r.id = #{id,jdbcType=INTEGER}
  1261. </select>
  1262. <select id="orderRefundDetail" resultType="com.goafanti.order.bo.OrderRefundDetailBo">
  1263. select a.id,date_format(a.create_time,'%Y-%m-%d') as createDate ,a.order_no as orderNo,
  1264. b.order_status as orderStatus,a.refund_status as refundStatus, a.application_url as applicationUrl,
  1265. a.contract_url as contractUrl,a.reason,b.liquidation_status as liquidationStatus
  1266. from t_order_refund a
  1267. left join t_order_new b on a.order_no=b.order_no
  1268. where a.id= #{id,jdbcType=INTEGER}
  1269. </select>
  1270. </mapper>