getRiskData.py 847 B

123456789
  1. from .flightDB import flightDB
  2. def getRiskData(fdb:flightDB,bay,time,acno,actype):
  3. res = fdb.queryTabel("RiskTable","提示内容","状态='生效' and 触发条件1 ='%s' and 触发条件2 ='%s' "%(bay,time))
  4. res1 = fdb.queryTabel("RiskTable","提示内容","状态='生效' and 触发条件3 ='%s' and 触发条件2 ='%s' " % (acno,time))
  5. res2 = fdb.queryTabel("RiskTable","提示内容","状态='生效' and 触发条件4 ='%s' and 触发条件2 ='%s' " % (actype,time))#触发条件4是机型
  6. tips = "\n [机位风险]:"+res[0][0] if res !=None and res !=[] and len(res) !=0 else ""
  7. tips = tips + "\n [机号风险]:"+res1[0][0] if res1 !=None and res1 !=[] and len(res1) !=0 else tips
  8. tips = tips + "\n [机型风险]:"+res2[0][0] if res2 !=None and res2 !=[] and len(res2) !=0 else tips
  9. return tips