greenDao 中连接查询

1->*  查询

Person
@Id
public String renyuanbiaoshi;
public String pinyin;
public String personName;
public String xingbiemiaoshu;
public int age;
public String birthday;
public String minzumiaoshu;
public String jiguanmiaoshu;
public String shushengdimiaoshu;
public String rudangriqi;
public String canjiagongzuoriqi;
public String jiankangmiaoshu;
public String zhuanyejishuzhicheng;
public String zhuanchang;
public String zuigaoxuelijizhuanye;
public String Zuigaoxuelidaima;
public String quanrizhixuelixuewei;
public String zaizhixuelixuewei;
public String quanrizhibiyeyuanxiaojizhuanye;
public String zaizhixuelibiyeyuanxiaojizhuanye;
public String xianrenzhiwu;
public String jianli;
public String jiangchenginfo;
public String niandukaohe;
public String Zhaopianlujing;
public String A01_order;
public String gblb;
public String renyaunzuigaozhiji;
public Date renxianzhijishijian;
public Date renxianzhishijian;
public String jicenggongzuojingli;
public String quanrizhizuigaoxueli;
public String zaizhizuigaoxueli;
public String quanrizhizuigaoxuewei;
public String zaizhizuigaoxuewei;
public String sifoubanzizhengzhi;
public String seventyeightyninth;
public String zhiwucengci;
public String zzmm;
public String sanxinganbu;

Zhiwu
public String personId;
public String deptId;
public String orderBy;
public String zhiwu;
@Id
public String id;
public String banzhichengyuantype;

@ToOne(joinProperty = "personId")
public Person person;


Zhiwu.personId n<----------->1 Person.renyuanbiaoshi
(Zhiwu)
@ToOne(joinProperty="personId")
public Person person;

 

var qb = GovApp.instances?.daoSession?.personDao?.queryBuilder()
qb?.join(Zhiwu::class.java,ZhiwuDao.Properties.PersonId)?.where(ZhiwuDao.Properties.DeptId.eq("11111-00000"),ZhiwuDao.Properties.Properties.Banzichengyuantype.eq("正职"))
qb.list() as ArrayList<Person>

posted on 2018-11-09 11:15  牛博客  阅读(522)  评论(0编辑  收藏  举报