列表页筛选条件里的条件不是主表的,比如我想筛选的条件是user表里,这个最后的参数subCnd怎么写呢。现在我这么写点查询之后没反应
public Object data(@Param("userName") String userName, @Param("mobile") String mobile, @Param("startDate") String startDate, @Param("endDate") String endDate,@Param("length") int length, @Param("start") int start, @Param("draw") int draw, @Param("::order") List<DataTableOrder> order, @Param("::columns") List<DataTableColumn> columns) {
Cnd cnd = Cnd.NEW().and("delFlag", "=", 0);
Cnd subCnd = Cnd.NEW();
if (!Strings.isBlank(userName)) {
subCnd.and("user.username", "like", "%" + userName + "%");
}
if (!Strings.isBlank(mobile)) {
subCnd.and("user.mobile", "like", "%" + mobile + "%");
}
return appFeedbackService.data(length, start, draw, order, columns, cnd, "dict|user",subCnd);
}