TOrderNewMapper.xml 61 KB

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