TOrderMapper.xml 66 KB

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