TOrderNewMapper.xml 74 KB

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