TOrderMapper.xml 67 KB

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