TOrderMapper.xml 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  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_management f on
  1056. c.department_id = f.id
  1057. where a.order_type = 0
  1058. <if test="salesmanId != null">
  1059. and a.salesman_id = #{salesmanId,jdbcType=VARCHAR}
  1060. </if>
  1061. <if test="financeId != null">
  1062. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1063. </if>
  1064. <if test="technicianId != null">
  1065. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1066. </if>
  1067. <if test="startDate != null">
  1068. and a.create_time &gt; #{startDate,jdbcType=TIMESTAMP}
  1069. </if>
  1070. <if test="endDate != null">
  1071. and a.create_time &lt; #{endDate,jdbcType=TIMESTAMP}
  1072. </if>
  1073. <if test="orderStatus != null">
  1074. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1075. </if>
  1076. <if test="projectStage != null">
  1077. and a.project_stage = #{projectStage,jdbcType=INTEGER}
  1078. </if>
  1079. <if test="liquidationStatus != null">
  1080. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1081. </if>
  1082. <if test="orderChannel != null">
  1083. and a.order_channel = #{orderChannel,jdbcType=INTEGER}
  1084. </if>
  1085. <if test="approval != null">
  1086. and a.approval = #{approval,jdbcType=INTEGER}
  1087. </if>
  1088. <if test="buyerName != null and buyerName != ''">
  1089. and b.nickname like concat('%', #{buyerName},'%')
  1090. </if>
  1091. <if test="salesmanName != null and salesmanName != ''">
  1092. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1093. </if>
  1094. <!-- 特殊处理字段 开始 -->
  1095. <if test="intention == 1">
  1096. and a.order_stage = 0
  1097. </if>
  1098. <if test="formal == 1">
  1099. and a.order_stage != 0
  1100. </if>
  1101. <if test="approvalHistory == 0">
  1102. and a.approval = 1
  1103. </if>
  1104. <if test="approvalHistory == 1">
  1105. and a.approval != 0
  1106. </if>
  1107. <if test="depIds != null and depIds != ''">
  1108. and f.id in (${depIds})
  1109. </if>
  1110. order by a.create_time desc
  1111. <!-- 特殊处理字段结束 -->
  1112. <if test="page_sql != null">
  1113. ${page_sql}
  1114. </if>
  1115. </select>
  1116. <select id="selectServiceOrderCount" resultType="java.lang.Integer">
  1117. select
  1118. count(0)
  1119. from
  1120. t_order a left join user b on
  1121. a.buyer_id = b.id left join admin c on
  1122. a.salesman_id = c.id left join admin d on
  1123. a.finance_id = d.id left join admin e on
  1124. a.technician_id = e.id left join department_management f on
  1125. c.department_id = f.id
  1126. where a.order_type = 0
  1127. <if test="salesmanId != null">
  1128. and a.salesman_id = #{salesmanId,jdbcType=VARCHAR}
  1129. </if>
  1130. <if test="financeId != null">
  1131. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1132. </if>
  1133. <if test="technicianId != null">
  1134. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1135. </if>
  1136. <if test="startDate != null">
  1137. and a.create_time &gt; #{startDate,jdbcType=VARCHAR}
  1138. </if>
  1139. <if test="endDate != null">
  1140. and a.create_time &lt; #{endDate,jdbcType=VARCHAR}
  1141. </if>
  1142. <if test="orderStatus != null">
  1143. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1144. </if>
  1145. <if test="confirm == 0">
  1146. and a.order_status = 0
  1147. </if>
  1148. <if test="confirm == 1">
  1149. and a.order_status != 0
  1150. </if>
  1151. <if test="orderStage != null">
  1152. and a.order_stage = #{orderStage,jdbcType=INTEGER}
  1153. </if>
  1154. <if test="liquidationStatus != null">
  1155. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1156. </if>
  1157. <if test="orderChannel != null">
  1158. and a.order_channel =#{orderChannel,jdbcType=INTEGER}
  1159. </if>
  1160. <if test="approval != null">
  1161. and a.approval = #{approval,jdbcType=INTEGER}
  1162. </if>
  1163. <if test="buyerName != null and buyerName != ''">
  1164. and b.nickname like concat('%', #{buyerName},'%')
  1165. </if>
  1166. <if test="salesmanName != null and salesmanName != ''">
  1167. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1168. </if>
  1169. <!-- 特殊处理字段 开始 -->
  1170. <if test="intention == 1">
  1171. and a.order_stage = 0
  1172. </if>
  1173. <if test="formal == 1">
  1174. and a.order_stage != 0
  1175. </if>
  1176. <if test="approvalHistory == 0">
  1177. and a.approval = 1
  1178. </if>
  1179. <if test="approvalHistory == 1">
  1180. and a.approval != 0
  1181. </if>
  1182. <if test="depIds != null and depIds != ''">
  1183. and f.id in (${depIds})
  1184. </if>
  1185. <!-- 特殊处理字段结束 -->
  1186. </select>
  1187. <select id="selectServiceOrderDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.ServiceOrderDetailBo">
  1188. select
  1189. a.order_no as orderNo,
  1190. a.order_type as orderType,
  1191. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1192. date_format(a.sign_time,'%Y-%m-%d') as signTime,
  1193. date_format(a.set_up_time,'%Y-%m-%d %H:%i:%S') as setUpTime,
  1194. date_format(a.settlement_time,'%Y-%m-%d %H:%i:%S') as settlementTime,
  1195. a.order_amount as orderAmount,
  1196. a.first_payment as firstPayment,
  1197. a.sign_total_amount as signTotalAmount,
  1198. a.sign_first_payment as signFirstPayment,
  1199. a.actually_total_amount as actuallyTotalAmount,
  1200. a.order_status as orderStatus,
  1201. a.order_stage as orderStage,
  1202. a.project_stage as projectStage,
  1203. a.delete_sign as deleteSign,
  1204. a.liquidation_status as liquidationStatus,
  1205. a.approval,
  1206. a.order_remarks as orderRemarks,
  1207. a.order_channel as orderChannel,
  1208. a.contract_picture_url as contractPictureUrl,
  1209. a.buyer_id as buyerId,
  1210. a.seller_id as sellerId,
  1211. a.buyer_id as buyerId,
  1212. b.type as buyerType,
  1213. b.nickname as buyerName,
  1214. c.name as salesmanName,
  1215. a.finance_id as financeId,
  1216. d.name as financeName,
  1217. a.technician_id as technicianId,
  1218. e.name as technicianName,
  1219. a.delete_sign as deleteSign,
  1220. a.contract_no as contractNo,
  1221. f.cname as projectType,
  1222. a.change_status as changeStatus
  1223. from
  1224. t_order a left join user b on
  1225. a.buyer_id = b.id left join admin c on
  1226. a.salesman_id = c.id left join admin d on
  1227. a.finance_id = d.id left join admin e on
  1228. a.technician_id = e.id left join business_varieties f on
  1229. a.contract_type = f.id
  1230. where a.order_no = #{orderNo,jdbcType=VARCHAR}
  1231. </select>
  1232. <select id="selectPublicOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1233. select
  1234. a.order_no as orderNo,
  1235. a.order_type as orderType,
  1236. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1237. a.order_amount as orderAmount,
  1238. a.sign_total_amount as signTotalAmount,
  1239. a.order_status as orderStatus,
  1240. a.order_stage as orderStage,
  1241. a.liquidation_status as liquidationStatus,
  1242. a.order_channel as orderChannel,
  1243. b.nickname as buyerName
  1244. from
  1245. t_order a left join user b on
  1246. a.buyer_id = b.id
  1247. where a.salesman_id is null
  1248. <if test="startDate != null">
  1249. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1250. </if>
  1251. <if test="endDate != null">
  1252. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1253. </if>
  1254. <if test="buyerName != null and buyerName != ''">
  1255. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1256. </if>
  1257. <if test="orderType != null">
  1258. and a.order_type = #{orderType,jdbcType=INTEGER}
  1259. </if>
  1260. <if test="orderStatus != null">
  1261. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1262. </if>
  1263. <if test="orderChannel != null">
  1264. and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
  1265. </if>
  1266. <if test="page_sql != null">
  1267. ${page_sql}
  1268. </if>
  1269. </select>
  1270. <select id="selectPublicOrderCount" resultType="java.lang.Integer">
  1271. select
  1272. count(0)
  1273. from
  1274. t_order a left join user b on
  1275. a.buyer_id = b.id
  1276. where a.salesman_id is null
  1277. <if test="startDate != null">
  1278. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1279. </if>
  1280. <if test="endDate != null">
  1281. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1282. </if>
  1283. <if test="buyerName != null and buyerName != ''">
  1284. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1285. </if>
  1286. <if test="orderStatus != null">
  1287. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1288. </if>
  1289. <if test="orderChannel != null">
  1290. and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
  1291. </if>
  1292. </select>
  1293. <select id="selectSettlementByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1294. select
  1295. a.order_no as orderNo,
  1296. a.order_type as orderType,
  1297. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1298. a.sign_total_amount as signTotalAmount,
  1299. a.actually_total_amount as actuallyTotalAmount,
  1300. a.order_status as orderStatus,
  1301. a.order_stage as orderStage,
  1302. a.project_stage as projectStage,
  1303. a.liquidation_status as liquidationStatus,
  1304. a.approval,
  1305. a.order_channel as orderChannel,
  1306. a.buyer_id as buyerId,
  1307. a.seller_id as sellerId,
  1308. b.nickname as buyerName,
  1309. c.name as salesmanName,
  1310. d.name as financeName,
  1311. e.name as technicianName,
  1312. f.name as departmentName
  1313. from
  1314. t_order a left join user b on
  1315. a.buyer_id = b.id left join admin c on
  1316. a.salesman_id = c.id left join admin d on
  1317. a.finance_id = d.id left join admin e on
  1318. a.technician_id = e.id left join department_management f on
  1319. c.department_id = f.id
  1320. where a.order_type = 0 and order_status = 3 and delete_sign = 0
  1321. <if test="orderNo != null">
  1322. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1323. </if>
  1324. <if test="financeId != null">
  1325. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1326. </if>
  1327. <if test="startDate != null">
  1328. and a.create_time &gt; #{startDate,jdbcType=TIMESTAMP}
  1329. </if>
  1330. <if test="endDate != null">
  1331. and a.create_time &lt; #{endDate,jdbcType=TIMESTAMP}
  1332. </if>
  1333. <if test="orderStatus != null">
  1334. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1335. </if>
  1336. <if test="liquidationStatus != null">
  1337. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1338. </if>
  1339. <if test="approval != null">
  1340. and a.approval = #{approval,jdbcType=INTEGER}
  1341. </if>
  1342. <if test="isDistributionFinance == 0">
  1343. and a.finance_id is null
  1344. </if>
  1345. <if test="isDistributionFinance == 1">
  1346. and a.finance_id is not null
  1347. </if>
  1348. <if test="buyerName != null and buyerName != ''">
  1349. and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
  1350. </if>
  1351. <if test="depId != null">
  1352. and c.department_id = #{depId,jdbcType=VARCHAR}
  1353. </if>
  1354. <if test="salesmanName != null and salesmanName != ''">
  1355. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1356. </if>
  1357. <if test="financeName != null and financeName != ''">
  1358. and d.name = #{financeName,jdbcType=VARCHAR}
  1359. </if>
  1360. order by a.create_time desc
  1361. <if test="page_sql != null">
  1362. ${page_sql}
  1363. </if>
  1364. </select>
  1365. <select id="selectSettlementCount" resultType="java.lang.Integer">
  1366. select
  1367. count(0)
  1368. from
  1369. t_order a left join user b on
  1370. a.buyer_id = b.id left join admin c on
  1371. a.salesman_id = c.id left join admin d on
  1372. a.finance_id = d.id left join admin e on
  1373. a.technician_id = e.id left join department_management f on
  1374. c.department_id = f.id
  1375. where a.order_type = 0 and order_status = 3 and delete_sign = 0
  1376. <if test="orderNo != null">
  1377. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1378. </if>
  1379. <if test="financeId != null">
  1380. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1381. </if>
  1382. <if test="startDate != null">
  1383. and a.create_time &gt; #{startDate,jdbcType=TIMESTAMP}
  1384. </if>
  1385. <if test="endDate != null">
  1386. and a.create_time &lt; #{endDate,jdbcType=TIMESTAMP}
  1387. </if>
  1388. <if test="orderStatus != null">
  1389. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1390. </if>
  1391. <if test="liquidationStatus != null">
  1392. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1393. </if>
  1394. <if test="approval != null">
  1395. and a.approval = #{approval,jdbcType=INTEGER}
  1396. </if>
  1397. <if test="isDistributionFinance == 0">
  1398. and a.finance_id is null
  1399. </if>
  1400. <if test="isDistributionFinance == 1">
  1401. and a.finance_id is not null
  1402. </if>
  1403. <if test="buyerName != null and buyerName != ''">
  1404. and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
  1405. </if>
  1406. <if test="depId != null">
  1407. and c.department_id = #{depId,jdbcType=VARCHAR}
  1408. </if>
  1409. <if test="salesmanName != null and salesmanName != ''">
  1410. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1411. </if>
  1412. <if test="financeName != null and financeName != ''">
  1413. and d.name = #{financeName,jdbcType=VARCHAR}
  1414. </if>
  1415. </select>
  1416. <select id="selectBillByPage" resultType="com.goafanti.order.bo.BillListBo">
  1417. select
  1418. a.bill_no as billNo,
  1419. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1420. a.transaction_amount as transactionAmount,
  1421. a.transaction_channel as transactionChannel,
  1422. a.transaction_subject as transactionSubject,
  1423. a.transaction_mode as transactionMode,
  1424. a.financial_pay_no as financialPayNo,
  1425. date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
  1426. a.confirm_sign as confirmSign,
  1427. a.delete_sign as deleteSign,
  1428. date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
  1429. b.order_no as orderNo,
  1430. c.nickname as payeeName,
  1431. d.nickname as payerName,
  1432. e.name as financeName,
  1433. f.name as salesmanName,
  1434. g.name as departmentName
  1435. from
  1436. t_order_bill a left join t_order b on
  1437. a.order_no = b.order_no left join user c on
  1438. a.payee_id = c.id left join user d on
  1439. a.payer_id = d.id left join admin e on
  1440. b.finance_id = e.id left join admin f on
  1441. b.salesman_id = f.id left join department_management g on
  1442. f.department_id = g.id
  1443. where a.delete_sign = 0
  1444. <if test="orderNo != null and orderNo != ''">
  1445. and b.order_no = #{orderNo,jdbcType=VARCHAR}
  1446. </if>
  1447. <if test="payeeName != null and payeeName != ''">
  1448. and c.nickname = #{payeeName,jdbcType=VARCHAR}
  1449. </if>
  1450. <if test="payerName != null and payerName !=''">
  1451. and d.nickname = #{payerName,jdbcType=VARCHAR}
  1452. </if>
  1453. <if test="salesmanName != null and salesmanName != ''">
  1454. and f.name = #{salesmanName,jdbcType=VARCHAR}
  1455. </if>
  1456. <if test="financeName != null and financeName != ''">
  1457. and e.name = #{financeName,jdbcType=VARCHAR}
  1458. </if>
  1459. <if test="confirmSign != null">
  1460. and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
  1461. </if>
  1462. <if test="deleteSign != null">
  1463. and a.delete_sign = #{deleteSign,jdbcType=INTEGER}
  1464. </if>
  1465. <if test="depId != null and depId != ''">
  1466. and f.department_id = #{depId,jdbcType=VARCHAR}
  1467. </if>
  1468. <if test="isFinance == 0"> <!-- 我的订单流水查询 -->
  1469. and
  1470. (b.salesman_id = #{aid,jdbcType=VARCHAR}
  1471. or
  1472. b.finance_id = #{aid,jdbcType=VARCHAR}
  1473. or
  1474. b.technician_id = #{aid,jdbcType=VARCHAR})
  1475. </if>
  1476. <if test="isFinance == 1"> <!-- 我的结算流水 -->
  1477. and b.finance_id = #{aid,jdbcType=VARCHAR}
  1478. </if>
  1479. order by a.create_time desc
  1480. <if test="page_sql != null">
  1481. ${page_sql}
  1482. </if>
  1483. </select>
  1484. <select id="selectBillCount" resultType="java.lang.Integer">
  1485. select
  1486. count(0)
  1487. from
  1488. t_order_bill a left join t_order b on
  1489. a.order_no = b.order_no left join user c on
  1490. a.payee_id = c.id left join user d on
  1491. a.payer_id = d.id left join admin e on
  1492. b.finance_id = e.id left join admin f on
  1493. b.salesman_id = f.id left join department_management g on
  1494. f.department_id = g.id
  1495. where a.delete_sign = 0
  1496. <if test="orderNo != null and orderNo != ''">
  1497. and b.order_no = #{orderNo,jdbcType=VARCHAR}
  1498. </if>
  1499. <if test="payeeName != null and payeeName != ''">
  1500. and c.nickname = #{payeeName,jdbcType=VARCHAR}
  1501. </if>
  1502. <if test="payerName != null and payerName !=''">
  1503. and d.nickname = #{payerName,jdbcType=VARCHAR}
  1504. </if>
  1505. <if test="salesmanName != null and salesmanName != ''">
  1506. and f.name = #{salesmanName,jdbcType=VARCHAR}
  1507. </if>
  1508. <if test="financeName != null and financeName != ''">
  1509. and e.name = #{financeName,jdbcType=VARCHAR}
  1510. </if>
  1511. <if test="confirmSign != null">
  1512. and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
  1513. </if>
  1514. <if test="deleteSign != null">
  1515. and a.delete_sign = #{deleteSign,jdbcType=INTEGER}
  1516. </if>
  1517. <if test="depId != null and depId != ''">
  1518. and f.department_id = #{depId,jdbcType=VARCHAR}
  1519. </if>
  1520. <if test="isFinance == 0"> <!-- 我的订单流水查询 -->
  1521. and
  1522. (b.salesman_id = #{aid,jdbcType=VARCHAR}
  1523. or
  1524. b.finance_id = #{aid,jdbcType=VARCHAR}
  1525. or
  1526. b.technician_id = #{aid,jdbcType=VARCHAR})
  1527. </if>
  1528. <if test="isFinance == 1"> <!-- 我的结算流水 -->
  1529. and b.finance_id = #{aid,jdbcType=VARCHAR}
  1530. </if>
  1531. </select>
  1532. <select id="selectBillDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillDetailBo">
  1533. select
  1534. a.bill_no as billNo,
  1535. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1536. a.transaction_amount as transactionAmount,
  1537. a.transaction_channel as transactionChannel,
  1538. a.transaction_subject as transactionSubject,
  1539. a.transaction_mode as transactionMode,
  1540. a.financial_pay_no as financialPayNo,
  1541. date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
  1542. date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
  1543. a.confirm_sign as confirmSign,
  1544. a.delete_sign as deleteSign,
  1545. a.remarks,
  1546. a.postscript,
  1547. b.order_no as orderNo,
  1548. c.nickname as payeeName,
  1549. d.nickname as payerName,
  1550. e.name as financeName,
  1551. f.name as salesmanName,
  1552. g.name as departmentName
  1553. from
  1554. t_order_bill a left join t_order b on
  1555. a.order_no = b.order_no left join user c on
  1556. a.payee_id = c.id left join user d on
  1557. a.payer_id = d.id left join admin e on
  1558. b.finance_id = e.id left join admin f on
  1559. b.salesman_id = f.id left join department_management g on
  1560. f.department_id = g.id
  1561. where
  1562. a.bill_no = #{billNo,jdbcType=VARCHAR}
  1563. </select>
  1564. <select id="selectSetUpServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1565. select
  1566. a.order_no as orderNo,
  1567. a.order_type as orderType,
  1568. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1569. a.order_status as orderStatus,
  1570. a.project_stage as projectStage,
  1571. a.liquidation_status as liquidationStatus,
  1572. a.approval,
  1573. a.order_channel as orderChannel,
  1574. b.nickname as buyerName,
  1575. c.name as salesmanName,
  1576. d.name as financeName,
  1577. e.name as technicianName,
  1578. f.name as departmentName,
  1579. g.cname as projectType
  1580. from
  1581. t_order a left join user b on
  1582. a.buyer_id = b.id left join admin c on
  1583. a.salesman_id = c.id left join admin d on
  1584. a.finance_id = d.id left join admin e on
  1585. a.technician_id = e.id left join department_management f on
  1586. c.department_id = f.id left join business_varieties g on
  1587. a.contract_type = g.id
  1588. where a.order_type = 0 and a.order_status = 3 and project_stage = 1
  1589. and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
  1590. and a.delete_sign=0
  1591. <if test="salesmanId != null">
  1592. and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
  1593. </if>
  1594. <if test="financeId != null">
  1595. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1596. </if>
  1597. <if test="technicianId != null">
  1598. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1599. </if>
  1600. <if test="startDate != null">
  1601. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1602. </if>
  1603. <if test="endDate != null">
  1604. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1605. </if>
  1606. <if test="approval != null">
  1607. and a.approval = #{approval,jdbcType=INTEGER}
  1608. </if>
  1609. <if test="depId != null and depId != ''">
  1610. and f.id = #{depId,jdbcType=VARCHAR}
  1611. </if>
  1612. <if test="buyerName != null and buyerName != ''">
  1613. and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
  1614. </if>
  1615. <if test="salesmanName != null and salesmanName != ''">
  1616. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1617. </if>
  1618. <if test="financeName != null and financeName != ''">
  1619. and d.name = #{financeName,jdbcType=VARCHAR}
  1620. </if>
  1621. order by a.create_time desc
  1622. <if test="page_sql != null">
  1623. ${page_sql}
  1624. </if>
  1625. </select>
  1626. <select id="selectSetUpServiceOrderCount" resultType="java.lang.Integer">
  1627. select
  1628. count(0)
  1629. from
  1630. t_order a left join user b on
  1631. a.buyer_id = b.id left join admin c on
  1632. a.salesman_id = c.id left join admin d on
  1633. a.finance_id = d.id left join admin e on
  1634. a.technician_id = e.id left join department_management f on
  1635. c.department_id = f.id left join business_varieties g on
  1636. a.contract_type = g.id
  1637. where a.order_type = 0 and a.order_status = 3 and project_stage = 1
  1638. and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
  1639. <if test="salesmanId != null">
  1640. and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
  1641. </if>
  1642. <if test="financeId != null">
  1643. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1644. </if>
  1645. <if test="technicianId != null">
  1646. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1647. </if>
  1648. <if test="startDate != null">
  1649. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1650. </if>
  1651. <if test="endDate != null">
  1652. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1653. </if>
  1654. <if test="approval != null">
  1655. and a.approval = #{approval,jdbcType=INTEGER}
  1656. </if>
  1657. <if test="depId != null and depId != ''">
  1658. and f.id = #{depId,jdbcType=VARCHAR}
  1659. </if>
  1660. <if test="buyerName != null and buyerName != ''">
  1661. and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
  1662. </if>
  1663. <if test="salesmanName != null and salesmanName != ''">
  1664. and c.name = #{salesmanName,jdbcType=VARCHAR}
  1665. </if>
  1666. <if test="financeName != null and financeName != ''">
  1667. and d.name = #{financeName,jdbcType=VARCHAR}
  1668. </if>
  1669. </select>
  1670. <select id="selectBillByOrderNo" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillListBo">
  1671. select
  1672. a.bill_no as billNo,
  1673. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1674. a.transaction_amount as transactionAmount,
  1675. a.transaction_channel as transactionChannel,
  1676. a.transaction_subject as transactionSubject,
  1677. a.transaction_mode as transactionMode,
  1678. a.financial_pay_no as financialPayNo,
  1679. date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
  1680. a.confirm_sign as confirmSign,
  1681. a.delete_sign as deleteSign,
  1682. date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
  1683. b.order_no as orderNo,
  1684. c.nickname as payeeName,
  1685. d.nickname as payerName,
  1686. e.name as financeName,
  1687. f.name as salesmanName,
  1688. g.name as departmentName
  1689. from
  1690. t_order_bill a left join t_order b on
  1691. a.order_no = b.order_no left join user c on
  1692. a.payee_id = c.id left join user d on
  1693. a.payer_id = d.id left join admin e on
  1694. b.finance_id = e.id left join admin f on
  1695. b.salesman_id = f.id left join department_management g on
  1696. f.department_id = g.id
  1697. where a.order_no = #{orderNo,jdbcType=VARCHAR} and a.delete_sign = 0
  1698. order by a.create_time desc
  1699. </select>
  1700. </mapper>