注:TBL_HANDLELOG为日志表,status为同步状态,此表记录需要同步的记录信息。以下SQL对TBL_HANDLELOG的过滤可以注释
一、单位同步
1.1 查询体软单位数据
select
a.RWID00 as hisCompanyCode,
b.TTqC00||'('||a.RWID00||')' as hisCompanyName,
b.YYBH00 as hishospitalcode,
a.TTID00 as groupId,
a.RWYDRQ as examStart,
a.YDZZRQ as examEnd,
sysdate as insertTime,
1 as operateType,
1 as busiType,
0 as upload
from HM_YW_TTRW00 a inner join HM_YW_TJTT00 b on a.TTID00=b.TTID00
where exists(select 1 from TBL_HANDLELOG where KEYID = A.RWID00 and status = 0 and BUSCODE = 'COMPANYADD')
1.2 查看中间表
select * from TBL_INV_Company;
只上传upload=0的单位
upload=1表示已上传
二、套餐同步
2.1 查询体软套餐信息
select * from TBL_Group_MEAL_V
2.2 查看中间表
select * from TBL_INV_Company;
只上传upload=0且type=1的单位
upload=1表示已上传
注:需保证单位已上传,才会同步套餐
三、订单同步
文档更新时间: 2024-03-12 16:51