TOrderNewMapper.xml 62 KB

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