注:TBL_HANDLELOG为日志表,status为同步状态,此表记录需要同步的记录信息。以下SQL对TBL_HANDLELOG的过滤可以注释

一、单位同步

1.1 查询体软单位数据

  1. select
  2. a.RWID00 as hisCompanyCode,
  3. b.TTqC00||'('||a.RWID00||')' as hisCompanyName,
  4. b.YYBH00 as hishospitalcode,
  5. a.TTID00 as groupId,
  6. a.RWYDRQ as examStart,
  7. a.YDZZRQ as examEnd,
  8. sysdate as insertTime,
  9. 1 as operateType,
  10. 1 as busiType,
  11. 0 as upload
  12. from HM_YW_TTRW00 a inner join HM_YW_TJTT00 b on a.TTID00=b.TTID00
  13. where exists(select 1 from TBL_HANDLELOG where KEYID = A.RWID00 and status = 0 and BUSCODE = 'COMPANYADD')

1.2 查看中间表

  1. select * from TBL_INV_Company;

只上传upload=0的单位
upload=1表示已上传

二、套餐同步

2.1 查询体软套餐信息

  1. select * from TBL_Group_MEAL_V

2.2 查看中间表

  1. select * from TBL_INV_Company;

只上传upload=0且type=1的单位
upload=1表示已上传
注:需保证单位已上传,才会同步套餐

三、订单同步

文档更新时间: 2024-03-12 16:51