NutzCN Logo
问答 Cnd 里面可以添加函数么?
发布于 3142天前 作者 wendal 2184 次浏览 复制 上一个帖子 下一个帖子
标签:

这样的SQL

Select * from recommend where Now() between StartTime and EndTime
StartTime  EndTime  是数据库字段
3 回复

用Static

Cnd.where(new Static("Now() between StartTime and EndTime"));

反向解决了,, 真是神奇的东西

dao.func2(OutStockGoodsItem.class, "sum", "cktaxe", Cnd.where(new Static("ck in (select ck from t_ckd where yxbz = '1' and status = 0  and shrq >= '" + DateUtil.getQueryTimeByStart(startTime) + "'" +
                " and shrq <= '" + DateUtil.getQueryTimeByEnd(endTime) + "')")));
添加回复
请先登陆
回到顶部