--更新银企日志查询
UPDATE t_bei_banklog as lg
 SET fsourceid = (SELECT bei.fid FROM t_bei_bankpayingbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_bankpaybill' and fsourceid is null;
UPDATE t_bei_banklog as lg
 SET fsrcbizid = (SELECT bei.fsourcebillid FROM t_bei_bankpayingbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_bankpaybill' and fsrcbizid is null;
UPDATE t_bei_banklog as lg
 SET fbankpaystate = (SELECT bei.fbankpaystate FROM t_bei_bankpayingbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_bankpaybill' and fbankpaystate is null;

UPDATE t_bei_banklog as lg
 SET fsourceid = (SELECT bei.fid FROM t_bei_bankagentpaybill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_bankagentpay' and fsourceid is null;
UPDATE t_bei_banklog as lg
 SET fsrcbizid = (SELECT bei.fsourcebillid FROM t_bei_bankagentpaybill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_bankagentpay' and fsrcbizid is null;
UPDATE t_bei_banklog as lg
 SET fbankpaystate = (SELECT bei.fpaystate FROM t_bei_bankagentpaybill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_bankagentpay' and fbankpaystate is null;

UPDATE t_bei_banklog as lg
 SET fsourceid = (SELECT bei.fid FROM t_bei_banktransdownbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_banktransdownbill' and fsourceid is null;
UPDATE t_bei_banklog as lg
 SET fsrcbizid = (SELECT bei.fsourcebillid FROM t_bei_banktransdownbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_banktransdownbill' and fsrcbizid is null;
UPDATE t_bei_banklog as lg
 SET fbankpaystate = (SELECT bei.fpaystate FROM t_bei_banktransdownbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_banktransdownbill' and fbankpaystate is null;

UPDATE t_bei_banklog as lg
 SET fsourceid = (SELECT bei.fid FROM t_bei_banktransupbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_banktransupbill' and fsourceid is null;
UPDATE t_bei_banklog as lg
 SET fsrcbizid = (SELECT bei.fsourcebillid FROM t_bei_banktransupbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_banktransupbill' and fsrcbizid is null;
UPDATE t_bei_banklog as lg
 SET fbankpaystate = (SELECT bei.fpaystate FROM t_bei_banktransupbill as bei WHERE bei.fbillno = lg.fsourcebillno) where lg.fsourcebilltype = 'bei_banktransupbill' and fbankpaystate is null;
