TOrderNewMapper.xml 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  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. or (approval = 2 and finance_id is null and delete_sign = 0)
  835. <if test='o.orderNo != null and o.orderNo != ""'>
  836. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  837. </if>
  838. <if test='o.financeId != null and o.financeId != ""'>
  839. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  840. </if>
  841. <if test='o.buyerName != null and o.buyerName != ""'>
  842. <bind name="n" value="'%' + o.buyerName + '%'"/>
  843. and u.nickname like #{n,jdbcType=VARCHAR}
  844. </if>
  845. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  846. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  847. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  848. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  849. </if>
  850. <if test="ob == 1">
  851. order by o.sign_time
  852. </if>
  853. <if test="ob == 2">
  854. order by o.liquidation_status,o.sign_time
  855. </if>
  856. <if test="page_sql != null">
  857. ${page_sql}
  858. </if>
  859. </select>
  860. <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
  861. select count(*) from t_order_new o
  862. left join `user` u on o.buyer_id = u.id
  863. left join admin a on o.salesman_id = a.id
  864. where delete_sign = 0
  865. and order_status = 2
  866. <if test="o.processStatus != null">
  867. and process_status = #{o.processStatus,jdbcType=VARCHAR}
  868. </if>
  869. or (approval = 2 and finance_id is null and delete_sign = 0)
  870. <if test='o.orderNo != null and o.orderNo != ""'>
  871. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  872. </if>
  873. <if test='financeId != null and financeId != ""'>
  874. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  875. </if>
  876. <if test='o.buyerName != null and o.buyerName != ""'>
  877. <bind name="n" value="'%' + o.buyerName + '%'"/>
  878. and u.nickname like #{n,jdbcType=VARCHAR}
  879. </if>
  880. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  881. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  882. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  883. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  884. </if>
  885. </select>
  886. <!-- 查看某订单状态是否符合要求 -->
  887. <select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
  888. select count(*) from t_order_new
  889. where order_no = #{orderNo,jdbcType=VARCHAR}
  890. <if test="orderType != null">
  891. and order_type = #{orderType,jdbcType=INTEGER}
  892. </if>
  893. <if test="creater != null">
  894. and creater = #{creater,jdbcType=VARCHAR}
  895. </if>
  896. <if test="buyerId != null">
  897. and buyer_id = #{buyerId,jdbcType=VARCHAR}
  898. </if>
  899. <if test="firstAmount != null">
  900. and first_amount = #{firstAmount,jdbcType=DECIMAL}
  901. </if>
  902. <if test="totalAmount != null">
  903. and total_amount = #{totalAmount,jdbcType=DECIMAL}
  904. </if>
  905. <if test="settlementAmount != null">
  906. and settlement_amount = #{settlementAmount,jdbcType=DECIMAL}
  907. </if>
  908. <if test="orderStatus != null">
  909. and order_status = #{orderStatus,jdbcType=INTEGER}
  910. </if>
  911. <if test="liquidationStatus == 1">
  912. and liquidation_status between 1 and 2
  913. </if>
  914. <if test="processStatus != null">
  915. and process_status = #{processStatus,jdbcType=INTEGER}
  916. </if>
  917. <if test="projectStatus != null">
  918. and project_status = #{projectStatus,jdbcType=INTEGER}
  919. </if>
  920. <if test="approval != null">
  921. and approval = #{approval,jdbcType=INTEGER}
  922. </if>
  923. <if test="orderRemarks != null">
  924. and order_remarks = #{orderRemarks,jdbcType=VARCHAR}
  925. </if>
  926. <if test="deleteSign != null">
  927. and delete_sign = #{deleteSign,jdbcType=INTEGER}
  928. </if>
  929. <if test="salesmanId != null">
  930. and salesman_id = #{salesmanId,jdbcType=VARCHAR}
  931. </if>
  932. <if test="financeId != null">
  933. and finance_id = #{financeId,jdbcType=VARCHAR}
  934. </if>
  935. <if test="technicianId != null">
  936. and technician_id = #{technicianId,jdbcType=VARCHAR}
  937. </if>
  938. <if test="contractNo != null">
  939. and contract_no = #{contractNo,jdbcType=VARCHAR}
  940. </if>
  941. <if test="contractType != null">
  942. and contract_type = #{contractType,jdbcType=VARCHAR}
  943. </if>
  944. <if test="contacts != null">
  945. and contacts = #{contacts,jdbcType=VARCHAR}
  946. </if>
  947. <if test="contactMobile != null">
  948. and contact_mobile = #{contactMobile,jdbcType=VARCHAR}
  949. </if>
  950. <if test="legalPerson != null">
  951. and legal_person = #{legalPerson,jdbcType=VARCHAR}
  952. </if>
  953. <if test="legalPersonTel != null">
  954. and legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR}
  955. </if>
  956. </select>
  957. <!-- 财务专员查看需要待收款的数据 -->
  958. <select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
  959. select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
  960. a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
  961. ifnull(b.amount,0) as actuallyTotalAmount,
  962. o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,
  963. 0 as companyId, "湖南科德信息咨询有限公司" as companyName
  964. from t_order_new o
  965. left join `user` u on o.buyer_id = u.id
  966. left join admin a on o.salesman_id = a.id
  967. left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
  968. group by order_no ) b on b.order_no = o.order_no
  969. where delete_sign = 0
  970. and process_status >= 3
  971. and (approval = 0 or approval = 2)
  972. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  973. <if test='o.orderStatus != null and o.orderStatus != ""'>
  974. and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
  975. </if>
  976. <if test='o.liquidationStatus != null and o.liquidationStatus != ""'>
  977. and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
  978. </if>
  979. <if test='o.liquidationStatus == null or o.liquidationStatus == ""'>
  980. and o.liquidation_status &lt; 2
  981. </if>
  982. <if test='o.orderNo != null and o.orderNo != ""'>
  983. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  984. </if>
  985. <if test='o.buyerName != null and o.buyerName != ""'>
  986. <bind name="n" value="'%' + o.buyerName + '%'"/>
  987. and u.nickname like #{n,jdbcType=VARCHAR}
  988. </if>
  989. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  990. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  991. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  992. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  993. </if>
  994. order by o.liquidation_status, o.sign_time
  995. <if test="page_sql != null">
  996. ${page_sql}
  997. </if>
  998. </select>
  999. <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
  1000. select count(*)
  1001. from t_order_new o
  1002. left join `user` u on o.buyer_id = u.id
  1003. left join admin a on o.salesman_id = a.id
  1004. left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
  1005. group by order_no ) b on b.order_no = o.order_no
  1006. where delete_sign = 0
  1007. and process_status >= 3
  1008. and (approval = 0 or approval = 2)
  1009. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  1010. <if test='o.orderStatus != null and o.orderStatus != ""'>
  1011. and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
  1012. </if>
  1013. <if test='o.liquidationStatus != null and o.liquidationStatus != ""'>
  1014. and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
  1015. </if>
  1016. <if test='o.liquidationStatus == null or o.liquidationStatus == ""'>
  1017. and o.liquidation_status &lt; 2
  1018. </if>
  1019. <if test='o.orderNo != null and o.orderNo != ""'>
  1020. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  1021. </if>
  1022. <if test='o.buyerName != null and o.buyerName != ""'>
  1023. <bind name="n" value="'%' + o.buyerName + '%'"/>
  1024. and u.nickname like #{n,jdbcType=VARCHAR}
  1025. </if>
  1026. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  1027. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  1028. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  1029. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  1030. </if>
  1031. </select>
  1032. <!-- 通过订单编号获得订单的负责人(营销员) -->
  1033. <select id="getSaleIdByOno" resultType="com.goafanti.order.bo.TOrderNewBo" parameterType="java.lang.String">
  1034. select salesman_id as salesmanId, a.name as salesmanName, a.email ,u.nickname as userName
  1035. from t_order_new o
  1036. left join admin a on o.salesman_id = a.id
  1037. left join `user` u on u.id = o.buyer_id
  1038. where order_no = #{_parameter,jdbcType=VARCHAR}
  1039. </select>
  1040. <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1041. select
  1042. a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,
  1043. b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,a.order_status as orderStatus,
  1044. a.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,d.name as financeName
  1045. <if test="specially == 2">
  1046. ,f.name as initiateName ,e.reason ,date_format(e.create_time,'%Y-%m-%d' ) as backDate,e.id as backId
  1047. </if>
  1048. <if test="specially == 4">
  1049. ,f.name as consultantName
  1050. </if>
  1051. from t_order_new a left join `user` b on a.buyer_id=b.id
  1052. left join admin c on a.salesman_id=c.id
  1053. left join admin d on a.finance_id=d.id
  1054. <if test="specially == 2">
  1055. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1056. left join admin f on e.initiate=f.id
  1057. </if>
  1058. <if test="specially == 4">
  1059. left join (select * from t_order_task where main=1) e on e.order_no=a.order_no
  1060. left join admin f on e.task_receiver=f.id
  1061. </if>
  1062. where a.delete_sign = 0
  1063. <if test="specially == 0">
  1064. and a.order_status not in(3,5,6) and a.approval !=3
  1065. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1066. </if>
  1067. <if test="specially == 1">
  1068. and a.process_status =1 and a.order_status=1
  1069. </if>
  1070. <if test="specially == 2">
  1071. and a.order_status in(3,5)
  1072. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1073. </if>
  1074. <if test="specially == 3">
  1075. and a.approval = 1 and a.order_status=2
  1076. </if>
  1077. <if test="specially == 4">
  1078. and a.process_status in (4,5,6)
  1079. and a.order_status not in(5,7)
  1080. </if>
  1081. <if test="specially == 5">
  1082. and c.department_id=(select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  1083. </if>
  1084. <if test="distribution == 0">
  1085. and a.process_status &lt; 5
  1086. </if>
  1087. <if test="distribution == 1">
  1088. and a.process_status = 5
  1089. </if>
  1090. <if test="distribution == 2">
  1091. and a.process_status = 6
  1092. </if>
  1093. <if test="name != null">
  1094. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1095. </if>
  1096. <if test="orderNo != null">
  1097. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1098. </if>
  1099. <if test="starTime !=null and endTime !=null">
  1100. and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1101. </if>
  1102. order by a.order_status,a.create_time desc
  1103. <if test="page_sql!=null">
  1104. ${page_sql}
  1105. </if>
  1106. </select>
  1107. <select id="selectOrderNewListCount" resultType="java.lang.Integer">
  1108. select
  1109. count(*)
  1110. from t_order_new a left join `user` b on a.buyer_id=b.id
  1111. left join admin c on a.salesman_id=c.id
  1112. left join admin d on a.finance_id=d.id
  1113. <if test="specially == 2">
  1114. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1115. left join admin f on e.initiate=f.id
  1116. </if>
  1117. <if test="specially == 4">
  1118. left join (select * from t_order_task where main=1) e on e.order_no=a.order_no
  1119. left join admin f on e.task_receiver=f.id
  1120. </if>
  1121. where a.delete_sign = 0
  1122. <if test="specially == 0">
  1123. and a.order_status not in(3,5,6) and a.approval !=3
  1124. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1125. </if>
  1126. <if test="specially == 1">
  1127. and a.process_status =1 and a.order_status=1
  1128. </if>
  1129. <if test="specially == 2">
  1130. and a.order_status in(3,5)
  1131. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1132. </if>
  1133. <if test="specially == 3">
  1134. and a.approval = 1 and a.order_status=2
  1135. </if>
  1136. <if test="specially == 4">
  1137. and a.process_status in (4,5,6)
  1138. and a.order_status not in(5,7)
  1139. </if>
  1140. <if test="specially == 5">
  1141. and c.department_id=(select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  1142. </if>
  1143. <if test="distribution == 0">
  1144. and a.process_status &lt; 5
  1145. </if>
  1146. <if test="distribution == 1">
  1147. and a.process_status = 5
  1148. </if>
  1149. <if test="distribution == 2">
  1150. and a.process_status = 6
  1151. </if>
  1152. <if test="name != null">
  1153. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1154. </if>
  1155. <if test="orderNo != null">
  1156. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1157. </if>
  1158. <if test="starTime !=null and endTime !=null">
  1159. and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1160. </if>
  1161. </select>
  1162. <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1163. select a.id,a.order_no as orderNo,date_format(b.sign_time,'%Y-%m-%d') as signDate,
  1164. c.nickname as userName,b.order_status as orderStatus,b.total_amount as totalAmount,
  1165. b.project_status as projectStatus,b.liquidation_status as liquidationStatus,
  1166. b.settlement_amount as settlementAmount,d.name as salesmanName,a.dun_subject as dunSubject,
  1167. date_format(a.start_time, '%Y-%m-%d') as startDate
  1168. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1169. left join `user` c on b.buyer_id=c.id
  1170. left join admin d on b.salesman_id=d.id
  1171. where a.start_time is not null and b.delete_sign = 0
  1172. <if test="name != null">
  1173. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1174. </if>
  1175. <if test="orderNo != null">
  1176. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1177. </if>
  1178. <if test="starTime !=null and endTime !=null">
  1179. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1180. </if>
  1181. order by b.sign_time desc
  1182. <if test="page_sql!=null">
  1183. ${page_sql}
  1184. </if>
  1185. </select>
  1186. <select id="selectDunOrderNewListCount" resultType="java.lang.Integer">
  1187. select
  1188. count(*)
  1189. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1190. left join `user` c on b.buyer_id=c.id
  1191. where a.start_time is not null and b.delete_sign = 0
  1192. <if test="name != null">
  1193. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1194. </if>
  1195. <if test="orderNo != null">
  1196. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1197. </if>
  1198. <if test="starTime !=null and endTime !=null">
  1199. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1200. </if>
  1201. </select>
  1202. <select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
  1203. select
  1204. 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,
  1205. a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus,
  1206. 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,
  1207. 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,
  1208. 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,
  1209. c.name as salesmanName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
  1210. ,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
  1211. from t_order_new a
  1212. left join `user` b on a.buyer_id=b.id
  1213. left join admin c on a.salesman_id=c.id
  1214. left join admin d on a.finance_id=d.id
  1215. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1216. left join admin f on e.initiate=f.id
  1217. where a.order_no = #{orderNo,jdbcType=VARCHAR}
  1218. </select>
  1219. <select id="selectOrderRefundListByPage" resultType="com.goafanti.order.bo.TOrderRefundBo">
  1220. select a.id, date_format(a.create_time,'%Y-%m-%d') as createDate,a.order_no as orderNo,
  1221. c.nickname as userName,b.order_status as orderStatus,a.refund_status as refundStatus,
  1222. a.reason,b.liquidation_status as liquidationStatus
  1223. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1224. left join `user` c on b.buyer_id=c.id
  1225. where b.delete_sign = 0
  1226. <if test="name != null">
  1227. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1228. </if>
  1229. <if test="aid != null">
  1230. and a.initiate = #{aid,jdbcType=VARCHAR}
  1231. </if>
  1232. <if test="orderNo != null">
  1233. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1234. </if>
  1235. <if test="starTime !=null and endTime !=null">
  1236. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1237. </if>
  1238. order by a.create_time desc
  1239. <if test="page_sql!=null">
  1240. ${page_sql}
  1241. </if>
  1242. </select>
  1243. <select id="selectOrderRefundListCount" resultType="java.lang.Integer">
  1244. select
  1245. count(*)
  1246. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1247. left join `user` c on b.buyer_id=c.id
  1248. where b.delete_sign = 0
  1249. <if test="name != null">
  1250. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1251. </if>
  1252. <if test="aid != null">
  1253. and a.initiate = #{aid,jdbcType=VARCHAR}
  1254. </if>
  1255. <if test="orderNo != null">
  1256. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1257. </if>
  1258. <if test="starTime !=null and endTime !=null">
  1259. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1260. </if>
  1261. </select>
  1262. <!-- 财务同意退款邮件通知需要的数据 -->
  1263. <select id="agreeEmailData" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderNewBo">
  1264. select u.nickname as userName, r.order_no as orderNo, o.order_status as orderStatus, o.salesman_id as salesmanId,
  1265. concat(a.email,"," , ifnull(t.email,"")) as email , concat(a.name,"," , ifnull(t.name,"")) as salesmanName
  1266. from t_order_refund r
  1267. left join t_order_new o on r.order_no = o.order_no
  1268. left join admin a on a.id = o.salesman_id
  1269. left join admin t on t.id = o.technician_id
  1270. left join `user` u on u.id = o.buyer_id
  1271. where r.id = #{id,jdbcType=INTEGER}
  1272. </select>
  1273. <select id="orderRefundDetail" resultType="com.goafanti.order.bo.OrderRefundDetailBo">
  1274. select a.id,date_format(a.create_time,'%Y-%m-%d') as createDate ,a.order_no as orderNo,
  1275. b.order_status as orderStatus,a.refund_status as refundStatus, a.application_url as applicationUrl,
  1276. a.contract_url as contractUrl,a.reason,b.liquidation_status as liquidationStatus
  1277. from t_order_refund a
  1278. left join t_order_new b on a.order_no=b.order_no
  1279. where a.id= #{id,jdbcType=INTEGER}
  1280. </select>
  1281. </mapper>