我有以下查询
@Query("SELECT DBITM.ItemNumber, DBITM.Description, DBCRI.SuggestedQty, DBCRI.WTDSalesQty, DBCRI.DemandQty, DBITM.UnitsPerCase, DBCST.SuggestSalesFlag " +
"FROM DBCST" +
"INNER JOIN DBCRI ON DBCRI.CustomerNumber = :customerNumber and DBCST.CustomerNumber = :customerNumber " +
"INNER JOIN DBITM ON DBITM.ItemNumber = DBCRI.ItemNumber ")
上面的查询给了我一个
List<MyPojo>
然而,现在MyPojo将有一个嵌入式BatchDetails对象,如此
public int ItemNumber;
public String Description;
public float SuggestedQty;
public float WTDSalesQty;
public int DemandQty;
public int UnitsPerCase;
public int SuggestSalesFlag;
public int BatchEntryEnabled;
public List<BatchDetails> BatchDetails;//This will have the batch details
我想查询DBITM.ItemNumber(来自上面的查询)中可用的ItemNumber的所有批次详细信息,如果没有匹配的ItemNumber,则匹配DBBTC.ItemNumber(BatchDetails表),MyPojo中的BatchDetails应该被填充使用默认值或可以为null(查询速度更快)。
请提供原始sqlite查询以执行上述操作。