TOrderMapper.xml 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447
  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 intention_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
  903. </when>
  904. <otherwise>
  905. and intention_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 intention_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
  920. </when>
  921. <otherwise>
  922. and intention_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_type as commodityType,
  965. commodity_mode as commodityMode,
  966. discount_price as discountPrice
  967. from
  968. t_order_detail
  969. where
  970. order_no = #{orderNo,jdbcType=VARCHAR}
  971. </select>
  972. <select id="selectServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
  973. select
  974. a.order_no as orderNo,
  975. a.order_type as orderType,
  976. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  977. a.sign_total_amount as signTotalAmount,
  978. a.order_status as orderStatus,
  979. a.order_stage as orderStage,
  980. a.liquidation_status as liquidationStatus,
  981. a.approval,
  982. a.order_channel as orderChannel,
  983. b.nickname as buyerName,
  984. c.name as salesmanName,
  985. d.name as financeName,
  986. e.name as technicianName,
  987. f.departmentName
  988. from
  989. t_order a left join user b on
  990. a.buyer_id = b.id left join admin c on
  991. a.salesman_id = c.id left join admin d on
  992. a.finance_id = d.id left join admin e on
  993. a.technician_id = e.id left join department_management f on
  994. d.department_id = f.id
  995. where a.type = 0
  996. <if test="salesmanId != null">
  997. and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
  998. </if>
  999. <if test="financeId != null">
  1000. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1001. </if>
  1002. <if test="technicianId != null">
  1003. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1004. </if>
  1005. <if test="startDate != null">
  1006. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1007. </if>
  1008. <if test="endDate != null">
  1009. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1010. </if>
  1011. <if test="buyerName != null and buyerName != ''">
  1012. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1013. </if>
  1014. <if test="orderStatus != null">
  1015. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1016. </if>
  1017. <if test="projectStage != null">
  1018. and a.project_stage = #{projectStage,jdbcType=INTEGER}
  1019. </if>
  1020. <if test="liquidationStatus != null">
  1021. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1022. </if>
  1023. <if test="orderChannel != null">
  1024. and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
  1025. </if>
  1026. <if test="approval != null">
  1027. and a.approval = #{approval,jdbcType=INTEGER}
  1028. </if>
  1029. <!-- 特殊处理字段 开始 -->
  1030. <if test="intention == 1">
  1031. and a.order_stage = 0
  1032. </if>
  1033. <if test="formal == 1">
  1034. and a.order_stage != 0
  1035. </if>
  1036. <if test="approvalHistory == 0">
  1037. and a.approval = 1
  1038. </if>
  1039. <if test="approvalHistory == 1">
  1040. and a.approval != 0
  1041. </if>
  1042. <if test="depIds != null and depIds != ''">
  1043. and f.id in #{depIds,jdbcType=VARCHAR}
  1044. </if>
  1045. <!-- 特殊处理字段结束 -->
  1046. <if test="page_sql != null">
  1047. ${page_sql}
  1048. </if>
  1049. </select>
  1050. <select id="selectServiceOrderByPage" resultType="java.lang.Integer">
  1051. select
  1052. count(0)
  1053. from
  1054. t_order a left join user b on
  1055. a.buyer_id = b.id left join admin c on
  1056. a.salesman_id = c.id left join admin d on
  1057. a.finance_id = d.id left join admin e on
  1058. a.technician_id = e.id left join department_management f on
  1059. d.department_id = f.id
  1060. where a.type = 0
  1061. <if test="salesmanId != null">
  1062. and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
  1063. </if>
  1064. <if test="financeId != null">
  1065. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1066. </if>
  1067. <if test="technicianId != null">
  1068. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1069. </if>
  1070. <if test="startDate != null">
  1071. and a.create_time &gt; #{a.startDate,jdbcType=STRING}
  1072. </if>
  1073. <if test="endDate != null">
  1074. and a.create_time &lt; #{a.endDate,jdbcType=STRING}
  1075. </if>
  1076. <if test="buyerName != null and buyerName != ''">
  1077. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1078. </if>
  1079. <if test="orderStatus != null">
  1080. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1081. </if>
  1082. <if test="confirm == 0">
  1083. and a.order_status = 0
  1084. </if>
  1085. <if test="confirm == 1">
  1086. and a.order_status != 0
  1087. </if>
  1088. <if test="orderStage != null">
  1089. and a.order_stage = #{orderStage,jdbcType=INTEGER}
  1090. </if>
  1091. <if test="liquidationStatus != null">
  1092. and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
  1093. </if>
  1094. <if test="orderChannel != null">
  1095. and.orderChannel =#{orderChannel,jdbcType=INTEGER}
  1096. </if>
  1097. <if test="approval != null">
  1098. and a.approval = #{approval,jdbcType=INTEGER}
  1099. </if>
  1100. <!-- 特殊处理字段 开始 -->
  1101. <if test="intention == 1">
  1102. and a.order_stage = 0
  1103. </if>
  1104. <if test="formal == 1">
  1105. and a.order_stage != 0
  1106. </if>
  1107. <if test="approvalHistory == 0">
  1108. and a.approval = 1
  1109. </if>
  1110. <if test="approvalHistory == 1">
  1111. and a.approval != 0
  1112. </if>
  1113. <if test="depIds != null and depIds != ''">
  1114. and f.id in #{depIds,jdbcType=VARCHAR}
  1115. </if>
  1116. <!-- 特殊处理字段结束 -->
  1117. </select>
  1118. <select id="selectServiceOrderDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.ServiceOrderDetailBo">
  1119. select
  1120. a.order_no as orderNo,
  1121. a.order_type as orderType,
  1122. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1123. date_format(a.sign_time,'%Y-%m-%d %H:%i:%S') as signTime,
  1124. date_format(a.set_up_time,'%Y-%m-%d %H:%i:%S') as setUpTime,
  1125. date_format(a.settlement_time,'%Y-%m-%d %H:%i:%S') as settlementTime,
  1126. a.order_amount as orderAmount,
  1127. a.order_status as orderStatus,
  1128. a.order_stage as orderStage,
  1129. a.liquidation_status as liquidationStatus,
  1130. a.approval,
  1131. a.order_remarks as orderRemarks,
  1132. a.order_channel as orderChannel,
  1133. a.contract_picture_url as contractPictureUrl,
  1134. b.nickname as buyerName,
  1135. c.name as salesmanName,
  1136. d.name as financeName,
  1137. e.name as technicianName
  1138. from
  1139. t_order a left join user b on
  1140. a.buyer_id = b.id left join admin c on
  1141. a.salesman_id = c.id left join admin d on
  1142. a.finance_id = d.id left join admin e on
  1143. a.technician_id = e.id
  1144. where a.order_no = #{orderNo,jdbcType=STRING}
  1145. </select>
  1146. <select id="selectPublicOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1147. select
  1148. a.order_no as orderNo,
  1149. a.order_type as orderType,
  1150. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1151. a.order_amount as orderAmount,
  1152. a.sign_total_amount as signTotalAmount,
  1153. a.order_status as orderStatus,
  1154. a.order_stage as orderStage,
  1155. a.liquidation_status as liquidationStatus,
  1156. a.order_channel as orderChannel,
  1157. b.nickname as buyerName
  1158. from
  1159. t_order a left join user b on
  1160. a.buyer_id = b.id
  1161. where a.salesman_id is null
  1162. <if test="startDate != null">
  1163. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1164. </if>
  1165. <if test="endDate != null">
  1166. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1167. </if>
  1168. <if test="buyerName != null and buyerName != ''">
  1169. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1170. </if>
  1171. <if test="orderStatus != null">
  1172. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1173. </if>
  1174. <if test="orderChannel != null">
  1175. and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
  1176. </if>
  1177. <if test="page_sql != null">
  1178. ${page_sql}
  1179. </if>
  1180. </select>
  1181. <select id="selectPublicOrderCount" resultType="java.lang.Integer">
  1182. select
  1183. count(0)
  1184. from
  1185. t_order a left join user b on
  1186. a.buyer_id = b.id
  1187. where a.salesman_id is null
  1188. <if test="startDate != null">
  1189. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1190. </if>
  1191. <if test="endDate != null">
  1192. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1193. </if>
  1194. <if test="buyerName != null and buyerName != ''">
  1195. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1196. </if>
  1197. <if test="orderStatus != null">
  1198. and a.order_status = #{orderStatus,jdbcType=INTEGER}
  1199. </if>
  1200. <if test="orderChannel != null">
  1201. and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
  1202. </if>
  1203. </select>
  1204. <select id="selectBillByPage" resultType="com.goafanti.order.bo.BillListBo">
  1205. select
  1206. a.bill_no as billNo,
  1207. a.create_time as createTime,
  1208. a.transaction_amount as transactionAmount,
  1209. a.transaction_channel as transactionChannel,
  1210. a.transaction_subject as transactionSubject,
  1211. a.transaction_mode as transactionMode,
  1212. a.financial_pay_no as financialPayNo,
  1213. a.financial_pay_time as financialPayTime,
  1214. a.confirm_sign as confirmSign,
  1215. a.delete_sign as deleteSign,
  1216. b.order_no as orderNo,
  1217. c.name as payeeName,
  1218. d.name as payerName,
  1219. e.name as financeName,
  1220. f.name as salesmanName,
  1221. g.name as departmentName
  1222. from
  1223. t_order_bill a left join t_order b on
  1224. a.order_no = b.order_no left join user c on
  1225. a.payee_id = c.id left join user d on
  1226. a.payer_id = d.id left join admin e on
  1227. b.finance_id = e.id left join admin f on
  1228. b.salesman_id = f.id left join department_management g on
  1229. f.department_id = g.id
  1230. where 1=1
  1231. <if test="payeeName != null and payeeName != ''">
  1232. and c.name = #{payeeName,jdbcType=VARCHAR}
  1233. </if>
  1234. <if test="payerName != null and payerName !=''">
  1235. and d.name = #{payerName,jdbcType=VARCHAR}
  1236. </if>
  1237. <if test="salesmanName != null and salesmanName != ''">
  1238. and f.name = #{salesmanName,jdbcType=VARCHAR}
  1239. </if>
  1240. <if test="financeName != null and financeName != ''">
  1241. and e.name = #{financeName,jdbcType=VARCHAR}
  1242. </if>
  1243. <if test="confirmSign != null">
  1244. and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
  1245. </if>
  1246. <if test="deleteSign != null">
  1247. and a.delete_sign = #{deleteSign,jdbcType=VARCHAR}
  1248. </if>
  1249. <if test="depId != null and depId != ''">
  1250. and f.department_id = #{depId,jdbcType=VARCHAR}
  1251. </if>
  1252. <if test="isFinance == 0"> <!-- 我的订单流水查询 -->
  1253. and
  1254. (b.salesman_id = #{aid,jdbcType=VARCHAR}
  1255. or
  1256. b.finance_id = #{aid,jdbcType=VARCHAR}
  1257. or
  1258. b.technician_id = #{aid,jdbcType=VARCHAR})
  1259. </if>
  1260. <if test="isFinance == 1"> <!-- 我的结算流水 -->
  1261. and b.finance_id = #{aid,jdbcType=VARCHAR}
  1262. </if>
  1263. <if test="page_sql != null">
  1264. ${page_sql}
  1265. </if>
  1266. </select>
  1267. <select id="selectBillCount" resultType="java.lang.Integer">
  1268. select
  1269. count(0)
  1270. from
  1271. t_order_bill a left join t_order b on
  1272. a.order_no = b.order_no left join user c on
  1273. a.payee_id = c.id left join user d on
  1274. a.payer_id = d.id left join admin e on
  1275. b.finance_id = e.id left join admin f on
  1276. b.salesman_id = f.id left join department_management g on
  1277. f.department_id = g.id
  1278. where 1=1
  1279. <if test="payeeName != null and payeeName != ''">
  1280. and c.name = #{payeeName,jdbcType=VARCHAR}
  1281. </if>
  1282. <if test="payerName != null and payerName !=''">
  1283. and d.name = #{payerName,jdbcType=VARCHAR}
  1284. </if>
  1285. <if test="salesmanName != null and salesmanName != ''">
  1286. and f.name = #{salesmanName,jdbcType=VARCHAR}
  1287. </if>
  1288. <if test="financeName != null and financeName != ''">
  1289. and e.name = #{financeName,jdbcType=VARCHAR}
  1290. </if>
  1291. <if test="confirmSign != null">
  1292. and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
  1293. </if>
  1294. <if test="deleteSign != null">
  1295. and a.delete_sign = #{deleteSign,jdbcType=VARCHAR}
  1296. </if>
  1297. <if test="depId != null and depId != ''">
  1298. and f.department_id = #{depId,jdbcType=VARCHAR}
  1299. </if>
  1300. <if test="isFinance == 0"> <!-- 我的订单流水查询 -->
  1301. and
  1302. (b.salesman_id = #{aid,jdbcType=VARCHAR}
  1303. or
  1304. b.finance_id = #{aid,jdbcType=VARCHAR}
  1305. or
  1306. b.technician_id = #{aid,jdbcType=VARCHAR})
  1307. </if>
  1308. <if test="isFinance == 1"> <!-- 我的结算流水 -->
  1309. and b.finance_id = #{aid,jdbcType=VARCHAR}
  1310. </if>
  1311. </select>
  1312. <select id="selectBillDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillDetailBo">
  1313. select
  1314. a.bill_no as billNo,
  1315. a.create_time as createTime,
  1316. a.transaction_amount as transactionAmount,
  1317. a.transaction_channel as transactionChannel,
  1318. a.transaction_subject as transactionSubject,
  1319. a.transaction_mode as transactionMode,
  1320. a.financial_pay_no as financialPayNo,
  1321. a.financial_pay_time as financialPayTime,
  1322. a.confirm_sign as confirmSign,
  1323. a.delete_sign as deleteSign,
  1324. a.remarks,
  1325. a.postscript,
  1326. b.order_no as orderNo,
  1327. c.name as payeeName,
  1328. d.name as payerName,
  1329. e.name as financeName,
  1330. f.name as salesmanName,
  1331. g.name as departmentName
  1332. from
  1333. t_order_bill a left join t_order b on
  1334. a.order_no = b.order_no left join user c on
  1335. a.payee_id = c.id left join user d on
  1336. a.payer_id = d.id left join admin e on
  1337. b.finance_id = e.id left join admin f on
  1338. b.salesman_id = f.id left join department_management g on
  1339. f.department_id = g.id
  1340. where
  1341. a.bill_no = #{billNo,jdbcType=VARCHAR}
  1342. </select>
  1343. <select id="selectSetUpProjectByPage" resultType="com.goafanti.order.bo.OrderListBo">
  1344. select
  1345. a.order_no as orderNo,
  1346. a.order_type as orderType,
  1347. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1348. a.order_status as orderStatus,
  1349. a.liquidation_status as liquidationStatus,
  1350. a.approval,
  1351. a.order_channel as orderChannel,
  1352. b.nickname as buyerName,
  1353. c.name as salesmanName,
  1354. d.name as financeName,
  1355. e.name as technicianName,
  1356. f.departmentName
  1357. from
  1358. t_order a left join user b on
  1359. a.buyer_id = b.id left join admin c on
  1360. a.salesman_id = c.id left join admin d on
  1361. a.finance_id = d.id left join admin e on
  1362. a.technician_id = e.id left join department_management f on
  1363. d.department_id = f.id
  1364. where a.type = 0 and a.order_status = 3
  1365. and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
  1366. <if test="salesmanId != null">
  1367. and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
  1368. </if>
  1369. <if test="financeId != null">
  1370. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1371. </if>
  1372. <if test="technicianId != null">
  1373. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1374. </if>
  1375. <if test="startDate != null">
  1376. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1377. </if>
  1378. <if test="endDate != null">
  1379. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1380. </if>
  1381. <if test="buyerName != null and buyerName != ''">
  1382. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1383. </if>
  1384. <if test="approval != null">
  1385. and a.approval = #{approval,jdbcType=INTEGER}
  1386. </if>
  1387. <if test="depId != null and depId != ''">
  1388. and f.id = #{depId,jdbcType=VARCHAR}
  1389. </if>
  1390. <if test="page_sql != null">
  1391. ${page_sql}
  1392. </if>
  1393. </select>
  1394. <select id="selectSetUpProjectCount" resultType="java.lang.Integer">
  1395. select
  1396. count(0)
  1397. from
  1398. t_order a left join user b on
  1399. a.buyer_id = b.id left join admin c on
  1400. a.salesman_id = c.id left join admin d on
  1401. a.finance_id = d.id left join admin e on
  1402. a.technician_id = e.id left join department_management f on
  1403. d.department_id = f.id
  1404. where a.type = 0 and a.order_status = 3
  1405. and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
  1406. <if test="salesmanId != null">
  1407. and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
  1408. </if>
  1409. <if test="financeId != null">
  1410. and a.finance_id = #{financeId,jdbcType=VARCHAR}
  1411. </if>
  1412. <if test="technicianId != null">
  1413. and a.technician_id = #{technicianId,jdbcType=VARCHAR}
  1414. </if>
  1415. <if test="startDate != null">
  1416. and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
  1417. </if>
  1418. <if test="endDate != null">
  1419. and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
  1420. </if>
  1421. <if test="buyerName != null and buyerName != ''">
  1422. and b.nickname = #{buyerName,jdbcType=VARCHAR}
  1423. </if>
  1424. <if test="approval != null">
  1425. and a.approval = #{approval,jdbcType=INTEGER}
  1426. </if>
  1427. <if test="depId != null and depId != ''">
  1428. and f.id = #{depId,jdbcType=VARCHAR}
  1429. </if>
  1430. <if test="page_sql != null">
  1431. ${page_sql}
  1432. </if>
  1433. </select>
  1434. </mapper>