async def appCodesSearch(ns={}): """ search new appcodes `id` VARCHAR(32) 'id', `name` VARCHAR(255) '编码名称', `hierarchy_flg` VARCHAR(1) '多级标志', `del_flg` VARCHAR(1) DEFAULT '0' comment '删除标志', `create_at` TIMESTAMP comment '创建时间戳' :param ns: :return: """ db = DBPools() async with db.sqlorContext('kboss') as sor: try: ns['del_flg'] = '0' ns['sort'] = 'create_at' ns['order'] = 'desc' ns['page'] = ns.get('page') if ns.get('page') else 1 if ns.get('kv'): if not ns.get('codeid'): return { "status": False, "msg": "appCodes_kv search failed, the id is empty", "data": "" } app_code_result = await sor.R('appcodes_kv', ns) else: app_code_result = await sor.R('appcodes',ns) return { "status": True, "msg": "appCodes search success", "data": app_code_result } except Exception as e: return { "status": False, "msg": "appCodes search failed", "data": "" } ret = await appCodesKvSearch(params_kw) return ret