这个是拼接的sql语句
Cnd c=Cnd.NEW();
c.where().and("recommend_type","=",type).and("recommend_area","=",area);
c.and("UNIX_TIMESTAMP(recommend_begintime)","<=","UNIX_TIMESTAMP("+dateUtil.currentDatetime(time)+")").and("UNIX_TIMESTAMP(recommend_endtime)",">=","UNIX_TIMESTAMP("+dateUtil.currentDatetime(time)+")");
c.asc("recommend_area_order");
得到的sql语句是
SELECT * FROM os_recommend WHERE recommend_type=0 AND recommend_area=0 AND UNIX_TIMESTAMP(recommend_begintime) <= 'UNIX_TIMESTAMP(2017-04-11 02:39:35)' AND UNIX_TIMESTAMP(recommend_endtime) >= 'UNIX_TIMESTAMP(2017-04-11 02:39:35)' ORDER BY recommend_area_order ASC
但是我想要的sql语句是这种的
SELECT * FROM os_recommend
WHERE recommend_type=0 AND recommend_area=0
AND UNIX_TIMESTAMP(recommend_begintime)<= UNIX_TIMESTAMP('2017-04-11 13:29:58') AND UNIX_TIMESTAMP(recommend_endtime)>= UNIX_TIMESTAMP('2017-04-11 13:29:58')
ORDER BY recommend_area_order ASC
有大神在不,求教求教