常用数据库操作

service.query("HR_USER");
//SELECT * FROM HR_USER

service.query("HR_USER(ID,NM)");
//SELECT ID,NM FROM HR_USER

service.query("HR_USER","ORDER BY ID"); 
//SELECT * FROM HR_USER ORDER BY ID

service.query("CRM_USRE(DISTINCT AGE)");
//SELECT DISTINCT AGE FROM HR_USER

service.query("HR_USER(ROLE_ID,COUNT(ID) AS QTY)", "GROUP BY ROLE_ID");
//SELECT ROLE_ID,COUNT(ID) AS QTY FROM HR_USER ORDER BY ROLE_ID

service.qurey("HR_USER(ID,NM,{CASE WHEN AGE >20 THEND 1 ELSE 2 END AS AGE_SORT})");//如果列很复杂用{}区分开
//SELECT ID,NM, CASE WHEN AGE >20 THEND 1 ELSE 2 END AS AGE_SORT FROM HR_USER

//多表查询
service.querys(TableBuilder.init().setTable("CRM_TENANT AS M")
      .left("HR_USER AS U","M.USER_ID = U.ID")
      .build());
service.querys(TableBuilder.init("SD_ORDER AS M")
      .left("HR_USER AS U","M.USER_ID = U.ID")
      .left("CRM_TENANT AS T","M.TENANT_ID = T.ID")
       .build());
service.querys(TableBuilder.init("SD_ORDER(M.ID,U.NM,T.NM AS TENANT_NM) AS M")
       .left("HR_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"));
其他文档