-
Notifications
You must be signed in to change notification settings - Fork 11
dbquery.md
左文建 edited this page Sep 5, 2016
·
2 revisions
/**
* arrIns 自动将$couponQueryDTO映射到couponDTO,根据表达式映射成sql语句
* 解析后的sql语句为 select * from coupon where id=xxx
*/
$queryDTO = new CouponDTO;
$queryDTO->id = $queryArr['id'];
$data = dbquery::list_coupon_by_dto($queryDTO);
/**
* 等于
* 解析后的sql语句为 select * from coupon where id=xxx
*/
$queryDTO = new CouponDTO;
$queryDTO->id = 'xxx';
$data = dbquery::list_coupon_by_dto($queryDTO);
/**
* 大于
* 解析后的sql语句为 select * from coupon where id>xxx
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '>xxx';
/**
* 大于等于
* 解析后的sql语句为 select * from coupon where id>=xxx
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '>=xxx';
/**
* 小于
* 解析后的sql语句为 select * from coupon where id<xxx
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '<xxx';
/**
* 小于等于
* 解析后的sql语句为 select * from coupon where id<=xxx
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '<=xxx';
/**
* 开区间
* 解析后的sql语句为 select * from coupon where id>xxxA and id <xxxB
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '(xxxA,xxxB)';
$data = dbquery::list_coupon_by_dto($queryDTO);
/**
* 闭区间
* 解析后的sql语句为 select * from coupon where id>=xxxA and id <=xxxB
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '[xxxA,xxxB]';
/**
* 半开半闭区间
* 解析后的sql语句为 select * from coupon where id>xxxA and id <=xxxB
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '(xxxA,xxxB]';
/**
* 半开半闭区间
* 解析后的sql语句为 select * from coupon where id>=xxxA and id <xxxB
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '[xxxA,xxxB)';
/**
* in 查询
* 解析后的sql语句为 select * from coupon where id in(xxxA,xxxB)
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '{xxxA,xxxB}';
$data = dbquery::list_coupon_by_dto($queryDTO);
/**
* not in 查询
* 解析后的sql语句为 select * from coupon where id not in (xxxA,xxxB)
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '!{xxxA,xxxB}';
/**
* like 查询
* 解析后的sql语句为 select * from coupon where name like '%xxx%'
*/
$queryDTO = new CouponDTO;
$queryDTO->id = 'like(xxx)';
$data = dbquery::list_coupon_by_dto($queryDTO);
/**
* notlike 查询
* 解析后的sql语句为 select * from coupon where name not like '%xxx%'
*/
$queryDTO = new CouponDTO;
$queryDTO->id = '!like(xxx)';
$data = dbquery::list_coupon_by_dto($queryDTO);