TOrderMapper.xml 66 KB

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