firemail
标题:
Dao常用实现
[打印本页]
作者:
java
时间:
2017-11-9 15:50
标题:
Dao常用实现
本帖最后由 java 于 2017-11-9 15:55 编辑
//删除
StatGroupExample example = new StatGroupExample();
example.or().andGroupIdEqualTo(groupId);
return statGroupMapper.deleteByExample(example);
复制代码
//获取
public Integer getCouponIdByDetail(Coupon coupon) {
CouponExample example = new CouponExample();
example.createCriteria().andNameEqualTo(coupon.getName())
.andTypeEqualTo(coupon.getType())
.andStatusEqualTo(coupon.getStatus())
.andPriceEqualTo(coupon.getPrice())
.andUsePriceEqualTo(coupon.getUsePrice()
.andEndTimeEqualTo(coupon.getEndTime());
List<Coupon> coupons = couponMapper.selectByExample(example);
if (coupons.size() == 0) {
return null;
}
return coupons.get(0).getId();
}
复制代码
欢迎光临 firemail (http://firemail.wang:8088/)
Powered by Discuz! X3