方式一
通过表达式查询:
int count = testService.count( new Express(Test.T_TYPE, 1, ExpressionType.CDT_Equal), new Express(Test.T_NAME, "abc", ExpressionType.CDT_Equal)); // SELECT COUNT(*) FROM T_TEST WHERE TYPE= 1 AND NAME= 'abc' ; |
方式二:
通过IQuery,构建更复杂的条件查询:
int count = testService.queryCount(query); |