//通过createUserId获取到createUserName @Mappings({ @Mapping(target = "createUserName", expression = "java(com.test.NameConverter.getUserNameById(entity.getCreateUserId()))"), }) StudentVO studentEntityTOVO(StudentEntity entity);
public class NameConverter { public static String getUserNameById(String id){ //通过id获取用户姓名 StudentEntity student = StudentCache.getStudent(id); if(student !=null){ return student .getName(); } return null; } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)