TOrderNewMapper.xml 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289
  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(3,5)
  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. </if>
  1139. <if test="specially == 5">
  1140. and c.department_id=(select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  1141. </if>
  1142. <if test="distribution == 0">
  1143. and a.process_status &lt; 5
  1144. </if>
  1145. <if test="distribution == 1">
  1146. and a.process_status = 5
  1147. </if>
  1148. <if test="distribution == 2">
  1149. and a.process_status = 6
  1150. </if>
  1151. <if test="name != null">
  1152. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1153. </if>
  1154. <if test="orderNo != null">
  1155. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1156. </if>
  1157. <if test="starTime !=null and endTime !=null">
  1158. and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1159. </if>
  1160. </select>
  1161. <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1162. select a.id,a.order_no as orderNo,date_format(b.sign_time,'%Y-%m-%d') as signDate,
  1163. c.nickname as userName,b.order_status as orderStatus,b.total_amount as totalAmount,
  1164. b.project_status as projectStatus,b.liquidation_status as liquidationStatus,
  1165. b.settlement_amount as settlementAmount,d.name as salesmanName,a.dun_subject as dunSubject,
  1166. date_format(a.start_time, '%Y-%m-%d') as startDate
  1167. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1168. left join `user` c on b.buyer_id=c.id
  1169. left join admin d on b.salesman_id=d.id
  1170. where a.start_time is not null and b.delete_sign = 0
  1171. <if test="name != null">
  1172. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1173. </if>
  1174. <if test="orderNo != null">
  1175. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1176. </if>
  1177. <if test="starTime !=null and endTime !=null">
  1178. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1179. </if>
  1180. order by b.sign_time desc
  1181. <if test="page_sql!=null">
  1182. ${page_sql}
  1183. </if>
  1184. </select>
  1185. <select id="selectDunOrderNewListCount" resultType="java.lang.Integer">
  1186. select
  1187. count(*)
  1188. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1189. left join `user` c on b.buyer_id=c.id
  1190. where a.start_time is not null and b.delete_sign = 0
  1191. <if test="name != null">
  1192. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1193. </if>
  1194. <if test="orderNo != null">
  1195. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1196. </if>
  1197. <if test="starTime !=null and endTime !=null">
  1198. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1199. </if>
  1200. </select>
  1201. <select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
  1202. select
  1203. 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,
  1204. a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus,
  1205. 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,
  1206. 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,
  1207. 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,
  1208. c.name as salesmanName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
  1209. ,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
  1210. from t_order_new a
  1211. left join `user` b on a.buyer_id=b.id
  1212. left join admin c on a.salesman_id=c.id
  1213. left join admin d on a.finance_id=d.id
  1214. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1215. left join admin f on e.initiate=f.id
  1216. where a.order_no = #{orderNo,jdbcType=VARCHAR}
  1217. </select>
  1218. <select id="selectOrderRefundListByPage" resultType="com.goafanti.order.bo.TOrderRefundBo">
  1219. select a.id, date_format(a.create_time,'%Y-%m-%d') as createDate,a.order_no as orderNo,
  1220. c.nickname as userName,b.order_status as orderStatus,a.refund_status as refundStatus,
  1221. a.reason,b.liquidation_status as liquidationStatus
  1222. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1223. left join `user` c on b.buyer_id=c.id
  1224. where b.delete_sign = 0
  1225. <if test="name != null">
  1226. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1227. </if>
  1228. <if test="aid != null">
  1229. and a.initiate = #{aid,jdbcType=VARCHAR}
  1230. </if>
  1231. <if test="orderNo != null">
  1232. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1233. </if>
  1234. <if test="starTime !=null and endTime !=null">
  1235. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1236. </if>
  1237. order by a.create_time desc
  1238. <if test="page_sql!=null">
  1239. ${page_sql}
  1240. </if>
  1241. </select>
  1242. <select id="selectOrderRefundListCount" resultType="java.lang.Integer">
  1243. select
  1244. count(*)
  1245. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1246. left join `user` c on b.buyer_id=c.id
  1247. where b.delete_sign = 0
  1248. <if test="name != null">
  1249. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1250. </if>
  1251. <if test="aid != null">
  1252. and a.initiate = #{aid,jdbcType=VARCHAR}
  1253. </if>
  1254. <if test="orderNo != null">
  1255. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1256. </if>
  1257. <if test="starTime !=null and endTime !=null">
  1258. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1259. </if>
  1260. </select>
  1261. <!-- 财务同意退款邮件通知需要的数据 -->
  1262. <select id="agreeEmailData" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderNewBo">
  1263. select u.nickname as userName, r.order_no as orderNo, o.order_status as orderStatus, o.salesman_id as salesmanId,
  1264. concat(a.email,"," , ifnull(t.email,"")) as email , concat(a.name,"," , ifnull(t.name,"")) as salesmanName
  1265. from t_order_refund r
  1266. left join t_order_new o on r.order_no = o.order_no
  1267. left join admin a on a.id = o.salesman_id
  1268. left join admin t on t.id = o.technician_id
  1269. left join `user` u on u.id = o.buyer_id
  1270. where r.id = #{id,jdbcType=INTEGER}
  1271. </select>
  1272. <select id="orderRefundDetail" resultType="com.goafanti.order.bo.OrderRefundDetailBo">
  1273. select a.id,date_format(a.create_time,'%Y-%m-%d') as createDate ,a.order_no as orderNo,
  1274. b.order_status as orderStatus,a.refund_status as refundStatus, a.application_url as applicationUrl,
  1275. a.contract_url as contractUrl,a.reason,b.liquidation_status as liquidationStatus
  1276. from t_order_refund a
  1277. left join t_order_new b on a.order_no=b.order_no
  1278. where a.id= #{id,jdbcType=INTEGER}
  1279. </select>
  1280. </mapper>