TOrderMapper.xml 63 KB

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