TOrderNewMapper.xml 63 KB

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