TOrderMapper.xml 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739
  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.TOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrder">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  9. -->
  10. <id column="order_no" jdbcType="VARCHAR" property="orderNo" />
  11. <result column="order_type" jdbcType="INTEGER" property="orderType" />
  12. <result column="creater" jdbcType="VARCHAR" property="creater" />
  13. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  14. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  15. <result column="buyer_id" jdbcType="VARCHAR" property="buyerId" />
  16. <result column="seller_id" jdbcType="VARCHAR" property="sellerId" />
  17. <result column="first_payment" jdbcType="DECIMAL" property="firstPayment" />
  18. <result column="order_amount" jdbcType="DECIMAL" property="orderAmount" />
  19. <result column="brokerage_amount" jdbcType="DECIMAL" property="brokerageAmount" />
  20. <result column="sign_first_payment" jdbcType="DECIMAL" property="signFirstPayment" />
  21. <result column="actually_first_payment" jdbcType="DECIMAL" property="actuallyFirstPayment" />
  22. <result column="sign_total_amount" jdbcType="DECIMAL" property="signTotalAmount" />
  23. <result column="actually_total_amount" jdbcType="DECIMAL" property="actuallyTotalAmount" />
  24. <result column="sign_brokerage_amount" jdbcType="DECIMAL" property="signBrokerageAmount" />
  25. <result column="actually_brokerage_amount" jdbcType="DECIMAL" property="actuallyBrokerageAmount" />
  26. <result column="sign_withdraw_amount" jdbcType="DECIMAL" property="signWithdrawAmount" />
  27. <result column="actually_withdraw_amount" jdbcType="DECIMAL" property="actuallyWithdrawAmount" />
  28. <result column="order_stage" jdbcType="INTEGER" property="orderStage" />
  29. <result column="project_stage" jdbcType="INTEGER" property="projectStage" />
  30. <result column="order_status" jdbcType="INTEGER" property="orderStatus" />
  31. <result column="liquidation_status" jdbcType="INTEGER" property="liquidationStatus" />
  32. <result column="order_channel" jdbcType="INTEGER" property="orderChannel" />
  33. <result column="approval" jdbcType="INTEGER" property="approval" />
  34. <result column="order_remarks" jdbcType="VARCHAR" property="orderRemarks" />
  35. <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
  36. <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
  37. <result column="finance_id" jdbcType="VARCHAR" property="financeId" />
  38. <result column="technician_id" jdbcType="VARCHAR" property="technicianId" />
  39. <result column="confirm_time" jdbcType="TIMESTAMP" property="confirmTime" />
  40. <result column="sign_time" jdbcType="TIMESTAMP" property="signTime" />
  41. <result column="set_up_time" jdbcType="TIMESTAMP" property="setUpTime" />
  42. <result column="settlement_time" jdbcType="TIMESTAMP" property="settlementTime" />
  43. <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
  44. <result column="contract_type" jdbcType="VARCHAR" property="contractType" />
  45. <result column="change_status" jdbcType="INTEGER" property="changeStatus" />
  46. </resultMap>
  47. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrder">
  48. <!--
  49. WARNING - @mbg.generated
  50. This element is automatically generated by MyBatis Generator, do not modify.
  51. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  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 Wed Apr 11 14:30:55 CST 2018.
  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 Wed Apr 11 14:30:55 CST 2018.
  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 Wed Apr 11 14:30:55 CST 2018.
  128. -->
  129. order_no, order_type, creater, create_time, update_time, buyer_id, seller_id, first_payment,
  130. order_amount, brokerage_amount, sign_first_payment, actually_first_payment, sign_total_amount,
  131. actually_total_amount, sign_brokerage_amount, actually_brokerage_amount, sign_withdraw_amount,
  132. actually_withdraw_amount, order_stage, project_stage, order_status, liquidation_status,
  133. order_channel, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id,
  134. confirm_time, sign_time, set_up_time, settlement_time, contract_no, contract_type,
  135. change_status
  136. </sql>
  137. <sql id="Blob_Column_List">
  138. <!--
  139. WARNING - @mbg.generated
  140. This element is automatically generated by MyBatis Generator, do not modify.
  141. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  142. -->
  143. contract_picture_url
  144. </sql>
  145. <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.TOrderExample" resultMap="ResultMapWithBLOBs">
  146. <!--
  147. WARNING - @mbg.generated
  148. This element is automatically generated by MyBatis Generator, do not modify.
  149. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  150. -->
  151. select
  152. <if test="distinct">
  153. distinct
  154. </if>
  155. <include refid="Base_Column_List" />
  156. ,
  157. <include refid="Blob_Column_List" />
  158. from t_order
  159. <if test="_parameter != null">
  160. <include refid="Example_Where_Clause" />
  161. </if>
  162. <if test="orderByClause != null">
  163. order by ${orderByClause}
  164. </if>
  165. </select>
  166. <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderExample" resultMap="BaseResultMap">
  167. <!--
  168. WARNING - @mbg.generated
  169. This element is automatically generated by MyBatis Generator, do not modify.
  170. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  171. -->
  172. select
  173. <if test="distinct">
  174. distinct
  175. </if>
  176. <include refid="Base_Column_List" />
  177. from t_order
  178. <if test="_parameter != null">
  179. <include refid="Example_Where_Clause" />
  180. </if>
  181. <if test="orderByClause != null">
  182. order by ${orderByClause}
  183. </if>
  184. </select>
  185. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
  186. <!--
  187. WARNING - @mbg.generated
  188. This element is automatically generated by MyBatis Generator, do not modify.
  189. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  190. -->
  191. select
  192. <include refid="Base_Column_List" />
  193. ,
  194. <include refid="Blob_Column_List" />
  195. from t_order
  196. where order_no = #{orderNo,jdbcType=VARCHAR}
  197. </select>
  198. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  199. <!--
  200. WARNING - @mbg.generated
  201. This element is automatically generated by MyBatis Generator, do not modify.
  202. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  203. -->
  204. delete from t_order
  205. where order_no = #{orderNo,jdbcType=VARCHAR}
  206. </delete>
  207. <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderExample">
  208. <!--
  209. WARNING - @mbg.generated
  210. This element is automatically generated by MyBatis Generator, do not modify.
  211. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  212. -->
  213. delete from t_order
  214. <if test="_parameter != null">
  215. <include refid="Example_Where_Clause" />
  216. </if>
  217. </delete>
  218. <insert id="insert" parameterType="com.goafanti.common.model.TOrder">
  219. <!--
  220. WARNING - @mbg.generated
  221. This element is automatically generated by MyBatis Generator, do not modify.
  222. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  223. -->
  224. insert into t_order (order_no, order_type, creater,
  225. create_time, update_time, buyer_id,
  226. seller_id, first_payment, order_amount,
  227. brokerage_amount, sign_first_payment, actually_first_payment,
  228. sign_total_amount, actually_total_amount, sign_brokerage_amount,
  229. actually_brokerage_amount, sign_withdraw_amount,
  230. actually_withdraw_amount, order_stage, project_stage,
  231. order_status, liquidation_status, order_channel,
  232. approval, order_remarks, delete_sign,
  233. salesman_id, finance_id, technician_id,
  234. confirm_time, sign_time, set_up_time,
  235. settlement_time, contract_no, contract_type,
  236. change_status, contract_picture_url)
  237. values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR},
  238. #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR},
  239. #{sellerId,jdbcType=VARCHAR}, #{firstPayment,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL},
  240. #{brokerageAmount,jdbcType=DECIMAL}, #{signFirstPayment,jdbcType=DECIMAL}, #{actuallyFirstPayment,jdbcType=DECIMAL},
  241. #{signTotalAmount,jdbcType=DECIMAL}, #{actuallyTotalAmount,jdbcType=DECIMAL}, #{signBrokerageAmount,jdbcType=DECIMAL},
  242. #{actuallyBrokerageAmount,jdbcType=DECIMAL}, #{signWithdrawAmount,jdbcType=DECIMAL},
  243. #{actuallyWithdrawAmount,jdbcType=DECIMAL}, #{orderStage,jdbcType=INTEGER}, #{projectStage,jdbcType=INTEGER},
  244. #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{orderChannel,jdbcType=INTEGER},
  245. #{approval,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER},
  246. #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR},
  247. #{confirmTime,jdbcType=TIMESTAMP}, #{signTime,jdbcType=TIMESTAMP}, #{setUpTime,jdbcType=TIMESTAMP},
  248. #{settlementTime,jdbcType=TIMESTAMP}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
  249. #{changeStatus,jdbcType=INTEGER}, #{contractPictureUrl,jdbcType=LONGVARCHAR})
  250. </insert>
  251. <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrder">
  252. <!--
  253. WARNING - @mbg.generated
  254. This element is automatically generated by MyBatis Generator, do not modify.
  255. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  256. -->
  257. insert into t_order
  258. <trim prefix="(" suffix=")" suffixOverrides=",">
  259. <if test="orderNo != null">
  260. order_no,
  261. </if>
  262. <if test="orderType != null">
  263. order_type,
  264. </if>
  265. <if test="creater != null">
  266. creater,
  267. </if>
  268. <if test="createTime != null">
  269. create_time,
  270. </if>
  271. <if test="updateTime != null">
  272. update_time,
  273. </if>
  274. <if test="buyerId != null">
  275. buyer_id,
  276. </if>
  277. <if test="sellerId != null">
  278. seller_id,
  279. </if>
  280. <if test="firstPayment != null">
  281. first_payment,
  282. </if>
  283. <if test="orderAmount != null">
  284. order_amount,
  285. </if>
  286. <if test="brokerageAmount != null">
  287. brokerage_amount,
  288. </if>
  289. <if test="signFirstPayment != null">
  290. sign_first_payment,
  291. </if>
  292. <if test="actuallyFirstPayment != null">
  293. actually_first_payment,
  294. </if>
  295. <if test="signTotalAmount != null">
  296. sign_total_amount,
  297. </if>
  298. <if test="actuallyTotalAmount != null">
  299. actually_total_amount,
  300. </if>
  301. <if test="signBrokerageAmount != null">
  302. sign_brokerage_amount,
  303. </if>
  304. <if test="actuallyBrokerageAmount != null">
  305. actually_brokerage_amount,
  306. </if>
  307. <if test="signWithdrawAmount != null">
  308. sign_withdraw_amount,
  309. </if>
  310. <if test="actuallyWithdrawAmount != null">
  311. actually_withdraw_amount,
  312. </if>
  313. <if test="orderStage != null">
  314. order_stage,
  315. </if>
  316. <if test="projectStage != null">
  317. project_stage,
  318. </if>
  319. <if test="orderStatus != null">
  320. order_status,
  321. </if>
  322. <if test="liquidationStatus != null">
  323. liquidation_status,
  324. </if>
  325. <if test="orderChannel != null">
  326. order_channel,
  327. </if>
  328. <if test="approval != null">
  329. approval,
  330. </if>
  331. <if test="orderRemarks != null">
  332. order_remarks,
  333. </if>
  334. <if test="deleteSign != null">
  335. delete_sign,
  336. </if>
  337. <if test="salesmanId != null">
  338. salesman_id,
  339. </if>
  340. <if test="financeId != null">
  341. finance_id,
  342. </if>
  343. <if test="technicianId != null">
  344. technician_id,
  345. </if>
  346. <if test="confirmTime != null">
  347. confirm_time,
  348. </if>
  349. <if test="signTime != null">
  350. sign_time,
  351. </if>
  352. <if test="setUpTime != null">
  353. set_up_time,
  354. </if>
  355. <if test="settlementTime != null">
  356. settlement_time,
  357. </if>
  358. <if test="contractNo != null">
  359. contract_no,
  360. </if>
  361. <if test="contractType != null">
  362. contract_type,
  363. </if>
  364. <if test="changeStatus != null">
  365. change_status,
  366. </if>
  367. <if test="contractPictureUrl != null">
  368. contract_picture_url,
  369. </if>
  370. </trim>
  371. <trim prefix="values (" suffix=")" suffixOverrides=",">
  372. <if test="orderNo != null">
  373. #{orderNo,jdbcType=VARCHAR},
  374. </if>
  375. <if test="orderType != null">
  376. #{orderType,jdbcType=INTEGER},
  377. </if>
  378. <if test="creater != null">
  379. #{creater,jdbcType=VARCHAR},
  380. </if>
  381. <if test="createTime != null">
  382. #{createTime,jdbcType=TIMESTAMP},
  383. </if>
  384. <if test="updateTime != null">
  385. #{updateTime,jdbcType=TIMESTAMP},
  386. </if>
  387. <if test="buyerId != null">
  388. #{buyerId,jdbcType=VARCHAR},
  389. </if>
  390. <if test="sellerId != null">
  391. #{sellerId,jdbcType=VARCHAR},
  392. </if>
  393. <if test="firstPayment != null">
  394. #{firstPayment,jdbcType=DECIMAL},
  395. </if>
  396. <if test="orderAmount != null">
  397. #{orderAmount,jdbcType=DECIMAL},
  398. </if>
  399. <if test="brokerageAmount != null">
  400. #{brokerageAmount,jdbcType=DECIMAL},
  401. </if>
  402. <if test="signFirstPayment != null">
  403. #{signFirstPayment,jdbcType=DECIMAL},
  404. </if>
  405. <if test="actuallyFirstPayment != null">
  406. #{actuallyFirstPayment,jdbcType=DECIMAL},
  407. </if>
  408. <if test="signTotalAmount != null">
  409. #{signTotalAmount,jdbcType=DECIMAL},
  410. </if>
  411. <if test="actuallyTotalAmount != null">
  412. #{actuallyTotalAmount,jdbcType=DECIMAL},
  413. </if>
  414. <if test="signBrokerageAmount != null">
  415. #{signBrokerageAmount,jdbcType=DECIMAL},
  416. </if>
  417. <if test="actuallyBrokerageAmount != null">
  418. #{actuallyBrokerageAmount,jdbcType=DECIMAL},
  419. </if>
  420. <if test="signWithdrawAmount != null">
  421. #{signWithdrawAmount,jdbcType=DECIMAL},
  422. </if>
  423. <if test="actuallyWithdrawAmount != null">
  424. #{actuallyWithdrawAmount,jdbcType=DECIMAL},
  425. </if>
  426. <if test="orderStage != null">
  427. #{orderStage,jdbcType=INTEGER},
  428. </if>
  429. <if test="projectStage != null">
  430. #{projectStage,jdbcType=INTEGER},
  431. </if>
  432. <if test="orderStatus != null">
  433. #{orderStatus,jdbcType=INTEGER},
  434. </if>
  435. <if test="liquidationStatus != null">
  436. #{liquidationStatus,jdbcType=INTEGER},
  437. </if>
  438. <if test="orderChannel != null">
  439. #{orderChannel,jdbcType=INTEGER},
  440. </if>
  441. <if test="approval != null">
  442. #{approval,jdbcType=INTEGER},
  443. </if>
  444. <if test="orderRemarks != null">
  445. #{orderRemarks,jdbcType=VARCHAR},
  446. </if>
  447. <if test="deleteSign != null">
  448. #{deleteSign,jdbcType=INTEGER},
  449. </if>
  450. <if test="salesmanId != null">
  451. #{salesmanId,jdbcType=VARCHAR},
  452. </if>
  453. <if test="financeId != null">
  454. #{financeId,jdbcType=VARCHAR},
  455. </if>
  456. <if test="technicianId != null">
  457. #{technicianId,jdbcType=VARCHAR},
  458. </if>
  459. <if test="confirmTime != null">
  460. #{confirmTime,jdbcType=TIMESTAMP},
  461. </if>
  462. <if test="signTime != null">
  463. #{signTime,jdbcType=TIMESTAMP},
  464. </if>
  465. <if test="setUpTime != null">
  466. #{setUpTime,jdbcType=TIMESTAMP},
  467. </if>
  468. <if test="settlementTime != null">
  469. #{settlementTime,jdbcType=TIMESTAMP},
  470. </if>
  471. <if test="contractNo != null">
  472. #{contractNo,jdbcType=VARCHAR},
  473. </if>
  474. <if test="contractType != null">
  475. #{contractType,jdbcType=VARCHAR},
  476. </if>
  477. <if test="changeStatus != null">
  478. #{changeStatus,jdbcType=INTEGER},
  479. </if>
  480. <if test="contractPictureUrl != null">
  481. #{contractPictureUrl,jdbcType=LONGVARCHAR},
  482. </if>
  483. </trim>
  484. </insert>
  485. <select id="countByExample" parameterType="com.goafanti.common.model.TOrderExample" resultType="java.lang.Long">
  486. <!--
  487. WARNING - @mbg.generated
  488. This element is automatically generated by MyBatis Generator, do not modify.
  489. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  490. -->
  491. select count(*) from t_order
  492. <if test="_parameter != null">
  493. <include refid="Example_Where_Clause" />
  494. </if>
  495. </select>
  496. <update id="updateByExampleSelective" parameterType="map">
  497. <!--
  498. WARNING - @mbg.generated
  499. This element is automatically generated by MyBatis Generator, do not modify.
  500. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  501. -->
  502. update t_order
  503. <set>
  504. <if test="record.orderNo != null">
  505. order_no = #{record.orderNo,jdbcType=VARCHAR},
  506. </if>
  507. <if test="record.orderType != null">
  508. order_type = #{record.orderType,jdbcType=INTEGER},
  509. </if>
  510. <if test="record.creater != null">
  511. creater = #{record.creater,jdbcType=VARCHAR},
  512. </if>
  513. <if test="record.createTime != null">
  514. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  515. </if>
  516. <if test="record.updateTime != null">
  517. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  518. </if>
  519. <if test="record.buyerId != null">
  520. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  521. </if>
  522. <if test="record.sellerId != null">
  523. seller_id = #{record.sellerId,jdbcType=VARCHAR},
  524. </if>
  525. <if test="record.firstPayment != null">
  526. first_payment = #{record.firstPayment,jdbcType=DECIMAL},
  527. </if>
  528. <if test="record.orderAmount != null">
  529. order_amount = #{record.orderAmount,jdbcType=DECIMAL},
  530. </if>
  531. <if test="record.brokerageAmount != null">
  532. brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
  533. </if>
  534. <if test="record.signFirstPayment != null">
  535. sign_first_payment = #{record.signFirstPayment,jdbcType=DECIMAL},
  536. </if>
  537. <if test="record.actuallyFirstPayment != null">
  538. actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
  539. </if>
  540. <if test="record.signTotalAmount != null">
  541. sign_total_amount = #{record.signTotalAmount,jdbcType=DECIMAL},
  542. </if>
  543. <if test="record.actuallyTotalAmount != null">
  544. actually_total_amount = #{record.actuallyTotalAmount,jdbcType=DECIMAL},
  545. </if>
  546. <if test="record.signBrokerageAmount != null">
  547. sign_brokerage_amount = #{record.signBrokerageAmount,jdbcType=DECIMAL},
  548. </if>
  549. <if test="record.actuallyBrokerageAmount != null">
  550. actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
  551. </if>
  552. <if test="record.signWithdrawAmount != null">
  553. sign_withdraw_amount = #{record.signWithdrawAmount,jdbcType=DECIMAL},
  554. </if>
  555. <if test="record.actuallyWithdrawAmount != null">
  556. actually_withdraw_amount = #{record.actuallyWithdrawAmount,jdbcType=DECIMAL},
  557. </if>
  558. <if test="record.orderStage != null">
  559. order_stage = #{record.orderStage,jdbcType=INTEGER},
  560. </if>
  561. <if test="record.projectStage != null">
  562. project_stage = #{record.projectStage,jdbcType=INTEGER},
  563. </if>
  564. <if test="record.orderStatus != null">
  565. order_status = #{record.orderStatus,jdbcType=INTEGER},
  566. </if>
  567. <if test="record.liquidationStatus != null">
  568. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  569. </if>
  570. <if test="record.orderChannel != null">
  571. order_channel = #{record.orderChannel,jdbcType=INTEGER},
  572. </if>
  573. <if test="record.approval != null">
  574. approval = #{record.approval,jdbcType=INTEGER},
  575. </if>
  576. <if test="record.orderRemarks != null">
  577. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  578. </if>
  579. <if test="record.deleteSign != null">
  580. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  581. </if>
  582. <if test="record.salesmanId != null">
  583. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  584. </if>
  585. <if test="record.financeId != null">
  586. finance_id = #{record.financeId,jdbcType=VARCHAR},
  587. </if>
  588. <if test="record.technicianId != null">
  589. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  590. </if>
  591. <if test="record.confirmTime != null">
  592. confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
  593. </if>
  594. <if test="record.signTime != null">
  595. sign_time = #{record.signTime,jdbcType=TIMESTAMP},
  596. </if>
  597. <if test="record.setUpTime != null">
  598. set_up_time = #{record.setUpTime,jdbcType=TIMESTAMP},
  599. </if>
  600. <if test="record.settlementTime != null">
  601. settlement_time = #{record.settlementTime,jdbcType=TIMESTAMP},
  602. </if>
  603. <if test="record.contractNo != null">
  604. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  605. </if>
  606. <if test="record.contractType != null">
  607. contract_type = #{record.contractType,jdbcType=VARCHAR},
  608. </if>
  609. <if test="record.changeStatus != null">
  610. change_status = #{record.changeStatus,jdbcType=INTEGER},
  611. </if>
  612. <if test="record.contractPictureUrl != null">
  613. contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR},
  614. </if>
  615. </set>
  616. <if test="_parameter != null">
  617. <include refid="Update_By_Example_Where_Clause" />
  618. </if>
  619. </update>
  620. <update id="updateByExampleWithBLOBs" parameterType="map">
  621. <!--
  622. WARNING - @mbg.generated
  623. This element is automatically generated by MyBatis Generator, do not modify.
  624. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  625. -->
  626. update t_order
  627. set order_no = #{record.orderNo,jdbcType=VARCHAR},
  628. order_type = #{record.orderType,jdbcType=INTEGER},
  629. creater = #{record.creater,jdbcType=VARCHAR},
  630. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  631. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  632. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  633. seller_id = #{record.sellerId,jdbcType=VARCHAR},
  634. first_payment = #{record.firstPayment,jdbcType=DECIMAL},
  635. order_amount = #{record.orderAmount,jdbcType=DECIMAL},
  636. brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
  637. sign_first_payment = #{record.signFirstPayment,jdbcType=DECIMAL},
  638. actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
  639. sign_total_amount = #{record.signTotalAmount,jdbcType=DECIMAL},
  640. actually_total_amount = #{record.actuallyTotalAmount,jdbcType=DECIMAL},
  641. sign_brokerage_amount = #{record.signBrokerageAmount,jdbcType=DECIMAL},
  642. actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
  643. sign_withdraw_amount = #{record.signWithdrawAmount,jdbcType=DECIMAL},
  644. actually_withdraw_amount = #{record.actuallyWithdrawAmount,jdbcType=DECIMAL},
  645. order_stage = #{record.orderStage,jdbcType=INTEGER},
  646. project_stage = #{record.projectStage,jdbcType=INTEGER},
  647. order_status = #{record.orderStatus,jdbcType=INTEGER},
  648. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  649. order_channel = #{record.orderChannel,jdbcType=INTEGER},
  650. approval = #{record.approval,jdbcType=INTEGER},
  651. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  652. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  653. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  654. finance_id = #{record.financeId,jdbcType=VARCHAR},
  655. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  656. confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
  657. sign_time = #{record.signTime,jdbcType=TIMESTAMP},
  658. set_up_time = #{record.setUpTime,jdbcType=TIMESTAMP},
  659. settlement_time = #{record.settlementTime,jdbcType=TIMESTAMP},
  660. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  661. contract_type = #{record.contractType,jdbcType=VARCHAR},
  662. change_status = #{record.changeStatus,jdbcType=INTEGER},
  663. contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR}
  664. <if test="_parameter != null">
  665. <include refid="Update_By_Example_Where_Clause" />
  666. </if>
  667. </update>
  668. <update id="updateByExample" parameterType="map">
  669. <!--
  670. WARNING - @mbg.generated
  671. This element is automatically generated by MyBatis Generator, do not modify.
  672. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  673. -->
  674. update t_order
  675. set order_no = #{record.orderNo,jdbcType=VARCHAR},
  676. order_type = #{record.orderType,jdbcType=INTEGER},
  677. creater = #{record.creater,jdbcType=VARCHAR},
  678. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  679. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  680. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  681. seller_id = #{record.sellerId,jdbcType=VARCHAR},
  682. first_payment = #{record.firstPayment,jdbcType=DECIMAL},
  683. order_amount = #{record.orderAmount,jdbcType=DECIMAL},
  684. brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
  685. sign_first_payment = #{record.signFirstPayment,jdbcType=DECIMAL},
  686. actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
  687. sign_total_amount = #{record.signTotalAmount,jdbcType=DECIMAL},
  688. actually_total_amount = #{record.actuallyTotalAmount,jdbcType=DECIMAL},
  689. sign_brokerage_amount = #{record.signBrokerageAmount,jdbcType=DECIMAL},
  690. actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
  691. sign_withdraw_amount = #{record.signWithdrawAmount,jdbcType=DECIMAL},
  692. actually_withdraw_amount = #{record.actuallyWithdrawAmount,jdbcType=DECIMAL},
  693. order_stage = #{record.orderStage,jdbcType=INTEGER},
  694. project_stage = #{record.projectStage,jdbcType=INTEGER},
  695. order_status = #{record.orderStatus,jdbcType=INTEGER},
  696. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  697. order_channel = #{record.orderChannel,jdbcType=INTEGER},
  698. approval = #{record.approval,jdbcType=INTEGER},
  699. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  700. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  701. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  702. finance_id = #{record.financeId,jdbcType=VARCHAR},
  703. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  704. confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
  705. sign_time = #{record.signTime,jdbcType=TIMESTAMP},
  706. set_up_time = #{record.setUpTime,jdbcType=TIMESTAMP},
  707. settlement_time = #{record.settlementTime,jdbcType=TIMESTAMP},
  708. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  709. contract_type = #{record.contractType,jdbcType=VARCHAR},
  710. change_status = #{record.changeStatus,jdbcType=INTEGER}
  711. <if test="_parameter != null">
  712. <include refid="Update_By_Example_Where_Clause" />
  713. </if>
  714. </update>
  715. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrder">
  716. <!--
  717. WARNING - @mbg.generated
  718. This element is automatically generated by MyBatis Generator, do not modify.
  719. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  720. -->
  721. update t_order
  722. <set>
  723. <if test="orderType != null">
  724. order_type = #{orderType,jdbcType=INTEGER},
  725. </if>
  726. <if test="creater != null">
  727. creater = #{creater,jdbcType=VARCHAR},
  728. </if>
  729. <if test="createTime != null">
  730. create_time = #{createTime,jdbcType=TIMESTAMP},
  731. </if>
  732. <if test="updateTime != null">
  733. update_time = #{updateTime,jdbcType=TIMESTAMP},
  734. </if>
  735. <if test="buyerId != null">
  736. buyer_id = #{buyerId,jdbcType=VARCHAR},
  737. </if>
  738. <if test="sellerId != null">
  739. seller_id = #{sellerId,jdbcType=VARCHAR},
  740. </if>
  741. <if test="firstPayment != null">
  742. first_payment = #{firstPayment,jdbcType=DECIMAL},
  743. </if>
  744. <if test="orderAmount != null">
  745. order_amount = #{orderAmount,jdbcType=DECIMAL},
  746. </if>
  747. <if test="brokerageAmount != null">
  748. brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
  749. </if>
  750. <if test="signFirstPayment != null">
  751. sign_first_payment = #{signFirstPayment,jdbcType=DECIMAL},
  752. </if>
  753. <if test="actuallyFirstPayment != null">
  754. actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
  755. </if>
  756. <if test="signTotalAmount != null">
  757. sign_total_amount = #{signTotalAmount,jdbcType=DECIMAL},
  758. </if>
  759. <if test="actuallyTotalAmount != null">
  760. actually_total_amount = #{actuallyTotalAmount,jdbcType=DECIMAL},
  761. </if>
  762. <if test="signBrokerageAmount != null">
  763. sign_brokerage_amount = #{signBrokerageAmount,jdbcType=DECIMAL},
  764. </if>
  765. <if test="actuallyBrokerageAmount != null">
  766. actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
  767. </if>
  768. <if test="signWithdrawAmount != null">
  769. sign_withdraw_amount = #{signWithdrawAmount,jdbcType=DECIMAL},
  770. </if>
  771. <if test="actuallyWithdrawAmount != null">
  772. actually_withdraw_amount = #{actuallyWithdrawAmount,jdbcType=DECIMAL},
  773. </if>
  774. <if test="orderStage != null">
  775. order_stage = #{orderStage,jdbcType=INTEGER},
  776. </if>
  777. <if test="projectStage != null">
  778. project_stage = #{projectStage,jdbcType=INTEGER},
  779. </if>
  780. <if test="orderStatus != null">
  781. order_status = #{orderStatus,jdbcType=INTEGER},
  782. </if>
  783. <if test="liquidationStatus != null">
  784. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  785. </if>
  786. <if test="orderChannel != null">
  787. order_channel = #{orderChannel,jdbcType=INTEGER},
  788. </if>
  789. <if test="approval != null">
  790. approval = #{approval,jdbcType=INTEGER},
  791. </if>
  792. <if test="orderRemarks != null">
  793. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  794. </if>
  795. <if test="deleteSign != null">
  796. delete_sign = #{deleteSign,jdbcType=INTEGER},
  797. </if>
  798. <if test="salesmanId != null">
  799. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  800. </if>
  801. <if test="financeId != null">
  802. finance_id = #{financeId,jdbcType=VARCHAR},
  803. </if>
  804. <if test="technicianId != null">
  805. technician_id = #{technicianId,jdbcType=VARCHAR},
  806. </if>
  807. <if test="confirmTime != null">
  808. confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
  809. </if>
  810. <if test="signTime != null">
  811. sign_time = #{signTime,jdbcType=TIMESTAMP},
  812. </if>
  813. <if test="setUpTime != null">
  814. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  815. </if>
  816. <if test="settlementTime != null">
  817. settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
  818. </if>
  819. <if test="contractNo != null">
  820. contract_no = #{contractNo,jdbcType=VARCHAR},
  821. </if>
  822. <if test="contractType != null">
  823. contract_type = #{contractType,jdbcType=VARCHAR},
  824. </if>
  825. <if test="changeStatus != null">
  826. change_status = #{changeStatus,jdbcType=INTEGER},
  827. </if>
  828. <if test="contractPictureUrl != null">
  829. contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR},
  830. </if>
  831. </set>
  832. where order_no = #{orderNo,jdbcType=VARCHAR}
  833. </update>
  834. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.TOrder">
  835. <!--
  836. WARNING - @mbg.generated
  837. This element is automatically generated by MyBatis Generator, do not modify.
  838. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  839. -->
  840. update t_order
  841. set order_type = #{orderType,jdbcType=INTEGER},
  842. creater = #{creater,jdbcType=VARCHAR},
  843. create_time = #{createTime,jdbcType=TIMESTAMP},
  844. update_time = #{updateTime,jdbcType=TIMESTAMP},
  845. buyer_id = #{buyerId,jdbcType=VARCHAR},
  846. seller_id = #{sellerId,jdbcType=VARCHAR},
  847. first_payment = #{firstPayment,jdbcType=DECIMAL},
  848. order_amount = #{orderAmount,jdbcType=DECIMAL},
  849. brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
  850. sign_first_payment = #{signFirstPayment,jdbcType=DECIMAL},
  851. actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
  852. sign_total_amount = #{signTotalAmount,jdbcType=DECIMAL},
  853. actually_total_amount = #{actuallyTotalAmount,jdbcType=DECIMAL},
  854. sign_brokerage_amount = #{signBrokerageAmount,jdbcType=DECIMAL},
  855. actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
  856. sign_withdraw_amount = #{signWithdrawAmount,jdbcType=DECIMAL},
  857. actually_withdraw_amount = #{actuallyWithdrawAmount,jdbcType=DECIMAL},
  858. order_stage = #{orderStage,jdbcType=INTEGER},
  859. project_stage = #{projectStage,jdbcType=INTEGER},
  860. order_status = #{orderStatus,jdbcType=INTEGER},
  861. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  862. order_channel = #{orderChannel,jdbcType=INTEGER},
  863. approval = #{approval,jdbcType=INTEGER},
  864. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  865. delete_sign = #{deleteSign,jdbcType=INTEGER},
  866. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  867. finance_id = #{financeId,jdbcType=VARCHAR},
  868. technician_id = #{technicianId,jdbcType=VARCHAR},
  869. confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
  870. sign_time = #{signTime,jdbcType=TIMESTAMP},
  871. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  872. settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
  873. contract_no = #{contractNo,jdbcType=VARCHAR},
  874. contract_type = #{contractType,jdbcType=VARCHAR},
  875. change_status = #{changeStatus,jdbcType=INTEGER},
  876. contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR}
  877. where order_no = #{orderNo,jdbcType=VARCHAR}
  878. </update>
  879. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrder">
  880. <!--
  881. WARNING - @mbg.generated
  882. This element is automatically generated by MyBatis Generator, do not modify.
  883. This element was generated on Wed Apr 11 14:30:55 CST 2018.
  884. -->
  885. update t_order
  886. set order_type = #{orderType,jdbcType=INTEGER},
  887. creater = #{creater,jdbcType=VARCHAR},
  888. create_time = #{createTime,jdbcType=TIMESTAMP},
  889. update_time = #{updateTime,jdbcType=TIMESTAMP},
  890. buyer_id = #{buyerId,jdbcType=VARCHAR},
  891. seller_id = #{sellerId,jdbcType=VARCHAR},
  892. first_payment = #{firstPayment,jdbcType=DECIMAL},
  893. order_amount = #{orderAmount,jdbcType=DECIMAL},
  894. brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
  895. sign_first_payment = #{signFirstPayment,jdbcType=DECIMAL},
  896. actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
  897. sign_total_amount = #{signTotalAmount,jdbcType=DECIMAL},
  898. actually_total_amount = #{actuallyTotalAmount,jdbcType=DECIMAL},
  899. sign_brokerage_amount = #{signBrokerageAmount,jdbcType=DECIMAL},
  900. actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
  901. sign_withdraw_amount = #{signWithdrawAmount,jdbcType=DECIMAL},
  902. actually_withdraw_amount = #{actuallyWithdrawAmount,jdbcType=DECIMAL},
  903. order_stage = #{orderStage,jdbcType=INTEGER},
  904. project_stage = #{projectStage,jdbcType=INTEGER},
  905. order_status = #{orderStatus,jdbcType=INTEGER},
  906. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  907. order_channel = #{orderChannel,jdbcType=INTEGER},
  908. approval = #{approval,jdbcType=INTEGER},
  909. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  910. delete_sign = #{deleteSign,jdbcType=INTEGER},
  911. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  912. finance_id = #{financeId,jdbcType=VARCHAR},
  913. technician_id = #{technicianId,jdbcType=VARCHAR},
  914. confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
  915. sign_time = #{signTime,jdbcType=TIMESTAMP},
  916. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  917. settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
  918. contract_no = #{contractNo,jdbcType=VARCHAR},
  919. contract_type = #{contractType,jdbcType=VARCHAR},
  920. change_status = #{changeStatus,jdbcType=INTEGER}
  921. where order_no = #{orderNo,jdbcType=VARCHAR}
  922. </update>
  923. <select id="selectCommodityDetail" resultType="com.goafanti.order.bo.CommodityDetailBo">
  924. <choose>
  925. <when test="commodityType == 0">
  926. select id as commodityId,bname as commodityName,cid as commodityClassify,ifnull(price,0) as commodityPrice,ifnull(first_payment,0) as commodityFirstPayment from business_project where id = #{commodityId,jdbcType=VARCHAR}
  927. </when>
  928. <when test="commodityType == 1">
  929. select id as commodityId,name as commodityName,introduction,ifnull(transfer_price,0) as commodityPrice,owner_id as sellerId from achievement where id = #{commodityId,jdbcType=VARCHAR}
  930. </when>
  931. <when test="commodityType == 2">
  932. select id as commodityId,name as commodityName,problem_des as introduction,ifnull(budget_cost,0) as commodityPrice,employer_id as sellerId from demand where id = #{commodityId,jdbcType=VARCHAR}
  933. </when>
  934. <when test="commodityType == 3">
  935. select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a
  936. left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
  937. </when>
  938. <when test="commodityType == 4">
  939. </when>
  940. <when test="commodityType == 5">
  941. </when>
  942. <when test="commodityType == 6">
  943. select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a
  944. left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
  945. </when>
  946. </choose>
  947. </select>
  948. <select id="selectOrderListByPage" resultMap="BaseResultMap">
  949. select
  950. <include refid="Base_Column_List" />
  951. from t_order where delete_sign = 0
  952. <choose>
  953. <when test="orderStatus == 1"><!-- 意向订单 -->
  954. and order_status = 1 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
  955. </when>
  956. <otherwise>
  957. and order_status != 1 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
  958. </otherwise>
  959. </choose>
  960. order by create_time desc
  961. <if test="page_sql!=null">
  962. ${page_sql}
  963. </if>
  964. </select>
  965. <select id="selectOrderListCount" resultType="java.lang.Integer">
  966. select
  967. count(0)
  968. from t_order where delete_sign = 0
  969. <choose>
  970. <when test="orderStatus == 0"><!-- 意向订单 -->
  971. and order_status = 1 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
  972. </when>
  973. <otherwise>
  974. and order_status != 1 and buyer_id = #{uid,jdbcType=VARCHAR}
  975. </otherwise>
  976. </choose>
  977. </select>
  978. <select id="selectOrderBillByPage" resultType="com.goafanti.order.bo.BillListBo">
  979. select
  980. a.order_no as orderNo,
  981. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  982. a.transaction_subject as transactionSubject,
  983. a.transaction_amount as transactionAmount,
  984. a.confirm_sign as confirmSign
  985. from
  986. t_order_bill a
  987. where
  988. (a.payee_id = #{uid,jdbcType=VARCHAR} or a.payer_id = #{uid,jdbcType=VARCHAR})
  989. <if test="orderNo != null and orderNo != ''">
  990. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  991. </if>
  992. order by a.create_time desc
  993. <if test="page_sql!=null">
  994. ${page_sql}
  995. </if>
  996. </select>
  997. <select id="selectOrderBillCount" resultType="java.lang.Integer">
  998. select
  999. count(0)
  1000. from
  1001. t_order_bill a
  1002. where
  1003. (a.payee_id = #{uid,jdbcType=VARCHAR} or a.payer_id = #{uid,jdbcType=VARCHAR})
  1004. <if test="orderNo != null and orderNo != ''">
  1005. a.order_no = #{orderNo,jdbcType=VARCHAR}
  1006. </if>
  1007. </select>
  1008. <select id="selectOrderCommodity" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderDetail">
  1009. select
  1010. id,
  1011. order_no as orderNo,
  1012. commodity_id as commodityId,
  1013. commodity_name as commodityName,
  1014. commodity_quantity as commodityQuantity,
  1015. commodity_price as commodityPrice,
  1016. commodity_first_payment as commodityFirstPayment,
  1017. commodity_type as commodityType,
  1018. commodity_mode as commodityMode,
  1019. discount_price as discountPrice,
  1020. discount_first_payment as discountFirstPayment,
  1021. create_time as createTime,
  1022. remarks
  1023. from
  1024. t_order_detail
  1025. where
  1026. order_no = #{orderNo,jdbcType=VARCHAR}
  1027. </select>
  1028. <select id="selectServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1029. select
  1030. a.order_no as orderNo,
  1031. a.order_type as orderType,
  1032. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1033. date_format(a.sign_time,'%Y-%m-%d') as signTime,
  1034. a.sign_total_amount as signTotalAmount,
  1035. a.actually_total_amount as actuallyTotalAmount,
  1036. a.order_status as orderStatus,
  1037. a.order_stage as orderStage,
  1038. a.project_stage as projectStage,
  1039. a.liquidation_status as liquidationStatus,
  1040. a.approval,
  1041. a.order_channel as orderChannel,
  1042. a.buyer_id as buyerId,
  1043. a.seller_id as sellerId,
  1044. a.delete_sign as deleteSign,
  1045. b.nickname as buyerName,
  1046. c.name as salesmanName,
  1047. d.name as financeName,
  1048. e.name as technicianName,
  1049. f.name as departmentName
  1050. from
  1051. t_order a left join user b on
  1052. a.buyer_id = b.id left join admin c on
  1053. a.salesman_id = c.id left join admin d on
  1054. a.finance_id = d.id left join admin e on
  1055. a.technician_id = e.id left join department f on
  1056. c.department_id = f.id
  1057. where a.order_type = 0 and a.delete_sign != 1
  1058. <if test="deleteStatus==1">
  1059. and a.delete_sign = 0
  1060. </if>
  1061. <if test="orderNo != null">
  1062. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1063. </if>
  1064. <if test="salesmanId != null">
  1065. and a.salesman_id = #{salesmanId,jdbcType=VARCHAR}
  1066. </if>
  1067. <if test="financeId != null">
  1068. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1069. </if>
  1070. <if test="technicianId != null">
  1071. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1072. </if>
  1073. <if test="startDate != null">
  1074. and a.create_time &gt; #{startDate,jdbcType=TIMESTAMP}
  1075. </if>
  1076. <if test="endDate != null">
  1077. and a.create_time &lt; #{endDate,jdbcType=TIMESTAMP}
  1078. </if>
  1079. <if test="orderStatus != null">
  1080. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1081. </if>
  1082. <if test="projectStage != null">
  1083. and a.project_stage = #{projectStage,jdbcType=INTEGER}
  1084. </if>
  1085. <if test="liquidationStatus != null">
  1086. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1087. </if>
  1088. <if test="orderChannel != null">
  1089. and a.order_channel = #{orderChannel,jdbcType=INTEGER}
  1090. </if>
  1091. <if test="approval != null and approval !=4">
  1092. and a.approval = #{approval,jdbcType=INTEGER}
  1093. </if>
  1094. <if test="approval ==4">
  1095. and a.approval != 0
  1096. </if>
  1097. <if test="buyerName != null and buyerName != ''">
  1098. and b.nickname like concat('%', #{buyerName},'%')
  1099. </if>
  1100. <if test="salesmanName != null and salesmanName != ''">
  1101. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1102. </if>
  1103. <!-- 特殊处理字段 开始 -->
  1104. <if test="intention == 1">
  1105. and a.order_stage = 0
  1106. </if>
  1107. <if test="formal == 1">
  1108. and a.order_stage != 0
  1109. </if>
  1110. <if test="approvalHistory == 0">
  1111. and a.approval = 1
  1112. </if>
  1113. <if test="approvalHistory == 1">
  1114. and a.approval != 0
  1115. </if>
  1116. <if test="depIds != null and depIds != ''">
  1117. and f.id in (${depIds})
  1118. </if>
  1119. order by a.create_time desc
  1120. <!-- 特殊处理字段结束 -->
  1121. <if test="page_sql != null">
  1122. ${page_sql}
  1123. </if>
  1124. </select>
  1125. <select id="selectServiceOrderCount" resultType="java.lang.Integer">
  1126. select
  1127. count(0)
  1128. from
  1129. t_order a left join user b on
  1130. a.buyer_id = b.id left join admin c on
  1131. a.salesman_id = c.id left join admin d on
  1132. a.finance_id = d.id left join admin e on
  1133. a.technician_id = e.id left join department f on
  1134. c.department_id = f.id
  1135. where a.order_type = 0 and a.delete_sign != 1
  1136. <if test="deleteStatus==1">
  1137. and a.delete_sign = 0
  1138. </if>
  1139. <if test="orderNo != null">
  1140. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1141. </if>
  1142. <if test="salesmanId != null">
  1143. and a.salesman_id = #{salesmanId,jdbcType=VARCHAR}
  1144. </if>
  1145. <if test="financeId != null">
  1146. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1147. </if>
  1148. <if test="technicianId != null">
  1149. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1150. </if>
  1151. <if test="startDate != null">
  1152. and a.create_time &gt; #{startDate,jdbcType=VARCHAR}
  1153. </if>
  1154. <if test="endDate != null">
  1155. and a.create_time &lt; #{endDate,jdbcType=VARCHAR}
  1156. </if>
  1157. <if test="orderStatus != null">
  1158. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1159. </if>
  1160. <if test="confirm == 0">
  1161. and a.order_status = 0
  1162. </if>
  1163. <if test="confirm == 1">
  1164. and a.order_status != 0
  1165. </if>
  1166. <if test="orderStage != null">
  1167. and a.order_stage = #{orderStage,jdbcType=INTEGER}
  1168. </if>
  1169. <if test="liquidationStatus != null">
  1170. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1171. </if>
  1172. <if test="orderChannel != null">
  1173. and a.order_channel =#{orderChannel,jdbcType=INTEGER}
  1174. </if>
  1175. <if test="approval != null and approval !=4">
  1176. and a.approval = #{approval,jdbcType=INTEGER}
  1177. </if>
  1178. <if test="approval ==4">
  1179. and a.approval != 0
  1180. </if>
  1181. <if test="buyerName != null and buyerName != ''">
  1182. and b.nickname like concat('%', #{buyerName},'%')
  1183. </if>
  1184. <if test="salesmanName != null and salesmanName != ''">
  1185. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1186. </if>
  1187. <!-- 特殊处理字段 开始 -->
  1188. <if test="intention == 1">
  1189. and a.order_stage = 0
  1190. </if>
  1191. <if test="formal == 1">
  1192. and a.order_stage != 0
  1193. </if>
  1194. <if test="approvalHistory == 0">
  1195. and a.approval = 1
  1196. </if>
  1197. <if test="approvalHistory == 1">
  1198. and a.approval != 0
  1199. </if>
  1200. <if test="depIds != null and depIds != ''">
  1201. and f.id in (${depIds})
  1202. </if>
  1203. <!-- 特殊处理字段结束 -->
  1204. </select>
  1205. <select id="selectServiceOrderDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.ServiceOrderDetailBo">
  1206. select
  1207. a.order_no as orderNo,
  1208. a.order_type as orderType,
  1209. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1210. date_format(a.sign_time,'%Y-%m-%d') as signTime,
  1211. date_format(a.set_up_time,'%Y-%m-%d %H:%i:%S') as setUpTime,
  1212. date_format(a.settlement_time,'%Y-%m-%d %H:%i:%S') as settlementTime,
  1213. a.order_amount as orderAmount,
  1214. a.first_payment as firstPayment,
  1215. a.sign_total_amount as signTotalAmount,
  1216. a.sign_first_payment as signFirstPayment,
  1217. a.actually_total_amount as actuallyTotalAmount,
  1218. a.order_status as orderStatus,
  1219. a.order_stage as orderStage,
  1220. a.project_stage as projectStage,
  1221. a.delete_sign as deleteSign,
  1222. a.liquidation_status as liquidationStatus,
  1223. a.approval,
  1224. a.order_remarks as orderRemarks,
  1225. a.order_channel as orderChannel,
  1226. a.contract_picture_url as contractPictureUrl,
  1227. a.buyer_id as buyerId,
  1228. a.seller_id as sellerId,
  1229. a.buyer_id as buyerId,
  1230. a.salesman_id as salesmanId,
  1231. b.type as buyerType,
  1232. b.nickname as buyerName,
  1233. c.name as salesmanName,
  1234. x.name as departmentName,
  1235. a.finance_id as financeId,
  1236. c.name as financeName,
  1237. a.technician_id as technicianId,
  1238. e.name as technicianName,
  1239. a.delete_sign as deleteSign,
  1240. a.contract_no as contractNo,
  1241. f.cname as projectType,
  1242. a.change_status as changeStatus
  1243. from
  1244. t_order a left join user b on
  1245. a.buyer_id = b.id left join admin c on
  1246. a.salesman_id = c.id left join admin d on
  1247. a.finance_id = d.id left join department x on
  1248. c.department_id=x.id left join admin e on
  1249. a.technician_id = e.id left join business_category f on
  1250. a.contract_type = f.id
  1251. where a.order_no = #{orderNo,jdbcType=VARCHAR}
  1252. </select>
  1253. <select id="selectPublicOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1254. select
  1255. a.order_no as orderNo,
  1256. a.order_type as orderType,
  1257. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1258. a.order_amount as orderAmount,
  1259. a.sign_total_amount as signTotalAmount,
  1260. a.order_status as orderStatus,
  1261. a.order_stage as orderStage,
  1262. a.liquidation_status as liquidationStatus,
  1263. a.order_channel as orderChannel,
  1264. b.nickname as buyerName
  1265. from
  1266. t_order a left join user b on
  1267. a.buyer_id = b.id
  1268. where a.salesman_id is null
  1269. <if test="startDate != null">
  1270. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1271. </if>
  1272. <if test="endDate != null">
  1273. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1274. </if>
  1275. <if test="buyerName != null and buyerName != ''">
  1276. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1277. </if>
  1278. <if test="orderType != null">
  1279. and a.order_type = #{orderType,jdbcType=INTEGER}
  1280. </if>
  1281. <if test="orderStatus != null">
  1282. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1283. </if>
  1284. <if test="orderChannel != null">
  1285. and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
  1286. </if>
  1287. <if test="page_sql != null">
  1288. ${page_sql}
  1289. </if>
  1290. </select>
  1291. <select id="selectPublicOrderCount" resultType="java.lang.Integer">
  1292. select
  1293. count(0)
  1294. from
  1295. t_order a left join user b on
  1296. a.buyer_id = b.id
  1297. where a.salesman_id is null
  1298. <if test="startDate != null">
  1299. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1300. </if>
  1301. <if test="endDate != null">
  1302. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1303. </if>
  1304. <if test="buyerName != null and buyerName != ''">
  1305. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1306. </if>
  1307. <if test="orderStatus != null">
  1308. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1309. </if>
  1310. <if test="orderChannel != null">
  1311. and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
  1312. </if>
  1313. </select>
  1314. <select id="selectSettlementByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1315. select
  1316. a.order_no as orderNo,
  1317. a.order_type as orderType,
  1318. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1319. a.sign_total_amount as signTotalAmount,
  1320. a.actually_total_amount as actuallyTotalAmount,
  1321. a.order_status as orderStatus,
  1322. a.order_stage as orderStage,
  1323. a.project_stage as projectStage,
  1324. a.liquidation_status as liquidationStatus,
  1325. a.approval,
  1326. a.order_channel as orderChannel,
  1327. a.buyer_id as buyerId,
  1328. a.seller_id as sellerId,
  1329. b.nickname as buyerName,
  1330. c.name as salesmanName,
  1331. d.name as financeName,
  1332. e.name as technicianName,
  1333. f.name as departmentName
  1334. from
  1335. t_order a left join user b on
  1336. a.buyer_id = b.id left join admin c on
  1337. a.salesman_id = c.id left join admin d on
  1338. a.finance_id = d.id left join admin e on
  1339. a.technician_id = e.id left join department f on
  1340. c.department_id = f.id
  1341. where a.order_type = 0 and order_status = 3 and delete_sign = 0
  1342. <if test="orderNo != null">
  1343. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1344. </if>
  1345. <if test="financeId != null">
  1346. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1347. </if>
  1348. <if test="startDate != null">
  1349. and a.create_time &gt; #{startDate,jdbcType=TIMESTAMP}
  1350. </if>
  1351. <if test="endDate != null">
  1352. and a.create_time &lt; #{endDate,jdbcType=TIMESTAMP}
  1353. </if>
  1354. <if test="orderStatus != null">
  1355. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1356. </if>
  1357. <if test="liquidationStatus != null">
  1358. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1359. </if>
  1360. <if test="approval != null">
  1361. and a.approval = #{approval,jdbcType=INTEGER}
  1362. </if>
  1363. <if test="isDistributionFinance == 0">
  1364. and a.finance_id is null
  1365. </if>
  1366. <if test="isDistributionFinance == 1">
  1367. and a.finance_id is not null
  1368. </if>
  1369. <if test="buyerName != null and buyerName != ''">
  1370. and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
  1371. </if>
  1372. <if test="depId != null">
  1373. and c.department_id = #{depId,jdbcType=VARCHAR}
  1374. </if>
  1375. <if test="salesmanName != null and salesmanName != ''">
  1376. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1377. </if>
  1378. <if test="financeName != null and financeName != ''">
  1379. and d.name = #{financeName,jdbcType=VARCHAR}
  1380. </if>
  1381. order by a.create_time desc
  1382. <if test="page_sql != null">
  1383. ${page_sql}
  1384. </if>
  1385. </select>
  1386. <select id="selectSettlementCount" resultType="java.lang.Integer">
  1387. select
  1388. count(0)
  1389. from
  1390. t_order a left join user b on
  1391. a.buyer_id = b.id left join admin c on
  1392. a.salesman_id = c.id left join admin d on
  1393. a.finance_id = d.id left join admin e on
  1394. a.technician_id = e.id left join department f on
  1395. c.department_id = f.id
  1396. where a.order_type = 0 and order_status = 3 and delete_sign = 0
  1397. <if test="orderNo != null">
  1398. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1399. </if>
  1400. <if test="financeId != null">
  1401. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1402. </if>
  1403. <if test="startDate != null">
  1404. and a.create_time &gt; #{startDate,jdbcType=TIMESTAMP}
  1405. </if>
  1406. <if test="endDate != null">
  1407. and a.create_time &lt; #{endDate,jdbcType=TIMESTAMP}
  1408. </if>
  1409. <if test="orderStatus != null">
  1410. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1411. </if>
  1412. <if test="liquidationStatus != null">
  1413. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1414. </if>
  1415. <if test="approval != null">
  1416. and a.approval = #{approval,jdbcType=INTEGER}
  1417. </if>
  1418. <if test="isDistributionFinance == 0">
  1419. and a.finance_id is null
  1420. </if>
  1421. <if test="isDistributionFinance == 1">
  1422. and a.finance_id is not null
  1423. </if>
  1424. <if test="buyerName != null and buyerName != ''">
  1425. and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
  1426. </if>
  1427. <if test="depId != null">
  1428. and c.department_id = #{depId,jdbcType=VARCHAR}
  1429. </if>
  1430. <if test="salesmanName != null and salesmanName != ''">
  1431. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1432. </if>
  1433. <if test="financeName != null and financeName != ''">
  1434. and d.name = #{financeName,jdbcType=VARCHAR}
  1435. </if>
  1436. </select>
  1437. <select id="selectBillByPage" resultType="com.goafanti.order.bo.BillListBo">
  1438. select
  1439. a.bill_no as billNo,
  1440. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1441. a.transaction_amount as transactionAmount,
  1442. a.transaction_channel as transactionChannel,
  1443. a.transaction_subject as transactionSubject,
  1444. a.transaction_mode as transactionMode,
  1445. a.financial_pay_no as financialPayNo,
  1446. date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
  1447. a.confirm_sign as confirmSign,
  1448. a.delete_sign as deleteSign,
  1449. date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
  1450. b.order_no as orderNo,
  1451. c.nickname as payeeName,
  1452. d.nickname as payerName,
  1453. e.name as financeName,
  1454. f.name as salesmanName,
  1455. g.name as departmentName
  1456. from
  1457. t_order_bill a left join t_order b on
  1458. a.order_no = b.order_no left join user c on
  1459. a.payee_id = c.id left join user d on
  1460. a.payer_id = d.id left join admin e on
  1461. b.finance_id = e.id left join admin f on
  1462. b.salesman_id = f.id left join department g on
  1463. f.department_id = g.id
  1464. where a.delete_sign = 0
  1465. <if test="orderNo != null and orderNo != ''">
  1466. and b.order_no = #{orderNo,jdbcType=VARCHAR}
  1467. </if>
  1468. <if test="payeeName != null and payeeName != ''">
  1469. and c.nickname = #{payeeName,jdbcType=VARCHAR}
  1470. </if>
  1471. <if test="payerName != null and payerName !=''">
  1472. and d.nickname = #{payerName,jdbcType=VARCHAR}
  1473. </if>
  1474. <if test="salesmanName != null and salesmanName != ''">
  1475. and f.name = #{salesmanName,jdbcType=VARCHAR}
  1476. </if>
  1477. <if test="financeName != null and financeName != ''">
  1478. and e.name = #{financeName,jdbcType=VARCHAR}
  1479. </if>
  1480. <if test="confirmSign != null">
  1481. and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
  1482. </if>
  1483. <if test="deleteSign != null">
  1484. and a.delete_sign = #{deleteSign,jdbcType=INTEGER}
  1485. </if>
  1486. <if test="depId != null and depId != ''">
  1487. and f.department_id = #{depId,jdbcType=VARCHAR}
  1488. </if>
  1489. <if test="isFinance == 0"> <!-- 我的订单流水查询 -->
  1490. and
  1491. (b.salesman_id = #{aid,jdbcType=VARCHAR}
  1492. or
  1493. b.finance_id = #{aid,jdbcType=VARCHAR}
  1494. or
  1495. b.technician_id = #{aid,jdbcType=VARCHAR})
  1496. </if>
  1497. <if test="isFinance == 1"> <!-- 我的结算流水 -->
  1498. and b.finance_id = #{aid,jdbcType=VARCHAR}
  1499. </if>
  1500. order by a.create_time desc
  1501. <if test="page_sql != null">
  1502. ${page_sql}
  1503. </if>
  1504. </select>
  1505. <select id="selectBillCount" resultType="java.lang.Integer">
  1506. select
  1507. count(0)
  1508. from
  1509. t_order_bill a left join t_order b on
  1510. a.order_no = b.order_no left join user c on
  1511. a.payee_id = c.id left join user d on
  1512. a.payer_id = d.id left join admin e on
  1513. b.finance_id = e.id left join admin f on
  1514. b.salesman_id = f.id left join department g on
  1515. f.department_id = g.id
  1516. where a.delete_sign = 0
  1517. <if test="orderNo != null and orderNo != ''">
  1518. and b.order_no = #{orderNo,jdbcType=VARCHAR}
  1519. </if>
  1520. <if test="payeeName != null and payeeName != ''">
  1521. and c.nickname = #{payeeName,jdbcType=VARCHAR}
  1522. </if>
  1523. <if test="payerName != null and payerName !=''">
  1524. and d.nickname = #{payerName,jdbcType=VARCHAR}
  1525. </if>
  1526. <if test="salesmanName != null and salesmanName != ''">
  1527. and f.name = #{salesmanName,jdbcType=VARCHAR}
  1528. </if>
  1529. <if test="financeName != null and financeName != ''">
  1530. and e.name = #{financeName,jdbcType=VARCHAR}
  1531. </if>
  1532. <if test="confirmSign != null">
  1533. and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
  1534. </if>
  1535. <if test="deleteSign != null">
  1536. and a.delete_sign = #{deleteSign,jdbcType=INTEGER}
  1537. </if>
  1538. <if test="depId != null and depId != ''">
  1539. and f.department_id = #{depId,jdbcType=VARCHAR}
  1540. </if>
  1541. <if test="isFinance == 0"> <!-- 我的订单流水查询 -->
  1542. and
  1543. (b.salesman_id = #{aid,jdbcType=VARCHAR}
  1544. or
  1545. b.finance_id = #{aid,jdbcType=VARCHAR}
  1546. or
  1547. b.technician_id = #{aid,jdbcType=VARCHAR})
  1548. </if>
  1549. <if test="isFinance == 1"> <!-- 我的结算流水 -->
  1550. and b.finance_id = #{aid,jdbcType=VARCHAR}
  1551. </if>
  1552. </select>
  1553. <select id="selectBillDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillDetailBo">
  1554. select
  1555. a.bill_no as billNo,
  1556. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1557. a.transaction_amount as transactionAmount,
  1558. a.transaction_channel as transactionChannel,
  1559. a.transaction_subject as transactionSubject,
  1560. a.transaction_mode as transactionMode,
  1561. a.financial_pay_no as financialPayNo,
  1562. date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
  1563. date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
  1564. a.confirm_sign as confirmSign,
  1565. a.delete_sign as deleteSign,
  1566. a.remarks,
  1567. a.postscript,
  1568. b.order_no as orderNo,
  1569. c.nickname as payeeName,
  1570. d.nickname as payerName,
  1571. e.name as financeName,
  1572. f.name as salesmanName,
  1573. g.name as departmentName
  1574. from
  1575. t_order_bill a left join t_order b on
  1576. a.order_no = b.order_no left join user c on
  1577. a.payee_id = c.id left join user d on
  1578. a.payer_id = d.id left join admin e on
  1579. b.finance_id = e.id left join admin f on
  1580. b.salesman_id = f.id left join department g on
  1581. f.department_id = g.id
  1582. where
  1583. a.bill_no = #{billNo,jdbcType=VARCHAR}
  1584. </select>
  1585. <select id="selectSetUpServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1586. select
  1587. a.order_no as orderNo,
  1588. a.order_type as orderType,
  1589. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1590. a.order_status as orderStatus,
  1591. a.project_stage as projectStage,
  1592. a.liquidation_status as liquidationStatus,
  1593. a.approval,
  1594. a.order_channel as orderChannel,
  1595. b.nickname as buyerName,
  1596. c.name as salesmanName,
  1597. d.name as financeName,
  1598. e.name as technicianName,
  1599. f.name as departmentName,
  1600. g.cname as projectType
  1601. from
  1602. t_order a left join user b on
  1603. a.buyer_id = b.id left join admin c on
  1604. a.salesman_id = c.id left join admin d on
  1605. a.finance_id = d.id left join admin e on
  1606. a.technician_id = e.id left join department f on
  1607. c.department_id = f.id left join business_category g on
  1608. a.contract_type = g.id
  1609. where a.order_type = 0 and a.order_status = 3 and project_stage = 1
  1610. and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
  1611. and a.delete_sign=0
  1612. <if test="salesmanId != null">
  1613. and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
  1614. </if>
  1615. <if test="financeId != null">
  1616. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1617. </if>
  1618. <if test="technicianId != null">
  1619. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1620. </if>
  1621. <if test="startDate != null">
  1622. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1623. </if>
  1624. <if test="endDate != null">
  1625. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1626. </if>
  1627. <if test="approval != null">
  1628. and a.approval = #{approval,jdbcType=INTEGER}
  1629. </if>
  1630. <if test="depId != null and depId != ''">
  1631. and f.id = #{depId,jdbcType=VARCHAR}
  1632. </if>
  1633. <if test="buyerName != null and buyerName != ''">
  1634. and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
  1635. </if>
  1636. <if test="salesmanName != null and salesmanName != ''">
  1637. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1638. </if>
  1639. <if test="financeName != null and financeName != ''">
  1640. and d.name = #{financeName,jdbcType=VARCHAR}
  1641. </if>
  1642. order by a.create_time desc
  1643. <if test="page_sql != null">
  1644. ${page_sql}
  1645. </if>
  1646. </select>
  1647. <select id="selectSetUpServiceOrderCount" resultType="java.lang.Integer">
  1648. select
  1649. count(0)
  1650. from
  1651. t_order a left join user b on
  1652. a.buyer_id = b.id left join admin c on
  1653. a.salesman_id = c.id left join admin d on
  1654. a.finance_id = d.id left join admin e on
  1655. a.technician_id = e.id left join department f on
  1656. c.department_id = f.id left join business_category g on
  1657. a.contract_type = g.id
  1658. where a.order_type = 0 and a.order_status = 3 and project_stage = 1
  1659. and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
  1660. <if test="salesmanId != null">
  1661. and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
  1662. </if>
  1663. <if test="financeId != null">
  1664. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1665. </if>
  1666. <if test="technicianId != null">
  1667. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1668. </if>
  1669. <if test="startDate != null">
  1670. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1671. </if>
  1672. <if test="endDate != null">
  1673. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1674. </if>
  1675. <if test="approval != null">
  1676. and a.approval = #{approval,jdbcType=INTEGER}
  1677. </if>
  1678. <if test="depId != null and depId != ''">
  1679. and f.id = #{depId,jdbcType=VARCHAR}
  1680. </if>
  1681. <if test="buyerName != null and buyerName != ''">
  1682. and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
  1683. </if>
  1684. <if test="salesmanName != null and salesmanName != ''">
  1685. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1686. </if>
  1687. <if test="financeName != null and financeName != ''">
  1688. and d.name = #{financeName,jdbcType=VARCHAR}
  1689. </if>
  1690. </select>
  1691. <select id="selectBillByOrderNo" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillListBo">
  1692. select
  1693. a.bill_no as billNo,
  1694. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1695. a.transaction_amount as transactionAmount,
  1696. a.transaction_channel as transactionChannel,
  1697. a.transaction_subject as transactionSubject,
  1698. a.transaction_mode as transactionMode,
  1699. a.financial_pay_no as financialPayNo,
  1700. date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
  1701. a.confirm_sign as confirmSign,
  1702. a.delete_sign as deleteSign,
  1703. date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
  1704. b.order_no as orderNo,
  1705. c.nickname as payeeName,
  1706. d.nickname as payerName,
  1707. e.name as financeName,
  1708. f.name as salesmanName,
  1709. g.name as departmentName
  1710. from
  1711. t_order_bill a left join t_order b on
  1712. a.order_no = b.order_no left join user c on
  1713. a.payee_id = c.id left join user d on
  1714. a.payer_id = d.id left join admin e on
  1715. b.finance_id = e.id left join admin f on
  1716. b.salesman_id = f.id left join department g on
  1717. f.department_id = g.id
  1718. where a.order_no = #{orderNo,jdbcType=VARCHAR} and a.delete_sign = 0
  1719. order by a.create_time desc
  1720. </select>
  1721. <select id="selectByUserName" resultType="java.lang.String">
  1722. select b.nickname from t_order a inner join user b on a.buyer_id =b.id
  1723. where a.order_no= #{orderNo,jdbcType=VARCHAR}
  1724. </select>
  1725. </mapper>