TOrderMapper.xml 63 KB

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