TOrderNewMapper.xml 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472
  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)as 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. and process_status &gt;= 2
  896. <if test="o.processStatus == 2">
  897. and o.finance_id in(null,'')
  898. </if>
  899. <if test="o.processStatus == 3">
  900. and o.finance_id is not null
  901. and o.finance_id != ''
  902. </if>
  903. <if test="o.orderNo != null and o.orderNo != &quot;&quot;">
  904. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  905. </if>
  906. <if test="o.financeId != null and o.financeId != &quot;&quot;">
  907. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  908. </if>
  909. <if test="o.buyerName != null and o.buyerName != &quot;&quot;">
  910. <bind name="n" value="'%' + o.buyerName + '%'" />
  911. and u.nickname like #{n,jdbcType=VARCHAR}
  912. </if>
  913. <if test="o.startTime != null and o.startTime != &quot;&quot; and o.endTime != null and o.endTime != &quot;&quot;">
  914. <bind name="a" value="o.startTime + ' 00:00:00'" />
  915. <bind name="b" value="o.endTime + ' 23:59:59'" />
  916. and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  917. </if>
  918. order by o.process_status,o.create_time desc
  919. <if test="page_sql != null">
  920. ${page_sql}
  921. </if>
  922. </select>
  923. <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
  924. 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
  925. where delete_sign = 0 and order_status = 2 and approval in (0,2) and outsource=#{o.outsource,jdbcType=INTEGER}
  926. and process_status &gt;= 2
  927. <if test="o.processStatus == 2">
  928. and o.finance_id in(null,'')
  929. </if>
  930. <if test="o.processStatus == 3">
  931. and o.finance_id is not null and o.finance_id != ''
  932. </if>
  933. <if test="o.orderNo != null and o.orderNo != &quot;&quot;">
  934. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  935. </if>
  936. <if test="o.financeId != null and o.financeId != &quot;&quot;">
  937. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  938. </if>
  939. <if test="o.buyerName != null and o.buyerName != &quot;&quot;">
  940. <bind name="n" value="'%' + o.buyerName + '%'" />
  941. and u.nickname like #{n,jdbcType=VARCHAR}
  942. </if>
  943. <if test="o.startTime != null and o.startTime != &quot;&quot; and o.endTime != null and o.endTime != &quot;&quot;">
  944. <bind name="a" value="o.startTime + ' 00:00:00'" />
  945. <bind name="b" value="o.endTime + ' 23:59:59'" />
  946. and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  947. </if>
  948. </select>
  949. <!-- 查看某订单状态是否符合要求 -->
  950. <select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
  951. select count(*) from t_order_new
  952. where order_no = #{orderNo,jdbcType=VARCHAR}
  953. <if test="orderType != null">
  954. and order_type = #{orderType,jdbcType=INTEGER}
  955. </if>
  956. <if test="creater != null">
  957. and creater = #{creater,jdbcType=VARCHAR}
  958. </if>
  959. <if test="buyerId != null">
  960. and buyer_id = #{buyerId,jdbcType=VARCHAR}
  961. </if>
  962. <if test="firstAmount != null">
  963. and first_amount = #{firstAmount,jdbcType=DECIMAL}
  964. </if>
  965. <if test="totalAmount != null">
  966. and total_amount = #{totalAmount,jdbcType=DECIMAL}
  967. </if>
  968. <if test="settlementAmount != null">
  969. and settlement_amount = #{settlementAmount,jdbcType=DECIMAL}
  970. </if>
  971. <if test="orderStatus != null">
  972. and order_status = #{orderStatus,jdbcType=INTEGER}
  973. </if>
  974. <if test="liquidationStatus == 1">
  975. and liquidation_status between 1 and 2
  976. </if>
  977. <if test="processStatus != null">
  978. and process_status = #{processStatus,jdbcType=INTEGER}
  979. </if>
  980. <if test="projectStatus != null">
  981. and project_status = #{projectStatus,jdbcType=INTEGER}
  982. </if>
  983. <if test="approval != null">
  984. and approval = #{approval,jdbcType=INTEGER}
  985. </if>
  986. <if test="orderRemarks != null">
  987. and order_remarks = #{orderRemarks,jdbcType=VARCHAR}
  988. </if>
  989. <if test="deleteSign != null">
  990. and delete_sign = #{deleteSign,jdbcType=INTEGER}
  991. </if>
  992. <if test="salesmanId != null">
  993. and salesman_id = #{salesmanId,jdbcType=VARCHAR}
  994. </if>
  995. <if test="financeId != null">
  996. and finance_id = #{financeId,jdbcType=VARCHAR}
  997. </if>
  998. <if test="technicianId != null">
  999. and technician_id = #{technicianId,jdbcType=VARCHAR}
  1000. </if>
  1001. <if test="contractNo != null">
  1002. and contract_no = #{contractNo,jdbcType=VARCHAR}
  1003. </if>
  1004. <if test="contractType != null">
  1005. and contract_type = #{contractType,jdbcType=VARCHAR}
  1006. </if>
  1007. <if test="contacts != null">
  1008. and contacts = #{contacts,jdbcType=VARCHAR}
  1009. </if>
  1010. <if test="contactMobile != null">
  1011. and contact_mobile = #{contactMobile,jdbcType=VARCHAR}
  1012. </if>
  1013. <if test="legalPerson != null">
  1014. and legal_person = #{legalPerson,jdbcType=VARCHAR}
  1015. </if>
  1016. <if test="legalPersonTel != null">
  1017. and legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR}
  1018. </if>
  1019. </select>
  1020. <!-- 财务专员查看需要待收款的数据 -->
  1021. <select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
  1022. select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
  1023. o.process_status as processStatus,ifnull(b.amount,0) as actuallyTotalAmount, o.contract_no as contractNo,o.approval,
  1024. a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
  1025. o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,o.create_time as createTime,e.name as outsourceName,
  1026. 0 as companyId, "湖南科德信息咨询有限公司" as companyName,d.name as departmentName from t_order_new o left join department d
  1027. 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
  1028. (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
  1029. left join (select order_no,max(name) as name from outsource_organization group by order_no) e
  1030. on o.order_no=e.order_no where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
  1031. <if test="o.processStatus == 3">
  1032. and process_status = #{o.processStatus,jdbcType=INTEGER}
  1033. </if>
  1034. <if test="o.processStatus == 4">
  1035. and process_status &gt;= #{o.processStatus,jdbcType=INTEGER}
  1036. </if>
  1037. and process_status
  1038. and (approval = 0 or approval = 2)
  1039. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  1040. <if test="o.orderStatus != null and o.orderStatus != &quot;&quot;">
  1041. and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
  1042. </if>
  1043. <if test="o.departmentId != null and o.departmentId != &quot;&quot;">
  1044. and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
  1045. </if>
  1046. <if test="o.liquidationStatus != null and o.liquidationStatus != &quot;&quot;">
  1047. and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
  1048. </if>
  1049. <if test="o.orderNo != null and o.orderNo != &quot;&quot;">
  1050. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  1051. </if>
  1052. <if test="o.buyerName != null and o.buyerName != &quot;&quot;">
  1053. <bind name="n" value="'%' + o.buyerName + '%'" />
  1054. and u.nickname like #{n,jdbcType=VARCHAR}
  1055. </if>
  1056. <if test="o.startTime != null and o.startTime != &quot;&quot; and o.endTime != null and o.endTime != &quot;&quot;">
  1057. <bind name="a" value="o.startTime + ' 00:00:00'" />
  1058. <bind name="b" value="o.endTime + ' 23:59:59'" />
  1059. and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  1060. </if>
  1061. order by o.liquidation_status, o.sign_time desc
  1062. <if test="page_sql != null">
  1063. ${page_sql}
  1064. </if>
  1065. </select>
  1066. <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
  1067. select count(*)
  1068. from t_order_new o
  1069. left join `user` u on o.buyer_id = u.id
  1070. left join admin a on o.salesman_id = a.id
  1071. left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
  1072. group by order_no ) b on b.order_no = o.order_no
  1073. where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
  1074. <if test="o.processStatus == 3">
  1075. and process_status = #{o.processStatus,jdbcType=INTEGER}
  1076. </if>
  1077. <if test="o.processStatus == 4">
  1078. and process_status &gt;= #{o.processStatus,jdbcType=INTEGER}
  1079. </if>
  1080. and (approval = 0 or approval = 2)
  1081. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  1082. <if test="o.orderStatus != null and o.orderStatus != &quot;&quot;">
  1083. and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
  1084. </if>
  1085. <if test="o.departmentId != null and o.departmentId != &quot;&quot;">
  1086. and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
  1087. </if>
  1088. <if test="o.liquidationStatus != null and o.liquidationStatus != &quot;&quot;">
  1089. and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
  1090. </if>
  1091. <if test="o.orderNo != null and o.orderNo != &quot;&quot;">
  1092. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  1093. </if>
  1094. <if test="o.buyerName != null and o.buyerName != &quot;&quot;">
  1095. <bind name="n" value="'%' + o.buyerName + '%'" />
  1096. and u.nickname like #{n,jdbcType=VARCHAR}
  1097. </if>
  1098. <if test="o.startTime != null and o.startTime != &quot;&quot; and o.endTime != null and o.endTime != &quot;&quot;">
  1099. <bind name="a" value="o.startTime + ' 00:00:00'" />
  1100. <bind name="b" value="o.endTime + ' 23:59:59'" />
  1101. and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  1102. </if>
  1103. </select>
  1104. <!-- 通过订单编号获得订单的负责人(营销员) -->
  1105. <select id="getSaleIdByOno" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
  1106. select salesman_id as salesmanId, a.name as salesmanName, a.email ,u.nickname as userName
  1107. from t_order_new o
  1108. left join admin a on o.salesman_id = a.id
  1109. left join `user` u on u.id = o.buyer_id
  1110. where order_no = #{_parameter,jdbcType=VARCHAR}
  1111. </select>
  1112. <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1113. select
  1114. 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,
  1115. b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,a.order_status as orderStatus,
  1116. a.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,dep.name as depName,d.name as financeName
  1117. <if test="specially == 2">
  1118. ,f.name as initiateName ,e.reason ,date_format(e.create_time,'%Y-%m-%d' ) as backDate,e.id as backId
  1119. </if>
  1120. <if test="specially == 4">
  1121. ,f.name as consultantName,a.settlement_amount as settlementAmount
  1122. </if>
  1123. from t_order_new a left join `user` b on a.buyer_id=b.id
  1124. left join admin c on a.salesman_id=c.id
  1125. left join department dep on a.order_dep=dep.id
  1126. left join admin d on a.finance_id=d.id
  1127. <if test="specially == 2">
  1128. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1129. left join admin f on e.initiate=f.id
  1130. </if>
  1131. <if test="specially == 4">
  1132. left join (select * from t_order_task
  1133. where super_id is null ) e on e.order_no=a.order_no
  1134. left join admin f on e.task_receiver=f.id
  1135. </if>
  1136. where a.delete_sign = 0
  1137. and a.outsource= #{outsource,jdbcType=INTEGER}
  1138. <if test="specially == 0">
  1139. and a.order_status not in(3,5,6,7) and a.approval !=3
  1140. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1141. </if>
  1142. <if test="specially == 1">
  1143. and a.process_status =1 and a.order_status=1
  1144. <!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
  1145. and c.department_id in
  1146. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  1147. #{deps.id}
  1148. </foreach>
  1149. </if>
  1150. <if test="specially == 2">
  1151. and a.order_status in(3,5)
  1152. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1153. </if>
  1154. <if test="specially == 3">
  1155. and a.approval = 1 and a.order_status=2
  1156. </if>
  1157. <if test="specially == 4">
  1158. and e.main=1
  1159. and a.process_status in (4,5,6,99)
  1160. and a.order_status not in(5,7)
  1161. </if>
  1162. <if test="specially == 5">
  1163. and c.department_id in
  1164. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  1165. #{deps.id}
  1166. </foreach>
  1167. </if>
  1168. <if test="distribution == 0">
  1169. and a.process_status &lt; 5
  1170. </if>
  1171. <if test="distribution == 1">
  1172. and a.process_status = 5
  1173. </if>
  1174. <if test="distribution == 2">
  1175. and a.process_status = 6
  1176. </if>
  1177. <if test="name != null">
  1178. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1179. </if>
  1180. <if test="orderNo != null">
  1181. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1182. </if>
  1183. <if test="depId != null">
  1184. and dep.id = #{depId,jdbcType=VARCHAR}
  1185. </if>
  1186. <if test="starTime !=null and endTime !=null">
  1187. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1188. </if>
  1189. order by
  1190. <if test="specially == 4">
  1191. a.process_status,
  1192. </if>
  1193. <if test="specially != 4">
  1194. a.order_status,
  1195. </if>
  1196. a.create_time
  1197. <if test="specially != 4">
  1198. desc
  1199. </if>
  1200. <if test="page_sql!=null">
  1201. ${page_sql}
  1202. </if>
  1203. </select>
  1204. <select id="selectOrderNewListCount" resultType="java.lang.Integer">
  1205. select
  1206. count(*)
  1207. from t_order_new a left join `user` b on a.buyer_id=b.id
  1208. left join admin c on a.salesman_id=c.id
  1209. left join department dep on a.order_dep=dep.id
  1210. left join admin d on a.finance_id=d.id
  1211. <if test="specially == 2">
  1212. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1213. left join admin f on e.initiate=f.id
  1214. </if>
  1215. <if test="specially == 4">
  1216. left join (select * from t_order_task
  1217. where super_id is null ) e on e.order_no=a.order_no
  1218. left join admin f on e.task_receiver=f.id
  1219. </if>
  1220. where a.delete_sign = 0
  1221. and a.outsource= #{outsource,jdbcType=INTEGER}
  1222. <if test="specially == 0">
  1223. and a.order_status not in(3,5,6,7) and a.approval !=3
  1224. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1225. </if>
  1226. <if test="specially == 1">
  1227. and a.process_status =1 and a.order_status=1
  1228. and c.department_id in
  1229. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  1230. #{deps.id}
  1231. </foreach>
  1232. </if>
  1233. <if test="specially == 2">
  1234. and a.order_status in(3,5)
  1235. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1236. </if>
  1237. <if test="specially == 3">
  1238. and a.approval = 1 and a.order_status=2
  1239. </if>
  1240. <if test="specially == 4">
  1241. and e.main=1
  1242. and a.process_status in (4,5,6,99)
  1243. and a.order_status not in(5,7)
  1244. </if>
  1245. <if test="specially == 5">
  1246. and c.department_id in
  1247. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  1248. #{deps.id}
  1249. </foreach>
  1250. </if>
  1251. <if test="distribution == 0">
  1252. and a.process_status &lt; 5
  1253. </if>
  1254. <if test="distribution == 1">
  1255. and a.process_status = 5
  1256. </if>
  1257. <if test="distribution == 2">
  1258. and a.process_status = 6
  1259. </if>
  1260. <if test="name != null">
  1261. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1262. </if>
  1263. <if test="orderNo != null">
  1264. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1265. </if>
  1266. <if test="depId != null">
  1267. and dep.id = #{depId,jdbcType=VARCHAR}
  1268. </if>
  1269. <if test="starTime !=null and endTime !=null">
  1270. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1271. </if>
  1272. </select>
  1273. <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1274. select a.id,a.order_no as orderNo,date_format(b.sign_time,'%Y-%m-%d') as signDate,
  1275. c.nickname as userName,b.order_status as orderStatus,b.total_amount as totalAmount,
  1276. b.project_status as projectStatus,b.liquidation_status as liquidationStatus,
  1277. b.settlement_amount as settlementAmount,d.name as salesmanName,a.dun_subject as dunSubject,
  1278. date_format(a.start_time, '%Y-%m-%d') as startDate,dep.name as depName,
  1279. a.money as accountsReceivable,if((a.money-b.settlement_amount) &lt; 1,0,(a.money-b.settlement_amount)) as uncollectedAmount
  1280. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1281. left join `user` c on b.buyer_id=c.id
  1282. left join admin d on b.salesman_id=d.id
  1283. left join department dep on d.department_id=dep.id
  1284. where a.start_time is not null and b.delete_sign = 0
  1285. <if test="name != null">
  1286. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1287. </if>
  1288. <if test="adminName != null">
  1289. and d.name like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
  1290. </if>
  1291. <if test="orderNo != null">
  1292. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1293. </if>
  1294. <if test="depId != null">
  1295. and dep.id= #{depId,jdbcType=VARCHAR}
  1296. </if>
  1297. <if test="aid != null">
  1298. and c.aid= #{aid,jdbcType=VARCHAR}
  1299. </if>
  1300. <if test="starTime !=null and endTime !=null">
  1301. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1302. </if>
  1303. order by b.sign_time desc
  1304. <if test="page_sql!=null">
  1305. ${page_sql}
  1306. </if>
  1307. </select>
  1308. <select id="selectDunOrderNewListCount" resultType="java.lang.Integer">
  1309. select
  1310. count(*)
  1311. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1312. left join `user` c on b.buyer_id=c.id
  1313. where a.start_time is not null and b.delete_sign = 0
  1314. <if test="name != null">
  1315. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1316. </if>
  1317. <if test="adminName != null">
  1318. and d.name like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
  1319. </if>
  1320. <if test="depId != null">
  1321. and dep.id= #{depId,jdbcType=VARCHAR}
  1322. </if>
  1323. <if test="orderNo != null">
  1324. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1325. </if>
  1326. <if test="aid != null">
  1327. and c.aid= #{aid,jdbcType=VARCHAR}
  1328. </if>
  1329. <if test="starTime !=null and endTime !=null">
  1330. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1331. </if>
  1332. </select>
  1333. <select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
  1334. select
  1335. 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,
  1336. a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus,
  1337. 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,
  1338. 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,
  1339. 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,
  1340. 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
  1341. ,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,
  1342. g.location_province as locationProvince,g.location_city as locationCity,g.location_area locationArea,g.postal_address postalAddress
  1343. 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
  1344. left join department dep on a.order_dep=dep.id left join admin d on a.finance_id=d.id
  1345. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1346. left join admin f on e.initiate=f.id left join organization_identity g on a.buyer_id=g.uid
  1347. where a.order_no = #{orderNo,jdbcType=VARCHAR}
  1348. </select>
  1349. <select id="selectOrderRefundListByPage" resultType="com.goafanti.order.bo.TOrderRefundBo">
  1350. select a.id, date_format(a.create_time,'%Y-%m-%d') as createDate,a.order_no as orderNo,
  1351. c.nickname as userName,b.order_status as orderStatus,a.refund_status as refundStatus,
  1352. a.reason,b.liquidation_status as liquidationStatus
  1353. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1354. left join `user` c on b.buyer_id=c.id
  1355. where b.delete_sign = 0
  1356. <if test="name != null">
  1357. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1358. </if>
  1359. <if test="aid != null">
  1360. and a.initiate = #{aid,jdbcType=VARCHAR}
  1361. </if>
  1362. <if test="orderNo != null">
  1363. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1364. </if>
  1365. <if test="starTime !=null and endTime !=null">
  1366. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1367. </if>
  1368. order by a.create_time desc
  1369. <if test="page_sql!=null">
  1370. ${page_sql}
  1371. </if>
  1372. </select>
  1373. <select id="selectOrderRefundListCount" resultType="java.lang.Integer">
  1374. select
  1375. count(*)
  1376. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1377. left join `user` c on b.buyer_id=c.id
  1378. where b.delete_sign = 0
  1379. <if test="name != null">
  1380. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1381. </if>
  1382. <if test="aid != null">
  1383. and a.initiate = #{aid,jdbcType=VARCHAR}
  1384. </if>
  1385. <if test="orderNo != null">
  1386. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1387. </if>
  1388. <if test="starTime !=null and endTime !=null">
  1389. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1390. </if>
  1391. </select>
  1392. <!-- 财务同意退款邮件通知需要的数据 -->
  1393. <select id="agreeEmailData" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderNewBo">
  1394. 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,
  1395. concat(a.email,"," , ifnull(t.email,"")) as email , concat(a.name,"," , ifnull(t.name,"")) as salesmanName
  1396. from t_order_refund r
  1397. left join t_order_new o on r.order_no = o.order_no
  1398. left join admin a on a.id = o.salesman_id
  1399. left join admin t on t.id = o.technician_id
  1400. left join `user` u on u.id = o.buyer_id
  1401. where r.id = #{id,jdbcType=INTEGER}
  1402. </select>
  1403. <select id="orderRefundDetail" resultType="com.goafanti.order.bo.OrderRefundDetailBo">
  1404. select a.id,date_format(a.create_time,'%Y-%m-%d') as createDate ,a.order_no as orderNo,
  1405. b.order_status as orderStatus,a.refund_status as refundStatus, a.application_url as applicationUrl,
  1406. a.contract_url as contractUrl,a.reason,b.liquidation_status as liquidationStatus
  1407. from t_order_refund a
  1408. left join t_order_new b on a.order_no=b.order_no
  1409. where a.id= #{id,jdbcType=INTEGER}
  1410. </select>
  1411. <update id="updateFinance" parameterType="string">
  1412. update t_order_new set finance_id= #{newFinance,jdbcType=VARCHAR}
  1413. where order_no= #{orderNo,jdbcType=VARCHAR}
  1414. and finance_id= #{aid,jdbcType=VARCHAR}
  1415. </update>
  1416. <select id="checkContractNo" resultType="java.lang.Integer">
  1417. select count(contract_no) from t_order_new
  1418. where contract_no= #{0}
  1419. </select>
  1420. <select id="orderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
  1421. select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,
  1422. date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
  1423. b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,f.name financeName
  1424. from t_order_outsource a
  1425. left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
  1426. left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
  1427. left join admin f on b.finance_id=f.id
  1428. where 1=1
  1429. <if test="refundStatus != null">
  1430. and a.refund_status= #{refundStatus}
  1431. </if>
  1432. <if test="contractNo != null">
  1433. and b.contract_no like concat('%',#{contractNo},'%')
  1434. </if>
  1435. <if test="name != null">
  1436. and c.nickname like concat('%',#{name},'%')
  1437. </if>
  1438. <if test="startTime != null and endTime != null">
  1439. and b.create_time between #{startTime} and #{endTime}
  1440. </if>
  1441. order by b.create_time desc
  1442. <if test="page_sql!=null">
  1443. ${page_sql}
  1444. </if>
  1445. </select>
  1446. <select id="orderOutsourceCount" resultType="java.lang.Integer">
  1447. select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no
  1448. left join `user` c on b.buyer_id=c.id where 1=1
  1449. <if test="refundStatus != null">
  1450. and a.refund_status= #{refundStatus}
  1451. </if>
  1452. <if test="contractNo != null">
  1453. and b.contract_no like concat('%',#{contractNo},'%')
  1454. </if>
  1455. <if test="name != null">
  1456. and c.nickname like concat('%',#{name},'%')
  1457. </if>
  1458. <if test="starTime != null and endTime != null">
  1459. and b.create_time between #{starTime} and #{endTime}
  1460. </if>
  1461. </select>
  1462. </mapper>