TOrderNewMapper.xml 75 KB

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