LambdaQueryWrapper
LambdaQueryWrapper
解决拼接条件表达式时候,数据库字段名写错导致异常的问题
代码范例
LambdaQueryWrapper<AlarmRuleNew> alarmRuleNewLambdaQueryWrapper = new LambdaQueryWrapper<AlarmRuleNew>();
// 写表达式时,直接用::形式获取对应的字段名
alarmRuleNewLambdaQueryWrapper.eq(AlarmRuleNew::getRuleKey,"3");
List<AlarmRuleNew> list = daoContext.getAlarmRuleNewDaoService().list(alarmRuleNewLambdaQueryWrapper);
原创:做时间的朋友