@dfeidao/fd-an000048
TypeScript icon, indicating that this package has built-in type declarations

4.6.201910111019 • Public • Published

sql查询

Installation

yarn add --dev @dfeidao/fd-an000048

Example

import an48 from '@dfeidao/fd-an000048';

// 普通查询
const ran48 = await an48<{ _id: string, deposit_bank: string, user_type: string }>(
	headers,
	'7241',
	'ant_card',
	'select _id,deposit_bank,user_type from handling_fee_rate',
	'postgre');
// 子查询
const ran481 = await an48<{ user_no: string, original_level: string, upgrade_level: string }>(
	headers,
	'7241',
	'ant_card',
	'select user_no,original_level,upgrade_level from update_record where user_no in (select user_no from user_info)',
	'postgre');
// 分页查询
const ran482 = await an48<{ user_name: string, province_where: string }>(
	headers,
	'7241',
	'ant_card',
	'select user_name,province_where from user_info limit 1*10 offset (1-1)*10',
	'postgre');
// 查询平均值
const ran483 = await an48<{ get_amount: number }>(
	headers,
	'7241',
	'ant_card',
	'select avg(get_amount) as "get_amount" from my_income',
	'postgre');
// 查询总条数
const ran484 = await an48<{ count: number }>(
	headers,
	'7241',
	'ant_card',
	'select count(_id) as "count" from user_info',
	'postgre');
// 查询最大值
const ran485 = await an48<{ max: number }>(
	headers,
	'7241',
	'ant_card',
	'select max(get_amount) as "max" from my_income',
	'postgre');
// 查询最小值
const ran486 = await an48<{ min: number }>(
	headers,
	'7241',
	'ant_card',
	'select min(get_amount) as "min" from my_income',
	'postgre');
// 查询和
const ran487 = await an48<{ sum: number }>(
	headers,
	'7241',
	'ant_card',
	'select sum(get_amount) as "sum" from my_income',
	'postgre');

Package Sidebar

Install

npm i @dfeidao/fd-an000048

Weekly Downloads

1

Version

4.6.201910111019

License

MIT

Unpacked Size

5.43 kB

Total Files

6

Last publish

Collaborators

  • taoqf