TopDivideOrderMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhongzheng.modules.top.financial.mapper.TopDivideOrderMapper">
  6. <resultMap type="com.zhongzheng.modules.top.financial.domain.TopDivideOrder" id="TopDivideOrderResult">
  7. <result property="id" column="id"/>
  8. <result property="divideLogId" column="divide_log_id"/>
  9. <result property="orderSn" column="order_sn"/>
  10. <result property="orderType" column="order_type"/>
  11. <result property="status" column="status"/>
  12. <result property="createTime" column="create_time"/>
  13. <result property="updateTime" column="update_time"/>
  14. </resultMap>
  15. <select id="getFinishList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
  16. SELECT
  17. tdo.*,
  18. st.tenant_name ,
  19. cl.check_status,
  20. dl.pay_status,
  21. dl.divide_type,
  22. oo.accomplish_time as order_time,
  23. oo.remark,
  24. IFNULL(oo.divide_company_money,0) divide_company_money,
  25. IFNULL(oo.divide_seller_money,0) divide_seller_money,
  26. IFNULL(oo.brokerage,0) brokerage,
  27. IFNULL(oo.pretax_brokerage,0) pretax_brokerage,
  28. IFNULL(oo.order_price,0) order_price,
  29. oo.order_from,
  30. oo.create_time as order_create_time,
  31. r.role_name,
  32. r.role_id,
  33. oo.create_sys_user_id,
  34. oo.create_username,
  35. oo.create_no
  36. FROM
  37. top_divide_order tdo
  38. LEFT JOIN top_divide_log dl ON tdo.divide_log_id = dl.id
  39. LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
  40. LEFT JOIN v_top_order oo ON tdo.order_sn = oo.order_sn
  41. LEFT JOIN
  42. top_old_order_check_log cl ON (dl.divide_type+1) = cl.check_from AND cl.check_sign = 1 AND tdo.order_sn = cl.order_sn
  43. LEFT JOIN top_sys_role r ON cl.role_id = r.role_id
  44. WHERE
  45. tdo.order_type = 1
  46. AND tdo.divide_log_id = #{divideLogId}
  47. <if test="startPrice != null and startPrice != ''">
  48. AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ >= ]]> #{startPrice}
  49. </if>
  50. <if test="endPrice != null and endPrice != ''">
  51. AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ <= ]]> #{endPrice}
  52. </if>
  53. <if test="orderSn != null and orderSn != ''">
  54. AND oo.order_sn = #{orderSn}
  55. </if>
  56. <if test="accomplishStartTime != null ">
  57. AND oo.accomplish_time <![CDATA[ >= ]]> #{accomplishStartTime}
  58. </if>
  59. <if test="accomplishEndTime != null ">
  60. AND oo.accomplish_time <![CDATA[ <= ]]> #{accomplishEndTime}
  61. </if>
  62. <if test="checkStatus != null and checkStatus == 0">
  63. AND cl.check_status <![CDATA[ <= ]]> 0
  64. </if>
  65. <if test="checkStatus != null and checkStatus == 1">
  66. AND cl.check_status <![CDATA[ >= ]]> 1
  67. </if>
  68. </select>
  69. <select id="getFinishCount" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
  70. SELECT
  71. SUM(oo.order_price) as order_price,
  72. SUM(oo.divide_company_money) as divide_company_money,
  73. SUM(oo.divide_seller_money) as divide_seller_money,
  74. SUM(oo.pretax_brokerage) as pretax_brokerage
  75. FROM
  76. top_divide_order tdo
  77. LEFT JOIN top_divide_log dl ON tdo.divide_log_id = dl.id
  78. LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
  79. LEFT JOIN v_top_order oo ON tdo.order_sn = oo.order_sn
  80. LEFT JOIN
  81. top_old_order_check_log cl ON (dl.divide_type+1) = cl.check_from AND cl.check_sign = 1 AND tdo.order_sn = cl.order_sn
  82. LEFT JOIN top_sys_role r ON cl.role_id = r.role_id
  83. WHERE
  84. tdo.order_type = 1
  85. AND tdo.divide_log_id = #{divideLogId}
  86. <if test="startPrice != null and startPrice != ''">
  87. AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ >= ]]> #{startPrice}
  88. </if>
  89. <if test="endPrice != null and endPrice != ''">
  90. AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ <= ]]> #{endPrice}
  91. </if>
  92. <if test="orderSn != null and orderSn != ''">
  93. AND oo.order_sn = #{orderSn}
  94. </if>
  95. <if test="accomplishStartTime != null ">
  96. AND oo.accomplish_time <![CDATA[ >= ]]> #{accomplishStartTime}
  97. </if>
  98. <if test="accomplishEndTime != null ">
  99. AND oo.accomplish_time <![CDATA[ <= ]]> #{accomplishEndTime}
  100. </if>
  101. <if test="checkStatus != null and checkStatus == 0">
  102. AND cl.check_status <![CDATA[ <= ]]> 0
  103. </if>
  104. <if test="checkStatus != null and checkStatus == 1">
  105. AND cl.check_status <![CDATA[ >= ]]> 1
  106. </if>
  107. </select>
  108. <select id="getRefundList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
  109. SELECT
  110. tdo.*,
  111. st.tenant_name,
  112. dl.pay_status,
  113. dl.divide_type,
  114. oo.remark,
  115. IFNULL(oo.order_price,0) order_price,
  116. IFNULL(oo.brokerage,0) brokerage,
  117. IFNULL(oo.pretax_brokerage,0) pretax_brokerage,
  118. IFNULL(tor.divide_money,0) divide_money,
  119. tor.refund_time as order_time,
  120. oo.create_time as order_create_time,
  121. oo.create_sys_user_id,
  122. oo.create_username,
  123. oo.create_no
  124. FROM
  125. top_divide_order tdo
  126. LEFT JOIN top_divide_log dl ON tdo.divide_log_id = dl.id
  127. LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
  128. LEFT JOIN v_top_order oo ON tdo.order_sn = oo.order_sn
  129. LEFT JOIN top_old_order_refund tor ON tdo.order_sn = tor.order_sn
  130. WHERE
  131. tdo.order_type = 2
  132. AND tdo.divide_log_id = #{divideLogId}
  133. <if test="startPrice != null and startPrice != ''">
  134. AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ >= ]]> #{startPrice}
  135. </if>
  136. <if test="endPrice != null and endPrice != ''">
  137. AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ <= ]]> #{endPrice}
  138. </if>
  139. <if test="orderSn != null and orderSn != ''">
  140. AND oo.order_sn = #{orderSn}
  141. </if>
  142. <if test="accomplishStartTime != null ">
  143. AND tor.refund_time <![CDATA[ >= ]]> #{accomplishStartTime}
  144. </if>
  145. <if test="accomplishEndTime != null ">
  146. AND tor.refund_time <![CDATA[ <= ]]> #{accomplishEndTime}
  147. </if>
  148. <if test="checkStatus != null and checkStatus == 0">
  149. AND 1=0
  150. </if>
  151. </select>
  152. <select id="getRefundCount" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
  153. SELECT
  154. SUM(tor.divide_money) as divide_money
  155. FROM
  156. top_divide_order tdo
  157. LEFT JOIN top_divide_log dl ON tdo.divide_log_id = dl.id
  158. LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
  159. LEFT JOIN v_top_order oo ON tdo.order_sn = oo.order_sn
  160. LEFT JOIN top_old_order_refund tor ON tdo.order_sn = tor.order_sn
  161. WHERE
  162. tdo.order_type = 2
  163. AND tdo.divide_log_id = #{divideLogId}
  164. <if test="startPrice != null and startPrice != ''">
  165. AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ >= ]]> #{startPrice}
  166. </if>
  167. <if test="endPrice != null and endPrice != ''">
  168. AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ <= ]]> #{endPrice}
  169. </if>
  170. <if test="orderSn != null and orderSn != ''">
  171. AND oo.order_sn = #{orderSn}
  172. </if>
  173. <if test="accomplishStartTime != null ">
  174. AND tor.refund_time <![CDATA[ >= ]]> #{accomplishStartTime}
  175. </if>
  176. <if test="accomplishEndTime != null ">
  177. AND tor.refund_time <![CDATA[ <= ]]> #{accomplishEndTime}
  178. </if>
  179. <if test="checkStatus != null and checkStatus == 0">
  180. AND 1=0
  181. </if>
  182. </select>
  183. <select id="getBusinessList" parameterType="String" resultType="String">
  184. SELECT
  185. business_name
  186. FROM
  187. v_top_order_business
  188. WHERE
  189. order_sn = #{orderSn}
  190. GROUP BY
  191. business_name
  192. </select>
  193. <select id="getMonthFinishAllTenant" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="String">
  194. SELECT
  195. v.tenant_id
  196. FROM
  197. v_top_order v
  198. WHERE
  199. 1 = 1
  200. AND v.finish_status = 1
  201. <if test="divideModel != null and divideModel != ''">
  202. AND v.divide_model = #{divideModel}
  203. </if>
  204. <if test="accomplishStartTime != null and accomplishStartTime != ''">
  205. AND v.accomplish_time BETWEEN #{accomplishStartTime} and #{accomplishEndTime}
  206. </if>
  207. <if test="tenantId != null and tenantId != ''">
  208. AND v.tenant_id = #{tenantId}
  209. </if>
  210. GROUP BY v.tenant_id
  211. </select>
  212. <select id="getMonthFinishList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
  213. SELECT
  214. v.order_sn,
  215. IFNULL(v.divide_company_money,0) divide_company_money,
  216. IFNULL(v.divide_seller_money,0) divide_seller_money,
  217. v.tenant_id,
  218. v.create_no,
  219. v.create_username,
  220. IFNULL(v.brokerage,0) brokerage
  221. FROM
  222. v_top_order v
  223. WHERE
  224. 1 = 1
  225. AND v.finish_status = 1
  226. <if test="divideModel != null and divideModel != ''">
  227. AND v.divide_model = #{divideModel}
  228. </if>
  229. <if test="accomplishStartTime != null and accomplishStartTime != ''">
  230. AND v.accomplish_time BETWEEN #{accomplishStartTime} and #{accomplishEndTime}
  231. </if>
  232. <if test="tenantId != null and tenantId != ''">
  233. AND v.tenant_id = #{tenantId}
  234. </if>
  235. <if test="createNo != null and createNo != ''">
  236. AND v.create_no = #{createNo}
  237. </if>
  238. <if test="createSysUserId != null and createSysUserId !=0">
  239. AND v.create_sys_user_id = #{createSysUserId}
  240. </if>
  241. <if test="createSysUserId == 0">
  242. AND (v.create_sys_user_id is null or v.create_sys_user_id = 0)
  243. </if>
  244. </select>
  245. <select id="getMonthCreditList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
  246. SELECT
  247. v.order_sn,
  248. v.create_time,
  249. v.purchase_org,
  250. v.divide_company_money,
  251. v.divide_seller_money,
  252. v.tenant_id,
  253. v.create_no,
  254. v.create_username,
  255. v.brokerage,
  256. v.brokerage_type,
  257. v.brokerage_bank_account,
  258. v.brokerage_bank_name,
  259. v.brokerage_bank,
  260. v.order_price,
  261. st.tenant_name,
  262. v.pretax_brokerage,
  263. r.role_name,
  264. r.role_id,
  265. cl.check_status,
  266. v.pretax,
  267. bp.pay_type,
  268. bp.to_bank_acount,
  269. bp.to_bank_name,
  270. bp.to_bank_type_name,
  271. bp.create_time as pay_time,
  272. (SELECT
  273. ocl.check_reason
  274. FROM
  275. top_old_order_check_log ocl
  276. WHERE
  277. ocl.check_from = 4
  278. AND ocl.order_sn = v.order_sn
  279. AND ocl.check_status = -1
  280. ORDER BY ocl.check_sort
  281. LIMIT 1) as check_reason
  282. FROM
  283. top_old_order v
  284. LEFT JOIN sys_tenant st ON v.tenant_id = st.tenant_id
  285. LEFT JOIN
  286. top_old_order_check_log cl ON cl.check_from = 4 AND cl.check_sign = 1 AND v.order_sn = cl.order_sn
  287. LEFT JOIN top_sys_role r ON cl.role_id = r.role_id
  288. LEFT JOIN top_order_bank_pay bp ON bp.type = 4 AND bp.order_sn = v.order_sn AND bp.result_status = 1
  289. WHERE
  290. 1 = 1
  291. <if test="accomplishStartTime != null and accomplishStartTime != ''">
  292. AND v.accomplish_time BETWEEN #{accomplishStartTime} and #{accomplishEndTime}
  293. </if>
  294. <if test="buyStartTime != null and buyStartTime != ''">
  295. AND v.create_time BETWEEN #{buyStartTime} and #{buyEndTime}
  296. </if>
  297. <if test="tenantId != null and tenantId != ''">
  298. AND v.tenant_id = #{tenantId}
  299. </if>
  300. <if test="checkStatus != null and checkStatus.size()!=0">
  301. AND cl.check_status in
  302. <foreach collection="checkStatus" item="item" index="index" open="(" close=")" separator=",">
  303. #{item}
  304. </foreach>
  305. </if>
  306. <if test="tenantIds != null and tenantIds.size()!=0">
  307. AND v.tenant_id in
  308. <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
  309. #{item}
  310. </foreach>
  311. </if>
  312. <if test="createNo != null and createNo != ''">
  313. AND (v.create_no = #{createNo} or v.create_username like concat('%', #{createNo}, '%'))
  314. </if>
  315. <if test="orderSn != null and orderSn != ''">
  316. AND v.order_sn = #{orderSn}
  317. </if>
  318. AND v.finish_status = 1
  319. AND v.brokerage > 0
  320. <if test="reCheckStatus == 1">
  321. AND (SELECT
  322. count(*)
  323. FROM
  324. top_old_order_check_log bcl
  325. WHERE
  326. bcl.check_from = 4
  327. AND bcl.check_status = 0
  328. AND bcl.check_sign = 1
  329. <if test="roleIds != null and roleIds.size()!=0">
  330. AND bcl.role_id in
  331. <foreach collection="roleIds" item="item" index="index" open="(" close=")" separator=",">
  332. #{item}
  333. </foreach>
  334. </if>
  335. AND bcl.order_sn = v.order_sn)>0
  336. </if>
  337. <if test="reCheckStatus == 2">
  338. AND (SELECT
  339. count(*)
  340. FROM
  341. top_old_order_check_log bcl
  342. WHERE
  343. bcl.check_from = 4
  344. AND bcl.check_status = 0
  345. AND bcl.check_sign = 1
  346. <if test="roleIds != null and roleIds.size()!=0">
  347. AND bcl.role_id not in
  348. <foreach collection="roleIds" item="item" index="index" open="(" close=")" separator=",">
  349. #{item}
  350. </foreach>
  351. </if>
  352. AND bcl.order_sn = v.order_sn)>0
  353. </if>
  354. order by v.create_time
  355. </select>
  356. <select id="getMonthCreditWaitCount" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="Long">
  357. SELECT
  358. count(*)
  359. FROM
  360. top_old_order v
  361. LEFT JOIN sys_tenant st ON v.tenant_id = st.tenant_id
  362. LEFT JOIN
  363. top_old_order_check_log cl ON cl.check_from = 4 AND cl.check_sign = 1 AND v.order_sn = cl.order_sn
  364. LEFT JOIN top_sys_role r ON cl.role_id = r.role_id
  365. LEFT JOIN top_order_bank_pay bp ON bp.type = 4 AND bp.order_sn = v.order_sn AND bp.result_status = 1
  366. WHERE
  367. 1 = 1
  368. <if test="accomplishStartTime != null and accomplishStartTime != ''">
  369. AND v.accomplish_time BETWEEN #{accomplishStartTime} and #{accomplishEndTime}
  370. </if>
  371. <if test="tenantId != null and tenantId != ''">
  372. AND v.tenant_id = #{tenantId}
  373. </if>
  374. <if test="createNo != null and createNo != ''">
  375. AND (v.create_no = #{createNo} or v.create_username like concat('%', #{createNo}, '%'))
  376. </if>
  377. <if test="orderSn != null and orderSn != ''">
  378. AND v.order_sn = #{orderSn}
  379. </if>
  380. AND v.finish_status = 1
  381. AND v.brokerage > 0
  382. AND (SELECT
  383. count(*)
  384. FROM
  385. top_old_order_check_log bcl
  386. WHERE
  387. bcl.check_from = 4
  388. AND bcl.check_status = 0
  389. AND bcl.check_sign = 1
  390. <if test="roleIds != null and roleIds.size()!=0">
  391. AND bcl.role_id in
  392. <foreach collection="roleIds" item="item" index="index" open="(" close=")" separator=",">
  393. #{item}
  394. </foreach>
  395. </if>
  396. AND bcl.order_sn = v.order_sn)>0
  397. </select>
  398. <select id="getMonthRefundList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
  399. SELECT
  400. tor.order_sn,
  401. tor.divide_money,
  402. tor.tenant_id,
  403. tor.refund_sn,
  404. v.create_no,
  405. v.create_username
  406. FROM
  407. top_old_order_refund tor
  408. LEFT JOIN v_top_order v on tor.order_sn = v.order_sn
  409. WHERE
  410. 1 = 1
  411. AND tor.period_status = 3
  412. <if test="divideModel != null and divideModel != ''">
  413. AND tor.divide_model = #{divideModel}
  414. </if>
  415. <if test="refundTimeStartTime != null and refundTimeStartTime != ''">
  416. AND tor.refund_time BETWEEN #{refundTimeStartTime} and #{refundTimeEndTime}
  417. </if>
  418. <if test="tenantId != null and tenantId != ''">
  419. AND tor.tenant_id = #{tenantId}
  420. </if>
  421. <if test="createNo != null and createNo != ''">
  422. AND v.create_no = #{createNo}
  423. </if>
  424. <if test="createSysUserId != null and createSysUserId !=0">
  425. AND v.create_sys_user_id = #{createSysUserId}
  426. </if>
  427. <if test="createSysUserId == 0">
  428. AND (v.create_sys_user_id is null or v.create_sys_user_id = 0)
  429. </if>
  430. </select>
  431. <select id="getMonthBadSum" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="BigDecimal">
  432. SELECT
  433. IFNULL(SUM(too.order_uncollected),0)
  434. FROM
  435. top_old_order too
  436. WHERE
  437. too.status=1
  438. AND too.check_status = 1
  439. <if test="buyStartTime != null and buyStartTime != ''">
  440. AND too.check_time <![CDATA[ >= ]]> #{buyStartTime}
  441. </if>
  442. <if test="buyEndTime != null and buyEndTime != ''">
  443. AND too.check_time <![CDATA[ <= ]]> #{buyEndTime}
  444. </if>
  445. <if test="tenantId != null and tenantId != ''">
  446. AND too.tenant_id = #{tenantId}
  447. </if>
  448. </select>
  449. <select id="getMonthFinishAllSeller" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopCreateUserVo">
  450. SELECT
  451. v.create_sys_user_id,
  452. any_value (v.create_username) create_username,
  453. v.tenant_id
  454. FROM
  455. v_top_order v
  456. WHERE
  457. 1 = 1
  458. AND v.finish_status = 1
  459. <if test="divideModel != null and divideModel != ''">
  460. AND v.divide_model = #{divideModel}
  461. </if>
  462. <if test="accomplishStartTime != null and accomplishStartTime != ''">
  463. AND v.accomplish_time BETWEEN #{accomplishStartTime} and #{accomplishEndTime}
  464. </if>
  465. <if test="tenantId != null and tenantId != ''">
  466. AND v.tenant_id = #{tenantId}
  467. </if>
  468. <if test="createNo != null and createNo != ''">
  469. AND v.create_no = #{createNo}
  470. </if>
  471. GROUP BY v.create_sys_user_id,v.tenant_id
  472. </select>
  473. <select id="getByOrderSn" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
  474. SELECT
  475. tdo.*
  476. FROM
  477. top_divide_order tdo
  478. LEFT JOIN top_divide_log dl on tdo.divide_log_id = dl.id
  479. WHERE
  480. 1 = 1
  481. AND tdo.order_type = 1
  482. <if test="divideType != null and divideType != ''">
  483. AND dl.divide_type = #{divideType}
  484. </if>
  485. <if test="orderSn != null and orderSn != ''">
  486. AND tdo.order_sn = #{orderSn}
  487. </if>
  488. LIMIT 1
  489. </select>
  490. <update id="updateCheckStatusById" parameterType="com.zhongzheng.modules.top.order.domain.TopOrderBankPay" >
  491. UPDATE top_divide_order tdo
  492. LEFT JOIN top_divide_log dl ON tdo.divide_log_id = dl.id
  493. LEFT JOIN top_old_order_check_log cl ON ( dl.divide_type + 1 ) = cl.check_from
  494. AND cl.check_sign = 1
  495. AND tdo.order_sn = cl.order_sn
  496. <set>
  497. cl.check_status = 3
  498. </set>
  499. where
  500. tdo.order_type = 1
  501. AND tdo.divide_log_id = #{divideLogId}
  502. AND cl.check_status = 2
  503. </update>
  504. </mapper>