def show_teller(sql, arg): header = '柜员号,姓名,电话,柜员级别,柜组,机构号,员工号,执行交易组,转账限额,现金限额,认证类型,状态,屏蔽交易,岗位性质,启用日期,停用日期,交易币种,发起交易组,证件种类,证件号码,是否运营人员'.split( ',') for tlr in fetch(sql, arg): tlr = list(tlr) tlr[3] = {'0': '0-经办', '1': '1-主办', '2': '2-主管'}.get(tlr[3]) tlr[-11] = {'0': '0-密码', '1': '1-指纹'}.get(tlr[-11]) tlr[-8] = { '0': '0-非管库员', '1': '1-管库员', '2': '2-机器柜员', '3': '3-行外人员' }.get(tlr[-8]) tlr[-3] = {'1': '1-身份证'}.get(tlr[-3], tlr[-3]) gw = tlr.pop(7) tprint(zip(header, tlr), {0: '20'}) g = [] jndj = set() for i, y in enumerate(gw.split(',')): if i % 2 == 0 and y: x = POST[i // 2] v = fetchvalue( f"select group_concat(memo,',') from eddj where code in ('{y[:2]}','{y[2:]}')" ) g.append((x, v)) elif i % 2 == 1: jndj.add(y) tprint(g, {0: '20'}) jndj.remove('') print('技能等级: ', *jndj)
def main(km=None, list_=False): print(f'数据版本:{get_ver("xxbm")}') if km: for kemu, bm, name in fetch("select km,bm,name from xxbm where km=?", [km]): print(f'\n{kemu} {name}') print(f'编码 {bm}') tprint(zip(names.split(','), split(bm)), format_spec={0: '10'}) if list_: fprintf("{:6s} {:40s} {:50s}", "select km,bm,name from xxbm")
def main(cls, **options): if options['fetch']: cls.fetch() rq = options.get('rq') if rq != 'noset': rq = rq or datetime.today() % ('%Y-%m-%d') obj = cls.objects.get(rq) if rq: print(f'日期: {rq}') tprint(obj.hv, format_spec={0: '10', 1: '>10.4f'})
def list_teller(cond, arg=[]): print('柜员号 姓名 员工号 机构 状态') tprint( fetch( f'select id,name,userid,branch,zt from teller where {cond} order by id', arg), { 0: '8', 1: '20', 2: '8', 3: '10' })
def main(query): db = connect('~/.data/params.db') print(f'数据版本:{get_ver("ggjgm")}') with closing(db): if R / r'\d{2}' == query: data = db.fetch('select * from ggjgm where jglx=?', [query]) elif R / r'316\d{1,9}' == query: data = db.fetch(f'select * from ggjgm where zfhh like "{query}%"') elif R / r'\d{3,9}' == query: data = db.fetch(f'select * from ggjgm where jgm like "{query}%"') else: data = db.fetch(f'select * from ggjgm where mc like "%{query}%"') tprint(data, format_spec={1: '40', 2: '10'})
def query_jy(query): "查询交易列表" sql = 'select jym,jymc,jyz,fjjyz from jym' if R / r'\d{4}' == query: query_jym(query) return elif R / r'[A-Z]{2}((\d{3})?[A-Z])?' / query: rows = fetch(f'{sql} where jyz like "{query}%" order by jym') else: rows = fetch(f'{sql} where jymc like "%{query}%" order by jym') if rows: tprint(rows, format_spec={ 0: "6", 1: '50', 2: '8', })
def main(query): header = '机构', '部门', '姓名', '职务', '办公电话', '传真', '手机', '电子邮件' ver = get_ver('txl') print('数据版本:', ver) if R / r'1[3578]\d{1,9}' == query: sql = f'select * from txl where mobile like "{query}%" ' elif R / r'\d{4}' == query: sql = (f'select * from txl where (tel like "%8765{query}" ' f' or tel like "%8826{query}" or tel like "%5719{query}")' f'and br="浙商银行股份有限公司"') elif R / r'\d{1,}' == query: sql = f'select * from txl where tel like "%{query}%" ' elif R / r'[A-Za-z].*' == query: sql = f'select * from txl where email like "%{query}%" ' else: sql = f'select * from txl where name like "%{query}%" or br like "%{query}%"' for r in fetch(sql): tprint(zip(header, r), {0: '10'}) print('\n')
def query_jym(jym): "查询单个交易码" row = fetchone(f'{QUERYJYM} where a.jym=?', [jym]) if row: data = zip([x['header'] for x in HEASER], convert_row(row)) tprint(data, format_spec={0: '20'})