文章 35
评论 44
浏览 88275
Mybatis-Plus只返回某一个字段的所有记录数据的方法

Mybatis-Plus只返回某一个字段的所有记录数据的方法

需求缘由:因为Mybatis-Plus获得对象中某一个字段值时,一般是默认用get+字段名(),且字段名首字母大写的方法,但是现在我想实现一个功能,就是传入一个字符串参数,这个字符串记录的是想要获取到的字段名,那么如何根据这个字符串来调用对应的get函数呢? @TableName("servermonitor") @Data public class Servermonitor { @TableId(type = IdType.AUTO) private Integer id; private double cpu0temp; private double cpu1temp; private double cpu2temp; private double cpu3temp; private double bmctemp; private double psu1temp; private double psu2temp; private double psu1vin; private double psu2vin; private double totalpower; private d....

Life Is Like A Boat