TOrderNewMapper.xml 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342
  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.TOrderNewMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderNew">
  5. <!--
  6. WARNING - @mbggenerated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Fri Nov 23 15:27:45 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="first_amount" jdbcType="DECIMAL" property="firstAmount" />
  17. <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
  18. <result column="settlement_amount" jdbcType="DECIMAL" property="settlementAmount" />
  19. <result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
  20. <result column="order_status" jdbcType="INTEGER" property="orderStatus" />
  21. <result column="liquidation_status" jdbcType="INTEGER" property="liquidationStatus" />
  22. <result column="process_status" jdbcType="INTEGER" property="processStatus" />
  23. <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
  24. <result column="approval" jdbcType="INTEGER" property="approval" />
  25. <result column="order_remarks" jdbcType="VARCHAR" property="orderRemarks" />
  26. <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
  27. <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
  28. <result column="finance_id" jdbcType="VARCHAR" property="financeId" />
  29. <result column="technician_id" jdbcType="VARCHAR" property="technicianId" />
  30. <result column="sign_time" jdbcType="DATE" property="signTime" />
  31. <result column="settlement_time" jdbcType="DATE" property="settlementTime" />
  32. <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
  33. <result column="contract_type" jdbcType="VARCHAR" property="contractType" />
  34. <result column="contacts" jdbcType="VARCHAR" property="contacts" />
  35. <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
  36. <result column="legal_person" jdbcType="VARCHAR" property="legalPerson" />
  37. <result column="legal_person_tel" jdbcType="VARCHAR" property="legalPersonTel" />
  38. <result column="proof_count" jdbcType="REAL" property="proofCount" />
  39. <result column="proof_aid" jdbcType="VARCHAR" property="proofAid" />
  40. </resultMap>
  41. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrderNew">
  42. <!--
  43. WARNING - @mbggenerated
  44. This element is automatically generated by MyBatis Generator, do not modify.
  45. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  46. -->
  47. <result column="contract_picture_url" jdbcType="LONGVARCHAR" property="contractPictureUrl" />
  48. </resultMap>
  49. <sql id="Example_Where_Clause">
  50. <!--
  51. WARNING - @mbggenerated
  52. This element is automatically generated by MyBatis Generator, do not modify.
  53. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  54. -->
  55. <where>
  56. <foreach collection="oredCriteria" item="criteria" separator="or">
  57. <if test="criteria.valid">
  58. <trim prefix="(" prefixOverrides="and" suffix=")">
  59. <foreach collection="criteria.criteria" item="criterion">
  60. <choose>
  61. <when test="criterion.noValue">
  62. and ${criterion.condition}
  63. </when>
  64. <when test="criterion.singleValue">
  65. and ${criterion.condition} #{criterion.value}
  66. </when>
  67. <when test="criterion.betweenValue">
  68. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  69. </when>
  70. <when test="criterion.listValue">
  71. and ${criterion.condition}
  72. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  73. #{listItem}
  74. </foreach>
  75. </when>
  76. </choose>
  77. </foreach>
  78. </trim>
  79. </if>
  80. </foreach>
  81. </where>
  82. </sql>
  83. <sql id="Update_By_Example_Where_Clause">
  84. <!--
  85. WARNING - @mbggenerated
  86. This element is automatically generated by MyBatis Generator, do not modify.
  87. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  88. -->
  89. <where>
  90. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  91. <if test="criteria.valid">
  92. <trim prefix="(" prefixOverrides="and" suffix=")">
  93. <foreach collection="criteria.criteria" item="criterion">
  94. <choose>
  95. <when test="criterion.noValue">
  96. and ${criterion.condition}
  97. </when>
  98. <when test="criterion.singleValue">
  99. and ${criterion.condition} #{criterion.value}
  100. </when>
  101. <when test="criterion.betweenValue">
  102. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  103. </when>
  104. <when test="criterion.listValue">
  105. and ${criterion.condition}
  106. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  107. #{listItem}
  108. </foreach>
  109. </when>
  110. </choose>
  111. </foreach>
  112. </trim>
  113. </if>
  114. </foreach>
  115. </where>
  116. </sql>
  117. <sql id="Base_Column_List">
  118. <!--
  119. WARNING - @mbggenerated
  120. This element is automatically generated by MyBatis Generator, do not modify.
  121. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  122. -->
  123. order_no, order_type, creater, create_time, update_time, buyer_id, first_amount,
  124. total_amount, settlement_amount, refund_amount, order_status, liquidation_status,
  125. process_status, project_status, approval, order_remarks, delete_sign, salesman_id,
  126. finance_id, technician_id, sign_time, settlement_time, contract_no, contract_type,
  127. contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid,
  128. proof_time, proof_status
  129. </sql>
  130. <sql id="Blob_Column_List">
  131. <!--
  132. WARNING - @mbggenerated
  133. This element is automatically generated by MyBatis Generator, do not modify.
  134. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  135. -->
  136. contract_picture_url
  137. </sql>
  138. <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.TOrderNewExample" resultMap="ResultMapWithBLOBs">
  139. <!--
  140. WARNING - @mbggenerated
  141. This element is automatically generated by MyBatis Generator, do not modify.
  142. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  143. -->
  144. select
  145. <if test="distinct">
  146. distinct
  147. </if>
  148. <include refid="Base_Column_List" />
  149. ,
  150. <include refid="Blob_Column_List" />
  151. from t_order_new
  152. <if test="_parameter != null">
  153. <include refid="Example_Where_Clause" />
  154. </if>
  155. <if test="orderByClause != null">
  156. order by ${orderByClause}
  157. </if>
  158. </select>
  159. <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderNewExample" resultMap="BaseResultMap">
  160. <!--
  161. WARNING - @mbggenerated
  162. This element is automatically generated by MyBatis Generator, do not modify.
  163. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  164. -->
  165. select
  166. <if test="distinct">
  167. distinct
  168. </if>
  169. <include refid="Base_Column_List" />
  170. from t_order_new
  171. <if test="_parameter != null">
  172. <include refid="Example_Where_Clause" />
  173. </if>
  174. <if test="orderByClause != null">
  175. order by ${orderByClause}
  176. </if>
  177. </select>
  178. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
  179. <!--
  180. WARNING - @mbggenerated
  181. This element is automatically generated by MyBatis Generator, do not modify.
  182. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  183. -->
  184. select
  185. <include refid="Base_Column_List" />
  186. ,
  187. <include refid="Blob_Column_List" />
  188. from t_order_new
  189. where order_no = #{orderNo,jdbcType=VARCHAR}
  190. </select>
  191. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  192. <!--
  193. WARNING - @mbggenerated
  194. This element is automatically generated by MyBatis Generator, do not modify.
  195. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  196. -->
  197. delete from t_order_new
  198. where order_no = #{orderNo,jdbcType=VARCHAR}
  199. </delete>
  200. <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderNewExample">
  201. <!--
  202. WARNING - @mbggenerated
  203. This element is automatically generated by MyBatis Generator, do not modify.
  204. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  205. -->
  206. delete from t_order_new
  207. <if test="_parameter != null">
  208. <include refid="Example_Where_Clause" />
  209. </if>
  210. </delete>
  211. <insert id="insert" parameterType="com.goafanti.common.model.TOrderNew">
  212. <!--
  213. WARNING - @mbggenerated
  214. This element is automatically generated by MyBatis Generator, do not modify.
  215. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  216. -->
  217. insert into t_order_new (order_no, order_type, creater,
  218. create_time, update_time, buyer_id,
  219. first_amount, total_amount, settlement_amount,
  220. refund_amount, order_status, liquidation_status,
  221. process_status, project_status, approval,
  222. order_remarks, delete_sign, salesman_id,
  223. finance_id, technician_id, sign_time,
  224. settlement_time, contract_no, contract_type,
  225. contacts, contact_mobile, legal_person,
  226. legal_person_tel, proof_count, proof_aid,
  227. contract_picture_url)
  228. values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR},
  229. #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR},
  230. #{firstAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL},
  231. #{refundAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER},
  232. #{processStatus,jdbcType=INTEGER}, #{projectStatus,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER},
  233. #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, #{salesmanId,jdbcType=VARCHAR},
  234. #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR}, #{signTime,jdbcType=DATE},
  235. #{settlementTime,jdbcType=DATE}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
  236. #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR},
  237. #{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=REAL}, #{proofAid,jdbcType=VARCHAR},
  238. #{contractPictureUrl,jdbcType=LONGVARCHAR})
  239. </insert>
  240. <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderNew">
  241. <!--
  242. WARNING - @mbggenerated
  243. This element is automatically generated by MyBatis Generator, do not modify.
  244. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  245. -->
  246. insert into t_order_new
  247. <trim prefix="(" suffix=")" suffixOverrides=",">
  248. <if test="orderNo != null">
  249. order_no,
  250. </if>
  251. <if test="orderType != null">
  252. order_type,
  253. </if>
  254. <if test="creater != null">
  255. creater,
  256. </if>
  257. <if test="createTime != null">
  258. create_time,
  259. </if>
  260. <if test="updateTime != null">
  261. update_time,
  262. </if>
  263. <if test="buyerId != null">
  264. buyer_id,
  265. </if>
  266. <if test="firstAmount != null">
  267. first_amount,
  268. </if>
  269. <if test="totalAmount != null">
  270. total_amount,
  271. </if>
  272. <if test="settlementAmount != null">
  273. settlement_amount,
  274. </if>
  275. <if test="refundAmount != null">
  276. refund_amount,
  277. </if>
  278. <if test="orderStatus != null">
  279. order_status,
  280. </if>
  281. <if test="liquidationStatus != null">
  282. liquidation_status,
  283. </if>
  284. <if test="processStatus != null">
  285. process_status,
  286. </if>
  287. <if test="projectStatus != null">
  288. project_status,
  289. </if>
  290. <if test="approval != null">
  291. approval,
  292. </if>
  293. <if test="orderRemarks != null">
  294. order_remarks,
  295. </if>
  296. <if test="deleteSign != null">
  297. delete_sign,
  298. </if>
  299. <if test="salesmanId != null">
  300. salesman_id,
  301. </if>
  302. <if test="financeId != null">
  303. finance_id,
  304. </if>
  305. <if test="technicianId != null">
  306. technician_id,
  307. </if>
  308. <if test="signTime != null">
  309. sign_time,
  310. </if>
  311. <if test="settlementTime != null">
  312. settlement_time,
  313. </if>
  314. <if test="contractNo != null">
  315. contract_no,
  316. </if>
  317. <if test="contractType != null">
  318. contract_type,
  319. </if>
  320. <if test="contacts != null">
  321. contacts,
  322. </if>
  323. <if test="contactMobile != null">
  324. contact_mobile,
  325. </if>
  326. <if test="legalPerson != null">
  327. legal_person,
  328. </if>
  329. <if test="legalPersonTel != null">
  330. legal_person_tel,
  331. </if>
  332. <if test="proofCount != null">
  333. proof_count,
  334. </if>
  335. <if test="proofAid != null">
  336. proof_aid,
  337. </if>
  338. <if test="contractPictureUrl != null">
  339. contract_picture_url,
  340. </if>
  341. </trim>
  342. <trim prefix="values (" suffix=")" suffixOverrides=",">
  343. <if test="orderNo != null">
  344. #{orderNo,jdbcType=VARCHAR},
  345. </if>
  346. <if test="orderType != null">
  347. #{orderType,jdbcType=INTEGER},
  348. </if>
  349. <if test="creater != null">
  350. #{creater,jdbcType=VARCHAR},
  351. </if>
  352. <if test="createTime != null">
  353. #{createTime,jdbcType=TIMESTAMP},
  354. </if>
  355. <if test="updateTime != null">
  356. #{updateTime,jdbcType=TIMESTAMP},
  357. </if>
  358. <if test="buyerId != null">
  359. #{buyerId,jdbcType=VARCHAR},
  360. </if>
  361. <if test="firstAmount != null">
  362. #{firstAmount,jdbcType=DECIMAL},
  363. </if>
  364. <if test="totalAmount != null">
  365. #{totalAmount,jdbcType=DECIMAL},
  366. </if>
  367. <if test="settlementAmount != null">
  368. #{settlementAmount,jdbcType=DECIMAL},
  369. </if>
  370. <if test="refundAmount != null">
  371. #{refundAmount,jdbcType=DECIMAL},
  372. </if>
  373. <if test="orderStatus != null">
  374. #{orderStatus,jdbcType=INTEGER},
  375. </if>
  376. <if test="liquidationStatus != null">
  377. #{liquidationStatus,jdbcType=INTEGER},
  378. </if>
  379. <if test="processStatus != null">
  380. #{processStatus,jdbcType=INTEGER},
  381. </if>
  382. <if test="projectStatus != null">
  383. #{projectStatus,jdbcType=INTEGER},
  384. </if>
  385. <if test="approval != null">
  386. #{approval,jdbcType=INTEGER},
  387. </if>
  388. <if test="orderRemarks != null">
  389. #{orderRemarks,jdbcType=VARCHAR},
  390. </if>
  391. <if test="deleteSign != null">
  392. #{deleteSign,jdbcType=INTEGER},
  393. </if>
  394. <if test="salesmanId != null">
  395. #{salesmanId,jdbcType=VARCHAR},
  396. </if>
  397. <if test="financeId != null">
  398. #{financeId,jdbcType=VARCHAR},
  399. </if>
  400. <if test="technicianId != null">
  401. #{technicianId,jdbcType=VARCHAR},
  402. </if>
  403. <if test="signTime != null">
  404. #{signTime,jdbcType=DATE},
  405. </if>
  406. <if test="settlementTime != null">
  407. #{settlementTime,jdbcType=DATE},
  408. </if>
  409. <if test="contractNo != null">
  410. #{contractNo,jdbcType=VARCHAR},
  411. </if>
  412. <if test="contractType != null">
  413. #{contractType,jdbcType=VARCHAR},
  414. </if>
  415. <if test="contacts != null">
  416. #{contacts,jdbcType=VARCHAR},
  417. </if>
  418. <if test="contactMobile != null">
  419. #{contactMobile,jdbcType=VARCHAR},
  420. </if>
  421. <if test="legalPerson != null">
  422. #{legalPerson,jdbcType=VARCHAR},
  423. </if>
  424. <if test="legalPersonTel != null">
  425. #{legalPersonTel,jdbcType=VARCHAR},
  426. </if>
  427. <if test="proofCount != null">
  428. #{proofCount,jdbcType=REAL},
  429. </if>
  430. <if test="proofAid != null">
  431. #{proofAid,jdbcType=VARCHAR},
  432. </if>
  433. <if test="contractPictureUrl != null">
  434. #{contractPictureUrl,jdbcType=LONGVARCHAR},
  435. </if>
  436. </trim>
  437. </insert>
  438. <select id="countByExample" parameterType="com.goafanti.common.model.TOrderNewExample" resultType="java.lang.Integer">
  439. <!--
  440. WARNING - @mbggenerated
  441. This element is automatically generated by MyBatis Generator, do not modify.
  442. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  443. -->
  444. select count(*) from t_order_new
  445. <if test="_parameter != null">
  446. <include refid="Example_Where_Clause" />
  447. </if>
  448. </select>
  449. <update id="updateByExampleSelective" parameterType="map">
  450. <!--
  451. WARNING - @mbggenerated
  452. This element is automatically generated by MyBatis Generator, do not modify.
  453. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  454. -->
  455. update t_order_new
  456. <set>
  457. <if test="record.orderNo != null">
  458. order_no = #{record.orderNo,jdbcType=VARCHAR},
  459. </if>
  460. <if test="record.orderType != null">
  461. order_type = #{record.orderType,jdbcType=INTEGER},
  462. </if>
  463. <if test="record.creater != null">
  464. creater = #{record.creater,jdbcType=VARCHAR},
  465. </if>
  466. <if test="record.createTime != null">
  467. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  468. </if>
  469. <if test="record.updateTime != null">
  470. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  471. </if>
  472. <if test="record.buyerId != null">
  473. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  474. </if>
  475. <if test="record.firstAmount != null">
  476. first_amount = #{record.firstAmount,jdbcType=DECIMAL},
  477. </if>
  478. <if test="record.totalAmount != null">
  479. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  480. </if>
  481. <if test="record.settlementAmount != null">
  482. settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
  483. </if>
  484. <if test="record.refundAmount != null">
  485. refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
  486. </if>
  487. <if test="record.orderStatus != null">
  488. order_status = #{record.orderStatus,jdbcType=INTEGER},
  489. </if>
  490. <if test="record.liquidationStatus != null">
  491. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  492. </if>
  493. <if test="record.processStatus != null">
  494. process_status = #{record.processStatus,jdbcType=INTEGER},
  495. </if>
  496. <if test="record.projectStatus != null">
  497. project_status = #{record.projectStatus,jdbcType=INTEGER},
  498. </if>
  499. <if test="record.approval != null">
  500. approval = #{record.approval,jdbcType=INTEGER},
  501. </if>
  502. <if test="record.orderRemarks != null">
  503. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  504. </if>
  505. <if test="record.deleteSign != null">
  506. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  507. </if>
  508. <if test="record.salesmanId != null">
  509. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  510. </if>
  511. <if test="record.financeId != null">
  512. finance_id = #{record.financeId,jdbcType=VARCHAR},
  513. </if>
  514. <if test="record.technicianId != null">
  515. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  516. </if>
  517. <if test="record.signTime != null">
  518. sign_time = #{record.signTime,jdbcType=DATE},
  519. </if>
  520. <if test="record.settlementTime != null">
  521. settlement_time = #{record.settlementTime,jdbcType=DATE},
  522. </if>
  523. <if test="record.contractNo != null">
  524. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  525. </if>
  526. <if test="record.contractType != null">
  527. contract_type = #{record.contractType,jdbcType=VARCHAR},
  528. </if>
  529. <if test="record.contacts != null">
  530. contacts = #{record.contacts,jdbcType=VARCHAR},
  531. </if>
  532. <if test="record.contactMobile != null">
  533. contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
  534. </if>
  535. <if test="record.legalPerson != null">
  536. legal_person = #{record.legalPerson,jdbcType=VARCHAR},
  537. </if>
  538. <if test="record.legalPersonTel != null">
  539. legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
  540. </if>
  541. <if test="record.proofCount != null">
  542. proof_count = #{record.proofCount,jdbcType=REAL},
  543. </if>
  544. <if test="record.proofAid != null">
  545. proof_aid = #{record.proofAid,jdbcType=VARCHAR},
  546. </if>
  547. <if test="record.contractPictureUrl != null">
  548. contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR},
  549. </if>
  550. </set>
  551. <if test="_parameter != null">
  552. <include refid="Update_By_Example_Where_Clause" />
  553. </if>
  554. </update>
  555. <update id="updateByExampleWithBLOBs" parameterType="map">
  556. <!--
  557. WARNING - @mbggenerated
  558. This element is automatically generated by MyBatis Generator, do not modify.
  559. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  560. -->
  561. update t_order_new
  562. set order_no = #{record.orderNo,jdbcType=VARCHAR},
  563. order_type = #{record.orderType,jdbcType=INTEGER},
  564. creater = #{record.creater,jdbcType=VARCHAR},
  565. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  566. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  567. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  568. first_amount = #{record.firstAmount,jdbcType=DECIMAL},
  569. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  570. settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
  571. refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
  572. order_status = #{record.orderStatus,jdbcType=INTEGER},
  573. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  574. process_status = #{record.processStatus,jdbcType=INTEGER},
  575. project_status = #{record.projectStatus,jdbcType=INTEGER},
  576. approval = #{record.approval,jdbcType=INTEGER},
  577. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  578. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  579. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  580. finance_id = #{record.financeId,jdbcType=VARCHAR},
  581. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  582. sign_time = #{record.signTime,jdbcType=DATE},
  583. settlement_time = #{record.settlementTime,jdbcType=DATE},
  584. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  585. contract_type = #{record.contractType,jdbcType=VARCHAR},
  586. contacts = #{record.contacts,jdbcType=VARCHAR},
  587. contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
  588. legal_person = #{record.legalPerson,jdbcType=VARCHAR},
  589. legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
  590. proof_count = #{record.proofCount,jdbcType=REAL},
  591. proof_aid = #{record.proofAid,jdbcType=VARCHAR},
  592. contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR}
  593. <if test="_parameter != null">
  594. <include refid="Update_By_Example_Where_Clause" />
  595. </if>
  596. </update>
  597. <update id="updateByExample" parameterType="map">
  598. <!--
  599. WARNING - @mbggenerated
  600. This element is automatically generated by MyBatis Generator, do not modify.
  601. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  602. -->
  603. update t_order_new
  604. set order_no = #{record.orderNo,jdbcType=VARCHAR},
  605. order_type = #{record.orderType,jdbcType=INTEGER},
  606. creater = #{record.creater,jdbcType=VARCHAR},
  607. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  608. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  609. buyer_id = #{record.buyerId,jdbcType=VARCHAR},
  610. first_amount = #{record.firstAmount,jdbcType=DECIMAL},
  611. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  612. settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
  613. refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
  614. order_status = #{record.orderStatus,jdbcType=INTEGER},
  615. liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
  616. process_status = #{record.processStatus,jdbcType=INTEGER},
  617. project_status = #{record.projectStatus,jdbcType=INTEGER},
  618. approval = #{record.approval,jdbcType=INTEGER},
  619. order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
  620. delete_sign = #{record.deleteSign,jdbcType=INTEGER},
  621. salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
  622. finance_id = #{record.financeId,jdbcType=VARCHAR},
  623. technician_id = #{record.technicianId,jdbcType=VARCHAR},
  624. sign_time = #{record.signTime,jdbcType=DATE},
  625. settlement_time = #{record.settlementTime,jdbcType=DATE},
  626. contract_no = #{record.contractNo,jdbcType=VARCHAR},
  627. contract_type = #{record.contractType,jdbcType=VARCHAR},
  628. contacts = #{record.contacts,jdbcType=VARCHAR},
  629. contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
  630. legal_person = #{record.legalPerson,jdbcType=VARCHAR},
  631. legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
  632. proof_count = #{record.proofCount,jdbcType=REAL},
  633. proof_aid = #{record.proofAid,jdbcType=VARCHAR}
  634. <if test="_parameter != null">
  635. <include refid="Update_By_Example_Where_Clause" />
  636. </if>
  637. </update>
  638. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderNew">
  639. <!--
  640. WARNING - @mbggenerated
  641. This element is automatically generated by MyBatis Generator, do not modify.
  642. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  643. -->
  644. update t_order_new
  645. <set>
  646. <if test="orderType != null">
  647. order_type = #{orderType,jdbcType=INTEGER},
  648. </if>
  649. <if test="creater != null">
  650. creater = #{creater,jdbcType=VARCHAR},
  651. </if>
  652. <if test="createTime != null">
  653. create_time = #{createTime,jdbcType=TIMESTAMP},
  654. </if>
  655. <if test="updateTime != null">
  656. update_time = #{updateTime,jdbcType=TIMESTAMP},
  657. </if>
  658. <if test="buyerId != null">
  659. buyer_id = #{buyerId,jdbcType=VARCHAR},
  660. </if>
  661. <if test="firstAmount != null">
  662. first_amount = #{firstAmount,jdbcType=DECIMAL},
  663. </if>
  664. <if test="totalAmount != null">
  665. total_amount = #{totalAmount,jdbcType=DECIMAL},
  666. </if>
  667. <if test="settlementAmount != null">
  668. settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
  669. </if>
  670. <if test="refundAmount != null">
  671. refund_amount = #{refundAmount,jdbcType=DECIMAL},
  672. </if>
  673. <if test="orderStatus != null">
  674. order_status = #{orderStatus,jdbcType=INTEGER},
  675. </if>
  676. <if test="liquidationStatus != null">
  677. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  678. </if>
  679. <if test="processStatus != null">
  680. process_status = #{processStatus,jdbcType=INTEGER},
  681. </if>
  682. <if test="projectStatus != null">
  683. project_status = #{projectStatus,jdbcType=INTEGER},
  684. </if>
  685. <if test="approval != null">
  686. approval = #{approval,jdbcType=INTEGER},
  687. </if>
  688. <if test="orderRemarks != null">
  689. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  690. </if>
  691. <if test="deleteSign != null">
  692. delete_sign = #{deleteSign,jdbcType=INTEGER},
  693. </if>
  694. <if test="salesmanId != null">
  695. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  696. </if>
  697. <if test="financeId != null">
  698. finance_id = #{financeId,jdbcType=VARCHAR},
  699. </if>
  700. <if test="technicianId != null">
  701. technician_id = #{technicianId,jdbcType=VARCHAR},
  702. </if>
  703. <if test="signTime != null">
  704. sign_time = #{signTime,jdbcType=DATE},
  705. </if>
  706. <if test="settlementTime != null">
  707. settlement_time = #{settlementTime,jdbcType=DATE},
  708. </if>
  709. <if test="contractNo != null">
  710. contract_no = #{contractNo,jdbcType=VARCHAR},
  711. </if>
  712. <if test="contractType != null">
  713. contract_type = #{contractType,jdbcType=VARCHAR},
  714. </if>
  715. <if test="contacts != null">
  716. contacts = #{contacts,jdbcType=VARCHAR},
  717. </if>
  718. <if test="contactMobile != null">
  719. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  720. </if>
  721. <if test="legalPerson != null">
  722. legal_person = #{legalPerson,jdbcType=VARCHAR},
  723. </if>
  724. <if test="legalPersonTel != null">
  725. legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
  726. </if>
  727. <if test="proofCount != null">
  728. proof_count = #{proofCount,jdbcType=REAL},
  729. </if>
  730. <if test="proofAid != null">
  731. proof_aid = #{proofAid,jdbcType=VARCHAR},
  732. </if>
  733. <if test="proofTime != null">
  734. proof_time = #{proofTime,jdbcType=DATE},
  735. </if>
  736. <if test="proofStatus != null">
  737. proof_status = #{proofStatus,jdbcType=INTEGER},
  738. </if>
  739. <if test="contractPictureUrl != null">
  740. contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR},
  741. </if>
  742. </set>
  743. where order_no = #{orderNo,jdbcType=VARCHAR}
  744. </update>
  745. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.TOrderNew">
  746. <!--
  747. WARNING - @mbggenerated
  748. This element is automatically generated by MyBatis Generator, do not modify.
  749. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  750. -->
  751. update t_order_new
  752. set order_type = #{orderType,jdbcType=INTEGER},
  753. creater = #{creater,jdbcType=VARCHAR},
  754. create_time = #{createTime,jdbcType=TIMESTAMP},
  755. update_time = #{updateTime,jdbcType=TIMESTAMP},
  756. buyer_id = #{buyerId,jdbcType=VARCHAR},
  757. first_amount = #{firstAmount,jdbcType=DECIMAL},
  758. total_amount = #{totalAmount,jdbcType=DECIMAL},
  759. settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
  760. refund_amount = #{refundAmount,jdbcType=DECIMAL},
  761. order_status = #{orderStatus,jdbcType=INTEGER},
  762. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  763. process_status = #{processStatus,jdbcType=INTEGER},
  764. project_status = #{projectStatus,jdbcType=INTEGER},
  765. approval = #{approval,jdbcType=INTEGER},
  766. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  767. delete_sign = #{deleteSign,jdbcType=INTEGER},
  768. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  769. finance_id = #{financeId,jdbcType=VARCHAR},
  770. technician_id = #{technicianId,jdbcType=VARCHAR},
  771. sign_time = #{signTime,jdbcType=DATE},
  772. settlement_time = #{settlementTime,jdbcType=DATE},
  773. contract_no = #{contractNo,jdbcType=VARCHAR},
  774. contract_type = #{contractType,jdbcType=VARCHAR},
  775. contacts = #{contacts,jdbcType=VARCHAR},
  776. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  777. legal_person = #{legalPerson,jdbcType=VARCHAR},
  778. legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
  779. proof_count = #{proofCount,jdbcType=REAL},
  780. proof_aid = #{proofAid,jdbcType=VARCHAR},
  781. contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR}
  782. where order_no = #{orderNo,jdbcType=VARCHAR}
  783. </update>
  784. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderNew">
  785. <!--
  786. WARNING - @mbggenerated
  787. This element is automatically generated by MyBatis Generator, do not modify.
  788. This element was generated on Fri Nov 23 15:27:45 CST 2018.
  789. -->
  790. update t_order_new
  791. set order_type = #{orderType,jdbcType=INTEGER},
  792. creater = #{creater,jdbcType=VARCHAR},
  793. create_time = #{createTime,jdbcType=TIMESTAMP},
  794. update_time = #{updateTime,jdbcType=TIMESTAMP},
  795. buyer_id = #{buyerId,jdbcType=VARCHAR},
  796. first_amount = #{firstAmount,jdbcType=DECIMAL},
  797. total_amount = #{totalAmount,jdbcType=DECIMAL},
  798. settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
  799. refund_amount = #{refundAmount,jdbcType=DECIMAL},
  800. order_status = #{orderStatus,jdbcType=INTEGER},
  801. liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
  802. process_status = #{processStatus,jdbcType=INTEGER},
  803. project_status = #{projectStatus,jdbcType=INTEGER},
  804. approval = #{approval,jdbcType=INTEGER},
  805. order_remarks = #{orderRemarks,jdbcType=VARCHAR},
  806. delete_sign = #{deleteSign,jdbcType=INTEGER},
  807. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  808. finance_id = #{financeId,jdbcType=VARCHAR},
  809. technician_id = #{technicianId,jdbcType=VARCHAR},
  810. sign_time = #{signTime,jdbcType=DATE},
  811. settlement_time = #{settlementTime,jdbcType=DATE},
  812. contract_no = #{contractNo,jdbcType=VARCHAR},
  813. contract_type = #{contractType,jdbcType=VARCHAR},
  814. contacts = #{contacts,jdbcType=VARCHAR},
  815. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  816. legal_person = #{legalPerson,jdbcType=VARCHAR},
  817. legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
  818. proof_count = #{proofCount,jdbcType=REAL},
  819. proof_aid = #{proofAid,jdbcType=VARCHAR}
  820. where order_no = #{orderNo,jdbcType=VARCHAR}
  821. </update>
  822. <!-- 查看所有待财务管理员分配的订单数据 -->
  823. <select id="getAllUnassignedListOrder" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
  824. select * from (
  825. select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
  826. o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
  827. ,liquidation_status
  828. from t_order_new o
  829. left join `user` u on o.buyer_id = u.id
  830. left join admin a on o.salesman_id = a.id
  831. where delete_sign = 0
  832. and order_status = 2
  833. <if test="o.processStatus != null">
  834. and process_status = #{o.processStatus,jdbcType=INTEGER}
  835. </if>
  836. <if test='o.orderNo != null and o.orderNo != ""'>
  837. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  838. </if>
  839. <if test='o.financeId != null and o.financeId != ""'>
  840. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  841. </if>
  842. <if test='o.buyerName != null and o.buyerName != ""'>
  843. <bind name="n" value="'%' + o.buyerName + '%'"/>
  844. and u.nickname like #{n,jdbcType=VARCHAR}
  845. </if>
  846. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  847. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  848. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  849. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  850. </if>
  851. union
  852. select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
  853. o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
  854. ,liquidation_status
  855. from t_order_new o
  856. left join `user` u on o.buyer_id = u.id
  857. left join admin a on o.salesman_id = a.id
  858. where delete_sign = 0 and approval = 2 and finance_id is null and order_status = 2
  859. <if test='o.orderNo != null and o.orderNo != ""'>
  860. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  861. </if>
  862. <if test='o.financeId != null and o.financeId != ""'>
  863. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  864. </if>
  865. <if test='o.buyerName != null and o.buyerName != ""'>
  866. <bind name="n" value="'%' + o.buyerName + '%'"/>
  867. and u.nickname like #{n,jdbcType=VARCHAR}
  868. </if>
  869. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  870. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  871. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  872. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  873. </if>
  874. )oo
  875. <if test="ob == 1">
  876. order by oo.signTime desc
  877. </if>
  878. <if test="ob == 2">
  879. order by oo.liquidation_status,oo.signTime desc
  880. </if>
  881. <if test="page_sql != null">
  882. ${page_sql}
  883. </if>
  884. </select>
  885. <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
  886. select count(*) from (
  887. select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
  888. o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
  889. ,liquidation_status
  890. from t_order_new o
  891. left join `user` u on o.buyer_id = u.id
  892. left join admin a on o.salesman_id = a.id
  893. where delete_sign = 0
  894. and order_status = 2
  895. <if test="o.processStatus != null">
  896. and process_status = #{o.processStatus,jdbcType=INTEGER}
  897. </if>
  898. <if test='o.orderNo != null and o.orderNo != ""'>
  899. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  900. </if>
  901. <if test='o.financeId != null and o.financeId != ""'>
  902. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  903. </if>
  904. <if test='o.buyerName != null and o.buyerName != ""'>
  905. <bind name="n" value="'%' + o.buyerName + '%'"/>
  906. and u.nickname like #{n,jdbcType=VARCHAR}
  907. </if>
  908. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  909. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  910. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  911. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  912. </if>
  913. union
  914. select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
  915. o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
  916. ,liquidation_status
  917. from t_order_new o
  918. left join `user` u on o.buyer_id = u.id
  919. left join admin a on o.salesman_id = a.id
  920. where delete_sign = 0 and approval = 2 and finance_id is null and order_status = 2
  921. <if test='o.orderNo != null and o.orderNo != ""'>
  922. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  923. </if>
  924. <if test='o.financeId != null and o.financeId != ""'>
  925. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  926. </if>
  927. <if test='o.buyerName != null and o.buyerName != ""'>
  928. <bind name="n" value="'%' + o.buyerName + '%'"/>
  929. and u.nickname like #{n,jdbcType=VARCHAR}
  930. </if>
  931. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  932. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  933. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  934. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  935. </if>
  936. )oo
  937. </select>
  938. <!-- 查看某订单状态是否符合要求 -->
  939. <select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
  940. select count(*) from t_order_new
  941. where order_no = #{orderNo,jdbcType=VARCHAR}
  942. <if test="orderType != null">
  943. and order_type = #{orderType,jdbcType=INTEGER}
  944. </if>
  945. <if test="creater != null">
  946. and creater = #{creater,jdbcType=VARCHAR}
  947. </if>
  948. <if test="buyerId != null">
  949. and buyer_id = #{buyerId,jdbcType=VARCHAR}
  950. </if>
  951. <if test="firstAmount != null">
  952. and first_amount = #{firstAmount,jdbcType=DECIMAL}
  953. </if>
  954. <if test="totalAmount != null">
  955. and total_amount = #{totalAmount,jdbcType=DECIMAL}
  956. </if>
  957. <if test="settlementAmount != null">
  958. and settlement_amount = #{settlementAmount,jdbcType=DECIMAL}
  959. </if>
  960. <if test="orderStatus != null">
  961. and order_status = #{orderStatus,jdbcType=INTEGER}
  962. </if>
  963. <if test="liquidationStatus == 1">
  964. and liquidation_status between 1 and 2
  965. </if>
  966. <if test="processStatus != null">
  967. and process_status = #{processStatus,jdbcType=INTEGER}
  968. </if>
  969. <if test="projectStatus != null">
  970. and project_status = #{projectStatus,jdbcType=INTEGER}
  971. </if>
  972. <if test="approval != null">
  973. and approval = #{approval,jdbcType=INTEGER}
  974. </if>
  975. <if test="orderRemarks != null">
  976. and order_remarks = #{orderRemarks,jdbcType=VARCHAR}
  977. </if>
  978. <if test="deleteSign != null">
  979. and delete_sign = #{deleteSign,jdbcType=INTEGER}
  980. </if>
  981. <if test="salesmanId != null">
  982. and salesman_id = #{salesmanId,jdbcType=VARCHAR}
  983. </if>
  984. <if test="financeId != null">
  985. and finance_id = #{financeId,jdbcType=VARCHAR}
  986. </if>
  987. <if test="technicianId != null">
  988. and technician_id = #{technicianId,jdbcType=VARCHAR}
  989. </if>
  990. <if test="contractNo != null">
  991. and contract_no = #{contractNo,jdbcType=VARCHAR}
  992. </if>
  993. <if test="contractType != null">
  994. and contract_type = #{contractType,jdbcType=VARCHAR}
  995. </if>
  996. <if test="contacts != null">
  997. and contacts = #{contacts,jdbcType=VARCHAR}
  998. </if>
  999. <if test="contactMobile != null">
  1000. and contact_mobile = #{contactMobile,jdbcType=VARCHAR}
  1001. </if>
  1002. <if test="legalPerson != null">
  1003. and legal_person = #{legalPerson,jdbcType=VARCHAR}
  1004. </if>
  1005. <if test="legalPersonTel != null">
  1006. and legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR}
  1007. </if>
  1008. </select>
  1009. <!-- 财务专员查看需要待收款的数据 -->
  1010. <select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
  1011. select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
  1012. a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
  1013. ifnull(b.amount,0) as actuallyTotalAmount,
  1014. o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,
  1015. 0 as companyId, "湖南科德信息咨询有限公司" as companyName
  1016. from t_order_new o
  1017. left join `user` u on o.buyer_id = u.id
  1018. left join admin a on o.salesman_id = a.id
  1019. left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
  1020. group by order_no ) b on b.order_no = o.order_no
  1021. where delete_sign = 0
  1022. and process_status >= 3
  1023. and (approval = 0 or approval = 2)
  1024. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  1025. <if test='o.orderStatus != null and o.orderStatus != ""'>
  1026. and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
  1027. </if>
  1028. <if test='o.liquidationStatus != null and o.liquidationStatus != ""'>
  1029. and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
  1030. </if>
  1031. <if test='o.liquidationStatus == null or o.liquidationStatus == ""'>
  1032. and o.liquidation_status &lt; 2
  1033. </if>
  1034. <if test='o.orderNo != null and o.orderNo != ""'>
  1035. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  1036. </if>
  1037. <if test='o.buyerName != null and o.buyerName != ""'>
  1038. <bind name="n" value="'%' + o.buyerName + '%'"/>
  1039. and u.nickname like #{n,jdbcType=VARCHAR}
  1040. </if>
  1041. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  1042. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  1043. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  1044. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  1045. </if>
  1046. order by o.liquidation_status, o.sign_time desc
  1047. <if test="page_sql != null">
  1048. ${page_sql}
  1049. </if>
  1050. </select>
  1051. <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
  1052. select count(*)
  1053. from t_order_new o
  1054. left join `user` u on o.buyer_id = u.id
  1055. left join admin a on o.salesman_id = a.id
  1056. left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
  1057. group by order_no ) b on b.order_no = o.order_no
  1058. where delete_sign = 0
  1059. and process_status >= 3
  1060. and (approval = 0 or approval = 2)
  1061. and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
  1062. <if test='o.orderStatus != null and o.orderStatus != ""'>
  1063. and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
  1064. </if>
  1065. <if test='o.liquidationStatus != null and o.liquidationStatus != ""'>
  1066. and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
  1067. </if>
  1068. <if test='o.liquidationStatus == null or o.liquidationStatus == ""'>
  1069. and o.liquidation_status &lt; 2
  1070. </if>
  1071. <if test='o.orderNo != null and o.orderNo != ""'>
  1072. and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
  1073. </if>
  1074. <if test='o.buyerName != null and o.buyerName != ""'>
  1075. <bind name="n" value="'%' + o.buyerName + '%'"/>
  1076. and u.nickname like #{n,jdbcType=VARCHAR}
  1077. </if>
  1078. <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
  1079. <bind name="a" value="o.startTime + ' 00:00:00'"/>
  1080. <bind name="b" value="o.endTime + ' 23:59:59'"/>
  1081. and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
  1082. </if>
  1083. </select>
  1084. <!-- 通过订单编号获得订单的负责人(营销员) -->
  1085. <select id="getSaleIdByOno" resultType="com.goafanti.order.bo.TOrderNewBo" parameterType="java.lang.String">
  1086. select salesman_id as salesmanId, a.name as salesmanName, a.email ,u.nickname as userName
  1087. from t_order_new o
  1088. left join admin a on o.salesman_id = a.id
  1089. left join `user` u on u.id = o.buyer_id
  1090. where order_no = #{_parameter,jdbcType=VARCHAR}
  1091. </select>
  1092. <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1093. select
  1094. a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,
  1095. b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,a.order_status as orderStatus,
  1096. a.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,d.name as financeName
  1097. <if test="specially == 2">
  1098. ,f.name as initiateName ,e.reason ,date_format(e.create_time,'%Y-%m-%d' ) as backDate,e.id as backId
  1099. </if>
  1100. <if test="specially == 4">
  1101. ,f.name as consultantName,a.settlement_amount as settlementAmount
  1102. </if>
  1103. from t_order_new a left join `user` b on a.buyer_id=b.id
  1104. left join admin c on a.salesman_id=c.id
  1105. left join admin d on a.finance_id=d.id
  1106. <if test="specially == 2">
  1107. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1108. left join admin f on e.initiate=f.id
  1109. </if>
  1110. <if test="specially == 4">
  1111. left join (select * from t_order_task where main=1) e on e.order_no=a.order_no
  1112. left join admin f on e.task_receiver=f.id
  1113. </if>
  1114. where a.delete_sign = 0
  1115. <if test="specially == 0">
  1116. and a.order_status not in(3,5,6) and a.approval !=3
  1117. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1118. </if>
  1119. <if test="specially == 1">
  1120. and a.process_status =1 and a.order_status=1
  1121. </if>
  1122. <if test="specially == 2">
  1123. and a.order_status in(3,5)
  1124. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1125. </if>
  1126. <if test="specially == 3">
  1127. and a.approval = 1 and a.order_status=2
  1128. </if>
  1129. <if test="specially == 4">
  1130. and a.process_status in (4,5,6)
  1131. and a.order_status not in(5,7)
  1132. </if>
  1133. <if test="specially == 5">
  1134. and c.department_id=(select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  1135. </if>
  1136. <if test="distribution == 0">
  1137. and a.process_status &lt; 5
  1138. </if>
  1139. <if test="distribution == 1">
  1140. and a.process_status = 5
  1141. </if>
  1142. <if test="distribution == 2">
  1143. and a.process_status = 6
  1144. </if>
  1145. <if test="name != null">
  1146. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1147. </if>
  1148. <if test="orderNo != null">
  1149. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1150. </if>
  1151. <if test="starTime !=null and endTime !=null">
  1152. and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1153. </if>
  1154. order by a.order_status,a.create_time desc
  1155. <if test="page_sql!=null">
  1156. ${page_sql}
  1157. </if>
  1158. </select>
  1159. <select id="selectOrderNewListCount" resultType="java.lang.Integer">
  1160. select
  1161. count(*)
  1162. from t_order_new a left join `user` b on a.buyer_id=b.id
  1163. left join admin c on a.salesman_id=c.id
  1164. left join admin d on a.finance_id=d.id
  1165. <if test="specially == 2">
  1166. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1167. left join admin f on e.initiate=f.id
  1168. </if>
  1169. <if test="specially == 4">
  1170. left join (select * from t_order_task where main=1) e on e.order_no=a.order_no
  1171. left join admin f on e.task_receiver=f.id
  1172. </if>
  1173. where a.delete_sign = 0
  1174. <if test="specially == 0">
  1175. and a.order_status not in(3,5,6) and a.approval !=3
  1176. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1177. </if>
  1178. <if test="specially == 1">
  1179. and a.process_status =1 and a.order_status=1
  1180. </if>
  1181. <if test="specially == 2">
  1182. and a.order_status in(3,5)
  1183. and a.salesman_id = #{aid,jdbcType=VARCHAR}
  1184. </if>
  1185. <if test="specially == 3">
  1186. and a.approval = 1 and a.order_status=2
  1187. </if>
  1188. <if test="specially == 4">
  1189. and a.process_status in (4,5,6)
  1190. and a.order_status not in(5,7)
  1191. </if>
  1192. <if test="specially == 5">
  1193. and c.department_id=(select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  1194. </if>
  1195. <if test="distribution == 0">
  1196. and a.process_status &lt; 5
  1197. </if>
  1198. <if test="distribution == 1">
  1199. and a.process_status = 5
  1200. </if>
  1201. <if test="distribution == 2">
  1202. and a.process_status = 6
  1203. </if>
  1204. <if test="name != null">
  1205. and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1206. </if>
  1207. <if test="orderNo != null">
  1208. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1209. </if>
  1210. <if test="starTime !=null and endTime !=null">
  1211. and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1212. </if>
  1213. </select>
  1214. <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
  1215. select a.id,a.order_no as orderNo,date_format(b.sign_time,'%Y-%m-%d') as signDate,
  1216. c.nickname as userName,b.order_status as orderStatus,b.total_amount as totalAmount,
  1217. b.project_status as projectStatus,b.liquidation_status as liquidationStatus,
  1218. b.settlement_amount as settlementAmount,d.name as salesmanName,a.dun_subject as dunSubject,
  1219. date_format(a.start_time, '%Y-%m-%d') as startDate
  1220. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1221. left join `user` c on b.buyer_id=c.id
  1222. left join admin d on b.salesman_id=d.id
  1223. where a.start_time is not null and b.delete_sign = 0
  1224. <if test="name != null">
  1225. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1226. </if>
  1227. <if test="orderNo != null">
  1228. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1229. </if>
  1230. <if test="starTime !=null and endTime !=null">
  1231. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1232. </if>
  1233. order by b.sign_time desc
  1234. <if test="page_sql!=null">
  1235. ${page_sql}
  1236. </if>
  1237. </select>
  1238. <select id="selectDunOrderNewListCount" resultType="java.lang.Integer">
  1239. select
  1240. count(*)
  1241. from t_order_dun a left join t_order_new b on a.order_no=b.order_no
  1242. left join `user` c on b.buyer_id=c.id
  1243. where a.start_time is not null and b.delete_sign = 0
  1244. <if test="name != null">
  1245. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1246. </if>
  1247. <if test="orderNo != null">
  1248. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1249. </if>
  1250. <if test="starTime !=null and endTime !=null">
  1251. and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1252. </if>
  1253. </select>
  1254. <select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
  1255. select
  1256. a.order_no as orderNo, a.order_type as orderType, a.creater, a.create_time as createTime,a.update_time as updateTime, a.buyer_id as buyerId, a.first_amount as firstAmount,
  1257. a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus,
  1258. a.project_status as projectStatus, a.approval, a.order_remarks as orderRemarks, a.delete_sign as deleteSign, a.salesman_id as salesmanId, finance_id as financeId, technician_id as technicianId,
  1259. a.sign_time as signTime, a.settlement_time as settlementTime, a.contract_no as contractNo, a.contract_type as contractType, a.contacts, a.contact_mobile as contactMobile,
  1260. a.legal_person as legalPerson, a.legal_person_tel as legalPersonTel, a.proof_count as proofCount, a.proof_aid as proofAid,contract_picture_url as contractPictureUrl,
  1261. c.name as salesmanName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
  1262. ,e.back_status as backStatus,f.name as initiateName,e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid
  1263. from t_order_new a
  1264. left join `user` b on a.buyer_id=b.id
  1265. left join admin c on a.salesman_id=c.id
  1266. left join admin d on a.finance_id=d.id
  1267. left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
  1268. left join admin f on e.initiate=f.id
  1269. where a.order_no = #{orderNo,jdbcType=VARCHAR}
  1270. </select>
  1271. <select id="selectOrderRefundListByPage" resultType="com.goafanti.order.bo.TOrderRefundBo">
  1272. select a.id, date_format(a.create_time,'%Y-%m-%d') as createDate,a.order_no as orderNo,
  1273. c.nickname as userName,b.order_status as orderStatus,a.refund_status as refundStatus,
  1274. a.reason,b.liquidation_status as liquidationStatus
  1275. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1276. left join `user` c on b.buyer_id=c.id
  1277. where b.delete_sign = 0
  1278. <if test="name != null">
  1279. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1280. </if>
  1281. <if test="aid != null">
  1282. and a.initiate = #{aid,jdbcType=VARCHAR}
  1283. </if>
  1284. <if test="orderNo != null">
  1285. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1286. </if>
  1287. <if test="starTime !=null and endTime !=null">
  1288. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1289. </if>
  1290. order by a.create_time desc
  1291. <if test="page_sql!=null">
  1292. ${page_sql}
  1293. </if>
  1294. </select>
  1295. <select id="selectOrderRefundListCount" resultType="java.lang.Integer">
  1296. select
  1297. count(*)
  1298. from t_order_refund a left join t_order_new b on a.order_no=b.order_no
  1299. left join `user` c on b.buyer_id=c.id
  1300. where b.delete_sign = 0
  1301. <if test="name != null">
  1302. and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1303. </if>
  1304. <if test="aid != null">
  1305. and a.initiate = #{aid,jdbcType=VARCHAR}
  1306. </if>
  1307. <if test="orderNo != null">
  1308. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  1309. </if>
  1310. <if test="starTime !=null and endTime !=null">
  1311. and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1312. </if>
  1313. </select>
  1314. <!-- 财务同意退款邮件通知需要的数据 -->
  1315. <select id="agreeEmailData" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderNewBo">
  1316. select u.nickname as userName, r.order_no as orderNo, o.order_status as orderStatus, o.salesman_id as salesmanId, o.technician_id as technicianId,
  1317. concat(a.email,"," , ifnull(t.email,"")) as email , concat(a.name,"," , ifnull(t.name,"")) as salesmanName
  1318. from t_order_refund r
  1319. left join t_order_new o on r.order_no = o.order_no
  1320. left join admin a on a.id = o.salesman_id
  1321. left join admin t on t.id = o.technician_id
  1322. left join `user` u on u.id = o.buyer_id
  1323. where r.id = #{id,jdbcType=INTEGER}
  1324. </select>
  1325. <select id="orderRefundDetail" resultType="com.goafanti.order.bo.OrderRefundDetailBo">
  1326. select a.id,date_format(a.create_time,'%Y-%m-%d') as createDate ,a.order_no as orderNo,
  1327. b.order_status as orderStatus,a.refund_status as refundStatus, a.application_url as applicationUrl,
  1328. a.contract_url as contractUrl,a.reason,b.liquidation_status as liquidationStatus
  1329. from t_order_refund a
  1330. left join t_order_new b on a.order_no=b.order_no
  1331. where a.id= #{id,jdbcType=INTEGER}
  1332. </select>
  1333. </mapper>