多表关联查询

首先Java代码中不建议使用多表查询。正常情况下应该由数据库负责人来提供相关的视图或存储过程。

常用格式如下,其中查询条件与其他查询格式一致

	set = service.querys(TableBuilder.init().setTable("CRM_TENANT AS M")
				.left("CRM_USER AS U","M.USER_ID = U.ID")
				.build());

        set = service.querys(TableBuilder.init("SD_ORDER AS M")
                .left("CRM_USER AS U","M.USER_ID = U.ID")
                .left("CRM_TENANT AS T","M.TENANT_ID = T.ID")
                .build());


        set = service.querys(TableBuilder.init("SD_ORDER(M.ID,U.NM,T.NM AS TENANT_NM) AS M")
                .left("CRM_USER AS U","M.USER_ID = U.ID")
                .left("CRM_TENANT AS T","M.TENANT_ID = T.ID")
                .build()
            ,condition(true,"M.ID:od","TENANT_ID:tt"));

其他文档