Sql sql = Sqls.create("select d.did,d.dname dname,d.pdid,d.cindex,pd.dname pdname from Ddept d LEFT JOIN DDEPT pd on d.pdid = pd.did ORDER BY d.cindex");
sql.setCallback(Sqls.callback.records());
dao.execute(sql);
List<Record> list = sql.getList(Record.class);
"list": [
{
"did": 44,
"dname": "业务部",
"pdid": 41,
"cindex": 1,
"pdname": "行政部"
},
{
"did": 45,
"dname": "售后部",
"pdid": 0,
"cindex": 1
},
{
"did": 51,
"dname": "asdsa",
"pdid": 49,
"cindex": 1,
"pdname": "阿"
},
{
"did": 41,
"dname": "行政部",
"pdid": 0,
"cindex": 2
},
{
"did": 42,
"dname": "人事",
"pdid": 41,
"cindex": 2,
"pdname": "行政部"
},
{
"did": 49,
"dname": "阿",
"pdid": 44,
"cindex": 2,
"pdname": "业务部"
},
{
"did": 50,
"dname": "122",
"pdid": 41,
"cindex": 121,
"pdname": "行政部"
}
],
pdname为null的没显示