使用一下方法,cnd都是null,参数传过来了
方法1:
Cnd cnd = Strings.isBlank(yearString)? null : Cnd.where("year","=",yearString);
// cnd = Strings.isBlank(allotId)? null : Cnd.where ("allotId","=",allotId);
方法2:
Cnd cnd = Cnd.NEW();
and(cnd,"year","=",yearString);
and(cnd,"allotId","=",allotId);
public static Cnd and(Cnd cnd, String k, String op, Object val) {
if (val != null)
cnd.and(k, op, val);
return cnd;
}