比如下面这个代码,service中的T是SaleActivityBo,然后能直接在cnd中根据SaleContentBo中的条件进行关联查询吗
public void aa() {
Cnd cnd = Cnd.NEW();
// cnd.and("sale_activity_id", "=", "da014468cb324ee4830b55c5444d6730");
List<SaleActivityBo> saleActivityBoList = dao().queryByJoin(SaleActivityBo.class, null, cnd);
List<SaleContentBo> allSaleContentBoList = new ArrayList<>();
List<SaleContentBo> saleContentBoList;
for (SaleActivityBo saleActivityBo : saleActivityBoList) {
saleContentBoList = saleActivityBo.getSaleContentBoList();
allSaleContentBoList.addAll(saleContentBoList);
}
allSaleContentBoList = dao().fetchLinks(allSaleContentBoList, null);
System.out.println(saleActivityBoList);
}
public class SaleActivityBo extends SaleActivity {
private EnumSaleActivityStatusPhase saleActivityStatusPhase;
/**
* 生效区域的集合
*/
@Many(field = "saleActivityId")
private List<EffectiveAreaBo> effectiveAreaBoList;
/**
* 优惠内容的集合
*/
@Many(field = "saleActivityId")
private List<SaleContentBo> saleContentBoList;
}
public class SaleContentBo extends SaleContent {
/**
* 保存营销规则的集合
*/
@Many(field = "saleContentId")
private List<SaleRuleBo> saleRuleBoList;
}