新增游标抓取逻辑,优化UUID到新同步服务的查询和Redis配置
This commit is contained in:
@@ -4,15 +4,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.price.migration.mapper.UuidToNewSyncMapper">
|
||||
|
||||
<select id="selectPendingBillIds" resultType="String">
|
||||
select o.bill_id
|
||||
<select id="selectPendingBillIds" resultType="com.bms.price.migration.domain.UuidToNewPendingRow">
|
||||
select o.bill_id as billId, o.create_time as createTime
|
||||
from prc_order_bill o
|
||||
left join mig_bi_order_done d on d.old_bill_id = o.bill_id
|
||||
where d.old_bill_id is null
|
||||
where 1 = 1
|
||||
<if test="lastCreateTime != null and lastBillId != null and lastBillId != ''">
|
||||
and (
|
||||
o.create_time > #{lastCreateTime}
|
||||
or (o.create_time = #{lastCreateTime} and o.bill_id > #{lastBillId})
|
||||
)
|
||||
</if>
|
||||
and not exists (
|
||||
select 1 from mig_bi_order_done d
|
||||
where d.old_bill_id = o.bill_id
|
||||
)
|
||||
order by o.create_time, o.bill_id
|
||||
limit #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectPendingCursorBootstrap" resultType="com.bms.price.migration.domain.UuidToNewPendingRow">
|
||||
select o.bill_id as billId, o.create_time as createTime
|
||||
from mig_bi_order_done d
|
||||
inner join prc_order_bill o on o.bill_id = d.old_bill_id
|
||||
order by o.create_time desc, o.bill_id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectOrderNo" resultType="String">
|
||||
select order_no from prc_order_bill where bill_id = #{oldBillId} limit 1
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user