1. Get the Entity and update it

     EhrIndexInfoChangeRecord ehrIndexInfoChangeRecord = baseMapper.selectOne(
             new LambdaQueryWrapper<EhrIndexInfoChangeRecord>().
                     eq(EhrIndexInfoChangeRecord::getArchivesId, archieveId).
                     eq(EhrIndexInfoChangeRecord::getIndexCode, indexCode).
                     orderByDesc(EhrIndexInfoChangeRecord::getIndexTime).last("limit 1"));
     ehrIndexInfoChangeRecord.setIndexVal(value);
    
     baseMapper.updateById(ehrIndexInfoChangeRecord);
     
    Copy the code
  2. If this is the case, all eligible queries will be updated, which feels dangerous

     EhrIndexInfoChangeRecord ehrIndexInfoChangeRecord = new EhrIndexInfoChangeRecord();
     ehrIndexInfoChangeRecord.setIndexVal(value);
    
     baseMapper.update(ehrIndexInfoChangeRecord, new LambdaQueryWrapper<EhrIndexInfoChangeRecord>().eq(
             EhrIndexInfoChangeRecord::getArchivesId, archieveId).eq(EhrIndexInfoChangeRecord::getIndexCode, indexCode));
    Copy the code